Codebase problem
Both my client and server are in the same system, however, in different folders. They do not share other than Remote Interfaces. I want to test dynamic creation of stubs. However, I reciece Exceptions like Class not found exception when serializing objects between the two!!
How exactly should I use codebase? where? should I include it when I compile the server or the client? does codebase accept folders or only http servers??!!
thank you.
sorry, I meant dynamic serializing of classes.
I think I handled dynamic stubs using exportObject(this, AnyPortNumber);
any help, thank you in advance.
Similar Messages
-
Jsp:plugin codebase problem
suppose the applet class is in
TOMCAT_HOME/webapps/myapp/WEB-INF/classes/mypackage/applet.class
what the corresponding codebase for the jsp:plugin should be?
ThanksThe WEB-INF/lib and WEB-INF/classes directories are off limits cannot be referenced.
You must create and use another directory (I usually use jars) in your application's context to supply the applet. -
Hi.
I've tried using Tor Norbye's directions for dynamically putting an applet in a webpage (http://blogs.sun.com/roller/page/tor?entry=applets_in_your_webapps) and it works.
What I would like to do is to put the source code for the applet in a package. I am using a package name of "applettest" and the class file ends up in the WEB-INF/classes/applettest directory when compiled. Here is what I am setting the foo string to:
public String getFoo() {
String str = new String("<applet codebase=\"WEB-INF/classes\" code=\"applettest.HelloWorldJApplet\" width=\"300\" height=\"300\"> </applet>");
this.setFoo(str);
return this.foo;
and the applet ends up in the browser source as:
<applet codebase="WEB-INF/classes" code="applettest.HelloWorldJApplet" width="300" height="300"> </applet>
This doesn't work and I have played around with several variants of this.
Anyone have any thoughts or suggestions?
Thanks, BobBob,
for a resource (including an applet class) to be directly accessible (ie. downloadable) by a browser the resource must be put outside WEB-INF directory. This is mandated by servlet specification (in version 2.3 for example it is in section SRV 9.5) :
<spec>
A special directory exists within the application hierarchy named �WEB-INF�.
This directory contains all things related to the application that aren�t in the
document root of the application. The WEB-INF node is not part of the public
document tree of the application. No file contained in the WEB-INF directory may be served directly to a client by the container
</spec>
There is of course an indirect way of serving a resource from under WEB-INF to a browser - to have a servlet that will take a relative path to requested resource as a parameter and will stream the resource back. -
Problem in icon deploying in application server 10 g
Dear Friends,
I am having a surprising experience in deploying icon in application server 10g.
I have created a jar file 'myAppIcons.jar' containing only gif files. then I have put the jar file in <OracleHome>\forms\java\. Then I have made following changes in the formsweb.cfg files.
1. I have changed archive_jini=frmall_jinit.jar into archive_jini=frmall_jinit.jar, myAppIcons.jar
2. imageBase=Documentbase to imageBase=codebase
Problem is that the icons are not displayed. Surprising matter is that, if I put all the gif files in the <OracleHome>\forms\java\ , then all the icons are displaying.
Please help me by telling why it is happening....
Rgds,
lutherDear Friends,
I am having a surprising experience in deploying icon in application server 10g.
I have created a jar file 'myAppIcons.jar' containing only gif files. then I have put the jar file in <OracleHome>\forms\java\. Then I have made following changes in the formsweb.cfg files.
1. I have changed archive_jini=frmall_jinit.jar into archive_jini=frmall_jinit.jar, myAppIcons.jar
2. imageBase=Documentbase to imageBase=codebase
Problem is that the icons are not displayed. Surprising matter is that, if I put all the gif files in the <OracleHome>\forms\java\ , then all the icons are displaying.
Please help me by telling why it is happening....
Rgds,
luther -
2x RFC server on the same destination computer?
HI,
I'm new to sap and i don't know much about the way a rfc server connects to a sap gateway.
We are trying to run 2 rfc servers on the same computer. Both of them register at the same sap gateway, under diferent programID , but with the same destination.
the programID were registered with SM59.
One server registers himself, and the other no.
Any ideas?ok, so that's what i'm doing, and it doesn't work for me: as i said, it doesn't throw any kind of Exception or anything, it's just running as if the code of the remote method do nothing.
i have a different name for each of the servers,
each server extends UnicastRemoteObject and implements a R.I/F, and when i do "super(port_num)" for each one of them- i give them different port numbers.
the clients are calling the right names in the lookup
but yet, nothig works.
maybe it's a codebase problem?
where should i define the codebase in such case?
can they have each one it's own codebase?
one (of the) thing(s) i don't fully understand about rmi, is the client port: if i have a simple client-server system on different computers, the client is "connecting out-wards" through the rmiregistry port (1099) ??
if so, when i have 2 clients on the same computer- they'll both try to
connect through the same port (1099) wouldn't that create a collision?? -
Why jws doesn't start when i use jsp as dynamic jnlp?
hello everyone,
i use a jsp as dynamic jnlp to resolve the relative codebase problem,but jws can not start. while i use jnlp, there is no problem.i check the http head the jsp reterned,it seems no problem (it returns "application/x-java-jnlp-file" content type), but jws does not start and the browser opens it as a plan text. below is the http head the jsp and jnlp returned, i can not see any obvious difference that prevent jws start. hope somobody can help me, thanks.
the jsp http head:
HTTP/1.1 200 OK
Content-Type: application/x-java-jnlp-file
Date: Wed, 07 Aug 2002 02:52:31 GMT
Server: Apache Tomcat/4.0.2 (HTTP/1.1 Connector)
Connection: close
Set-Cookie: JSESSIONID=EDAB1A3175B3D319BA33AE090EB973BF;Path=/webims
the jnlp http head:
HTTP/1.1 200 OK
Content-Type: application/x-java-jnlp-file
Content-Length: 372
Date: Wed, 07 Aug 2002 02:49:58 GMT
Server: Apache Tomcat/4.0.2 (HTTP/1.1 Connector)
Connection: close
Last-Modified: Wed, 07 Aug 2002 02:35:19 GMT
ETag: "372-1028687719000"
the response body is same. here is part of the jsp file:
<%@ page contentType="application/x-java-jnlp-file"%>
<%
StringBuffer codebaseBuffer = new StringBuffer();
codebaseBuffer.append(!request.isSecure() ? "http://" : "https://");
codebaseBuffer.append(request.getServerName());
if (request.getServerPort() != (!request.isSecure() ? 80 : 443))
codebaseBuffer.append(':');
codebaseBuffer.append(request.getServerPort());
codebaseBuffer.append(request.getContextPath());
%>
<?xml version="1.0" encoding="UTF-8"?>
<jnlp codebase="<%=codebaseBuffer.toString()%>" href="<%=request.getRequestURI()%>">I get the same problem since I moved to Tomcat 4.1.18.
The difference is that when I look at a jnlp, I get
Date: Tue, 18 Mar 2003 10:58:25 GMT
Server: Apache/1.3.26 (Unix) mod_jk/1.2.0 mod_ssl/2.8.10 OpenSSL/0.9.6b PHP/4.2.3 FrontPage/5.0.2.2510
Content-Length: 1355
Content-Type: application/x-java-jnlp-file
Last-Modified: Mon, 17 Mar 2003 15:58:46 GMT
Client-Date: Tue, 18 Mar 2003 10:58:25 GMT
Client-Peer: 192.197.110.222:80
and at a jsp:
Date: Tue, 18 Mar 2003 11:06:10 GMT
Server: Apache/1.3.26 (Unix) mod_jk/1.2.0 mod_ssl/2.8.10 OpenSSL/0.9.6b PHP/4.2.3 FrontPage/5.0.2.2510
Content-Type: application/x-java-jnlp-file;charset=ISO-8859-1
Client-Date: Tue, 18 Mar 2003 11:06:10 GMT
Client-Peer: 192.197.110.222:80
Set-Cookie: JSESSIONID=026BF3209EC094A4045F1D37C2A0E98B;Path=/
Could the difference be ;charset=ISO-8859-1
How to remove that, in my jsp I just have :
<% response.setContentType("application/x-java-jnlp-file"); %>
Help
Benoit -
I don't know how to JAR, UNJAR a file?why we are using this technique?I need more information about this.
As the fellow posters mentiioned, a JAR file is an archive holding all your application data.
As a big advantage, dou dont need to cope with several classpaths to set or access problems regarding resources spread in your file systems
You can just call your app with the java -jar option to run it.
Additionally, trust establishment with jars is only possible (and easier) using jar files.
If you are writing applets you can put everything inside the jar file withtout the need for classpath or codebase problem related to it, the applet is loaded as a whole instead of loading lots of scattered class files. Though this does prevent from loading class files on demand only, the overall loading process is much faster.
Summarizing, using jar files makes software deployment much easier.
Oliver -
Framemaker for the Mac. WHY NOT?
I have a Mac and use the Creative Suite software on it. Yet, when I went to go find FrameMaker, I have found it is ONLY available for the PC. Why?
So I go look for a solution and find that FrameMaker 7 is the last version available for the Mac. Ok, I still have my G4 as well. So I figured I will look to get a copy of v7 then. Nope, can't find it on the Adobe site. Not only that, but it's a pain in the "blank" to find a viable copy to puchase other than on amazon for $4K.
If Adobe is going to stop making a version of their software then I can understand the cut. But to stop making it for one system and not the other? At the very least, you could continue to keep support for, and make available (at a reduced price hopefully), your older version for the Mac (or PC if you cancel a PC version of something), so that users can still use the software if they have the system to use it.
A huge amout of Mac people use your software. Apple computers are still looked at to be the BEST graphics hardware around to run. So when someone thinks "graphics" often, the Apple computer is what comes to mind. When they think Games, the PC. One is for work, the other for play, when it comes to Graphics. So, what's with cutting Apple off for FrameMaker.
So I have a suggestion/request. IF your going to keep a software package going for one system, and not the other. Then at the very least, keep the Last Version of the software for the other alive and supported.
You have FrameMaker for the PC. V12.
You stopped for the Mac with V7.
Go back and resupport, and sell V7 to the Mac folks (at a reduced price since it is older). Then, if possible, get V13 or 14, or what ever, updated to work on the Mac and PC. Then, offer the Mac folks the upgrage pricing to go from 7 to 13 (or 14, or what ever).
For those anti-mac people - For the record, I am fully experienced using both the PC and Mac. I own a mac and prefer the Mac for all my Graphics Needs. So please don't suggest I get rid of my Mac and get a PC. Won't happen.> The old Mac code is too old to port to current machines.
It's not just a codebase problem. It's a platform market problem.
Frame's ostensible competitor has a codebase that's some 15 years younger, and it's also Windows-only (and somewhat arrogantly oblivious about it - they don't even tell you what platform you must have to run their stuff).
The question becomes one of: what are the demographics of future content-creator platforms? Some of the platforms that FM used to run on (various Unix RISCs) are now entirely gone. The abortive port to Linux failed to become a product (might have been intended to fail). Desktop Mac may or may not be a key part of future Apple plans.
Windows, alas, is being massively bungled by Microsoft, who arguably accelerated the demise of the desktop PC with Windows 8. A c|net news article today is headlined "New Microsoft VP consigns the PC to irrelevance". Well, you know who to thank for that, Mr. Elop. Sure, content consumer computing is increasingly ISA- and OS-agnostic. Consumer code needs to run on ARM and x86, on at least 3 different OS'es.
Adobe is in the content creator business for revenue products. Creator development/authoring platforms are no longer the same as consumer platforms. Adobe needs to keep an eye on where this is all headed, and needs a Plan B in case MS continues to screw up desktop Windows. If CS and TS were to be ported to a second platform, it's not clear that Mac is the optimal target. It might be to Linux again (whether Android or some other distro is an open question), perhaps on ARM-64. Does Linux have CMYK model yet? or color management? -
Problem: codebase, jar and image reloading problem please help!
Hi Java Gurus,
I have written an applet that extends JApplet for viewing webcam. In order to reduce the download time I put my classes into a doorcam.jar file. The following is my <applet> tag in my html file.
<applet code="CameraApplet.class"
archive="doorcam.jar"
codebase = "webcam/classes"
width="375" height="475">
<param name="imagePath" value="http://judge/webcam/images">
<param name="webCamImage" value="door.jpg">
<param name="COMPort" value="COM2">
<param name="frameRate" value="10"> <!-- could not exceed more than 10-->
<param name="host" value="judge">
</applet>
The fist problem is that my class file does not get loaded from the jar file if i provide the "codebase" attribute as above. Instead the browser load every single class file from the webserver. This has some problem too. Coz the browser sometimes just thorough NullPointerException or ClassNotFoundException. After much of debugging I found out that the problem is the IE browser which seldom fails to load classes or image file from the server. If i referesh the browser the applet and all its classes loaded successfully and runs smoothly. This behaviour never occurs when running with "appletviewer".
I wanted all my classes to be loaded from my jar file. After much of trial and error I found out that if i remove "codebase" attribute the browser loads the classes from my jar file and applet loads very fast. This is where the second problem comes in. The browser does not reload my webcam image file so that the webcam become alive with live images, like before.
If I run on "appletviewer" everything works fine my web cam is displayed properly. But in IE browser the image does not get reloaded when I refresh my image to give live to my webcam display. The refresh method is given below.
private void refresh(final URL url) {
Image webCamImage =getImage(url);
webCamImage.flush(); // flush out the previous image
webCamImage = getImage(url); // get a new image
webCamImageIcon.setImage(webCamImage); webCamImageIcon.paintIcon(webCamLabel, webCamLabel.getGraphics(), 15, 15);
When I add the "codebase" attribute back, the image gets reloaded for every refresh() and everything works fine. But the classes are also loaded from the server. And occasionally also suffers Class loading and image loading problem. As I presented earlier, when I do refreshing in the browser everything gets loaded and the applet function correctly with web cam displaying very well.
The problem is so strange that I could not find any way to solve it.
It would be a great help to me if somebody provide me some work around to the problem.
I tested on Windows 2000, Windows XP, IE 5.5, IE 6 with J2SDK 1.4.0.
Thank you all very much in advance.
best regards,
JudgeThank you so much for the suggestions. I did tried the way u suggested. The problem still the same.
I think its the problem between IE browser and Java Plug-in.
I which SUN would find these incompatibilities and solve these problems.
I even tried using java SDK and plug-in 1.4.1 it even worst. It can't even load an applet. And it does not show any loading messages nor any error messages. It just show a cross sign on the upper left coner.
I would be so glad, if Sun would try to eliminate the inconsistancies such as caching, loading, initializing etc between browser and its Java plug-In. For example, applets behave well in appletviewer and behave unpredictably in browser environment.
I have seen so many people in the forums with all sorts of problems because of this.
Right now I m desperately looking for work around to my problem.
If somebody would provide me with the solution to my problem it would be a great help to me.
thank you all so much.
best regards,
Judge -
Granting different permissions to different codebases : policy file problem
Hi all. I'm having a bit of a problem with policy files and granting different persmissions to different codebases. What I have at the moment is a server app that copies a class file from the client to a specified directory on the server, and then dynamically loads and runs that class. This all works fine, but obviously as user submitted code is going to be run on the server I want to restrict what they are allowed to do. My app is going to be bundled up in a single jar file, and the directory that the client code is being copied to a subdirectory of the app installtion (not that this should make much difference). What i want to do is grant all permissions to my code in the jar file and resrict the permssions granted to code in the strategies directory. I assumed i would just be able to do this using my own policy file, but at the moment i'm not having much luck.
Directory structure:
c:/project/code/
|
|-labyrinth.jar
|-strategies/
Contents of labyrinth.policy:
grant codeBase "file:../code/labyrinth.jar" {
permission java.security.AllPermission;
Command line arguments:
java -Djava.security.manager -Djava.security.policy==./labyrinth.policy -classpath .;./labyrinth.jar;./strategies/;%CLASSPATH%; labyrinth.LabyrinthServer
I've tried specifiying the absolute path to the jar file in the policy file as well as the relative path, i've tried including -Xbootclasspath/a and appending the jar file. All I seem to be able to manage though is either granting all permissions system wide, including the strategies dir, or none and getting security exceptions within my code. Anyone tried doing anything similair or got any idea where I might be going wrong? Any help would be appreciated as its really starting to doing my head in.
TIA. Matt.Did you try putting a slash at the beginning of your "file" specification? e.g., instead of saying
grant codeBase "file:../code/labyrinth.jar" {
permission java.security.AllPermission;
say
grant codeBase "file:/../code/labyrinth.jar" {
permission java.security.AllPermission;
Hope this helps. -
Problems using codeBase in policy file
Hi,
I'm experiencing problems using the codeBase option with the grant option in my .policy file.
I want to start a 'manager' which has limited access to files. This manager starts workers (threads) who need complete access to... everything. I know I need to use the codebase identifier to separate those two groups of rights, but I don't seem to get the codebase right. The worker threads don't get any rights at all. The manager works fine (without any codebase definition).
I've used full and relative pathnames, with and without '/-' or '/*'
The file I use currently is (slightly truncated :), pathnames are package names:
grant codeBase "file:com/response/timber/broker/*" {
permission java.security.AllPermission;
grant {
permission [..].FilePermission "manager.properties","read";
permission [..].SocketPermission "localhost","connect,[..]";
permission [..].FilePermission "com/[..]/jaxb.properties","read";
According to the various examples on the Internet, it should work, but ofcourse it doesn't. Could the use of threat have any influence on the defined security?All I can say is I hope someone gives you
(and indirectly me) the answer. I've got a
serious problem granting special permissions
in Sun ONE to a servlet and it's jars.
One strange thing (to me), is that the format
for the .policy file seems quite different between
say Tomcat and Sun One. Things that work in Tomcat
don't work for Sun ONE. But I thought the underlying
vm et al was all the same! So did I... Why does
this have to be so Opaque? Why different syntax
platform to platform? Its all Java! -
Hello,
i have installed Tomcat in a path with whitespaces. Our Application use RMI (as server componend) to communicate with other Applications.
when I start Tomcat i get an Exception like this:
(by the way: no protocol: Audit -> Audit is a part of the path with whitespaces and it is nessessary that the tool runs with whitespaces in the path e.g. Program Files)
java.rmi.ServerException: RemoteException occurred in server thread; nested exce
ption is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.net.MalformedURLException: no protocol: Audit
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:352
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:207)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
i have write a system parameter with -djava lfor rmi.server.codebase ike this and qoute the whitespaces with %20 but it doesn' t work.
file://d:/test/Tool%20Audit/
Please help me, its urgent.
Best regards
ChrisHi Chris,
the Exception java.net.MalformedURLException: no protocol: Audit means that your path is incorrect, try
<protocol>://<path>/
for Example
http://.../Audit
ftp:/.../Audit
file://../Audit -
Problem converting a (working) Java program into an applet
When I'm trying to access an Image through a call to :
mediaTracker = new MediaTracker(this);
backGroundImage = getImage(getDocumentBase(), "background.gif");
mediaTracker.addImage(backGroundImage, 0);
I'm getting a nullPointerException as a result of the call to getDocumentBase() :
C:\Chantier\Java\BallsApplet
AppletViewer testBallsApplet.htmljava.lang.NullPointerException
at java.applet.Applet.getDocumentBase(Applet.java:125)
at Balls.<init>(Balls.java:84)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:296)
at java.lang.Class.newInstance(Class.java:249)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:548)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:477)
at sun.applet.AppletPanel.run(AppletPanel.java:290)
at java.lang.Thread.run(Thread.java:536)
It seems very weird to me... :-/
(all the .gif files are in the same directory than the .class files)
The problem appears with AppletViewer trying to open an HTML file
containing :
<HTML>
<APPLET CODE="Balls.class" WIDTH=300 HEIGHT=211>
</APPLET>
</HTML>
(I tried unsuccessfully the CODEBASE and ARCHIVE attributes, with and without putting the .gif and .class into a .jar file)
I can't find the solution by myself, so, I'd be very glad if someone could help
me with this... Thank you very much in advance ! :-)
You'll find below the source of a small game that I wrote and debugged (without
problem) and that I'm now (unsuccessfully) trying to convert into an Applet :
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.net.URL;
public class Balls extends java.applet.Applet implements Runnable, KeyListener
private Image offScreenImage;
private Image backGroundImage;
private Image[] gifImages = new Image[6];
private Image PressStart ;
private Sprite pressStartSprite = null ;
private Image YouLose ;
private Sprite YouLoseSprite = null ;
private Image NextStage ;
private Sprite NextStageSprite = null ;
private Image GamePaused ;
private Sprite GamePausedSprite = null ;
//offscreen graphics context
private Graphics offScreenGraphicsCtx;
private Thread animationThread;
private MediaTracker mediaTracker;
private SpriteManager spriteManager;
//Animation display rate, 12fps
private int animationDelay = 83;
private Random rand = new Random(System.currentTimeMillis());
private int message = 0 ; // 0 = no message (normal playing phase)
// 1 = press space to start
// 2 = press space for next level
// 3 = game PAUSED, press space to unpause
// 4 = You LOSE
public static void main(String[] args)
try
new Balls() ;
catch (java.net.MalformedURLException e)
System.out.println(e);
}//end main
public void start()
//Create and start animation thread
animationThread = new Thread(this);
animationThread.start();
public void init()
try
new Balls() ;
catch (java.net.MalformedURLException e)
System.out.println(e);
public Balls() throws java.net.MalformedURLException
{//constructor
// Load and track the images
mediaTracker = new MediaTracker(this);
backGroundImage = getImage(getDocumentBase(), "background.gif");
mediaTracker.addImage(backGroundImage, 0);
PressStart = getImage(getDocumentBase(), "press_start.gif");
mediaTracker.addImage(PressStart, 0);
NextStage = getImage(getDocumentBase(), "stage_complete.gif");
mediaTracker.addImage(NextStage, 0);
GamePaused = getImage(getDocumentBase(), "game_paused.gif");
mediaTracker.addImage(GamePaused, 0);
YouLose = getImage(getDocumentBase(), "you_lose.gif");
mediaTracker.addImage(YouLose, 0);
//Get and track 6 images to use
// for sprites
gifImages[0] = getImage(getDocumentBase(), "blueball.gif");
mediaTracker.addImage(gifImages[0], 0);
gifImages[1] = getImage(getDocumentBase(), "redball.gif");
mediaTracker.addImage(gifImages[1], 0);
gifImages[2] = getImage(getDocumentBase(), "greenball.gif");
mediaTracker.addImage(gifImages[2], 0);
gifImages[3] = getImage(getDocumentBase(), "yellowball.gif");
mediaTracker.addImage(gifImages[3], 0);
gifImages[4] = getImage(getDocumentBase(), "purpleball.gif");
mediaTracker.addImage(gifImages[4], 0);
gifImages[5] = getImage(getDocumentBase(), "orangeball.gif");
mediaTracker.addImage(gifImages[5], 0);
//Block and wait for all images to
// be loaded
try {
mediaTracker.waitForID(0);
}catch (InterruptedException e) {
System.out.println(e);
}//end catch
//Base the Frame size on the size
// of the background image.
//These getter methods return -1 if
// the size is not yet known.
//Insets will be used later to
// limit the graphics area to the
// client area of the Frame.
int width = backGroundImage.getWidth(this);
int height = backGroundImage.getHeight(this);
//While not likely, it may be
// possible that the size isn't
// known yet. Do the following
// just in case.
//Wait until size is known
while(width == -1 || height == -1)
System.out.println("Waiting for image");
width = backGroundImage.getWidth(this);
height = backGroundImage.getHeight(this);
}//end while loop
//Display the frame
setSize(width,height);
setVisible(true);
//setTitle("Balls");
//Anonymous inner class window
// listener to terminate the
// program.
this.addWindowListener
(new WindowAdapter()
{public void windowClosing(WindowEvent e){System.exit(0);}});
// Add a key listener for keyboard management
this.addKeyListener(this);
}//end constructor
public void run()
Point center_place = new Point(
backGroundImage.getWidth(this)/2-PressStart.getWidth(this)/2,
backGroundImage.getHeight(this)/2-PressStart.getHeight(this)/2) ;
pressStartSprite = new Sprite(this, PressStart, center_place, new Point(0, 0),true);
center_place = new Point(
backGroundImage.getWidth(this)/2-NextStage.getWidth(this)/2,
backGroundImage.getHeight(this)/2-NextStage.getHeight(this)/2) ;
NextStageSprite = new Sprite(this, NextStage, center_place, new Point(0, 0),true);
center_place = new Point(
backGroundImage.getWidth(this)/2-GamePaused.getWidth(this)/2,
backGroundImage.getHeight(this)/2-GamePaused.getHeight(this)/2) ;
GamePausedSprite = new Sprite(this, GamePaused, center_place, new Point(0, 0),true);
center_place = new Point(
backGroundImage.getWidth(this)/2-YouLose.getWidth(this)/2,
backGroundImage.getHeight(this)/2-YouLose.getHeight(this)/2) ;
YouLoseSprite = new Sprite(this, YouLose, center_place, new Point(0, 0),true);
BackgroundImage bgimage = new BackgroundImage(this, backGroundImage) ;
for (;;) // infinite loop
long time = System.currentTimeMillis();
message = 1 ; // "press start to begin"
while (message != 0)
repaint() ;
try
time += animationDelay;
Thread.sleep(Math.max(0,time - System.currentTimeMillis()));
catch (InterruptedException e)
System.out.println(e);
}//end catch
boolean you_lose = false ;
for (int max_speed = 7 ; !you_lose && max_speed < 15 ; max_speed++)
for (int difficulty = 2 ; !you_lose && difficulty < 14 ; difficulty++)
boolean unfinished_stage = true ;
spriteManager = new SpriteManager(bgimage);
spriteManager.setParameters(difficulty, max_speed) ;
//Create 15 sprites from 6 gif
// files.
for (int cnt = 0; cnt < 15; cnt++)
if (cnt == 0)
Point position = new Point(
backGroundImage.getWidth(this)/2-gifImages[0].getWidth(this)/2,
backGroundImage.getHeight(this)/2-gifImages[0].getHeight(this)/2) ;
spriteManager.addSprite(makeSprite(position, 0, false));
else
Point position = spriteManager.
getEmptyPosition(new Dimension(gifImages[0].getWidth(this),
gifImages[0].getHeight(this)));
if (cnt < difficulty)
spriteManager.addSprite(makeSprite(position, 1, true));
else
spriteManager.addSprite(makeSprite(position, 2, true));
}//end for loop
time = System.currentTimeMillis();
while (!spriteManager.getFinishedStage() && !spriteManager.getGameOver())
// Loop, sleep, and update sprite
// positions once each 83
// milliseconds
spriteManager.update();
repaint();
try
time += animationDelay;
Thread.sleep(Math.max(0,time - System.currentTimeMillis()));
catch (InterruptedException e)
System.out.println(e);
}//end catch
}//end while loop
if (spriteManager.getGameOver())
message = 4 ;
while (message != 0)
spriteManager.update();
repaint();
try
time += animationDelay;
Thread.sleep(Math.max(0,time - System.currentTimeMillis()));
catch (InterruptedException e)
System.out.println(e);
}//end catch
you_lose = true ;
if (spriteManager.getFinishedStage())
message = 2 ;
while (message != 0)
spriteManager.update();
repaint();
try
time += animationDelay;
Thread.sleep(Math.max(0,time - System.currentTimeMillis()));
catch (InterruptedException e)
System.out.println(e);
}//end catch
} // end for difficulty loop
} // end for max_speed
} // end infinite loop
}//end run method
private Sprite makeSprite(Point position, int imageIndex, boolean wind)
return new Sprite(
this,
gifImages[imageIndex],
position,
new Point(rand.nextInt() % 5,
rand.nextInt() % 5),
wind);
}//end makeSprite()
//Overridden graphics update method
// on the Frame
public void update(Graphics g)
//Create the offscreen graphics
// context
if (offScreenGraphicsCtx == null)
offScreenImage = createImage(getSize().width,
getSize().height);
offScreenGraphicsCtx = offScreenImage.getGraphics();
}//end if
if (message == 0)
// Draw the sprites offscreen
spriteManager.drawScene(offScreenGraphicsCtx);
else if (message == 1)
pressStartSprite.drawSpriteImage(offScreenGraphicsCtx);
else if (message == 2)
NextStageSprite.drawSpriteImage(offScreenGraphicsCtx);
else if (message == 3)
GamePausedSprite.drawSpriteImage(offScreenGraphicsCtx);
else if (message == 4)
YouLoseSprite.drawSpriteImage(offScreenGraphicsCtx);
// Draw the scene onto the screen
if(offScreenImage != null)
g.drawImage(offScreenImage, 0, 0, this);
}//end if
}//end overridden update method
//Overridden paint method on the
// Frame
public void paint(Graphics g)
//Nothing required here. All
// drawing is done in the update
// method above.
}//end overridden paint method
// Methods to handle Keyboard event
public void keyPressed(KeyEvent evt)
int key = evt.getKeyCode(); // Keyboard code for the pressed key.
if (key == KeyEvent.VK_SPACE)
if (message != 0)
message = 0 ;
else
message = 3 ;
if (key == KeyEvent.VK_LEFT)
if (spriteManager != null)
spriteManager.goLeft() ;
else if (key == KeyEvent.VK_RIGHT)
if (spriteManager != null)
spriteManager.goRight() ;
else if (key == KeyEvent.VK_UP)
if (spriteManager != null)
spriteManager.goUp() ;
else if (key == KeyEvent.VK_DOWN)
if (spriteManager != null)
spriteManager.goDown() ;
if (spriteManager != null)
spriteManager.setMessage(message) ;
public void keyReleased(KeyEvent evt)
public void keyTyped(KeyEvent e)
char key = e.getKeyChar() ;
//~ if (key == 's')
//~ stop = true ;
//~ else if (key == 'c')
//~ stop = false ;
//~ spriteManager.setStop(stop) ;
}//end class Balls
//===================================//
class BackgroundImage
private Image image;
private Component component;
private Dimension size;
public BackgroundImage(
Component component,
Image image)
this.component = component;
size = component.getSize();
this.image = image;
}//end construtor
public Dimension getSize(){
return size;
}//end getSize()
public Image getImage(){
return image;
}//end getImage()
public void setImage(Image image){
this.image = image;
}//end setImage()
public void drawBackgroundImage(Graphics g)
g.drawImage(image, 0, 0, component);
}//end drawBackgroundImage()
}//end class BackgroundImage
//===========================
class SpriteManager extends Vector
private BackgroundImage backgroundImage;
private boolean finished_stage = false ;
private boolean game_over = false ;
private int difficulty ;
private int max_speed ;
public boolean getFinishedStage()
finished_stage = true ;
for (int cnt = difficulty ; cnt < size(); cnt++)
Sprite sprite = (Sprite)elementAt(cnt);
if (!sprite.getEaten())
finished_stage = false ;
return finished_stage ;
public boolean getGameOver() {return game_over ;}
public void setParameters(int diff, int speed)
difficulty = diff ;
max_speed = speed ;
finished_stage = false ;
game_over = false ;
Sprite sprite;
for (int cnt = 0;cnt < size(); cnt++)
sprite = (Sprite)elementAt(cnt);
sprite.setSpeed(max_speed) ;
public SpriteManager(BackgroundImage backgroundImage)
this.backgroundImage = backgroundImage ;
}//end constructor
public Point getEmptyPosition(Dimension spriteSize)
Rectangle trialSpaceOccupied = new Rectangle(0, 0,
spriteSize.width,
spriteSize.height);
Random rand = new Random(System.currentTimeMillis());
boolean empty = false;
int numTries = 0;
// Search for an empty position
while (!empty && numTries++ < 100)
// Get a trial position
trialSpaceOccupied.x =
Math.abs(rand.nextInt() %
backgroundImage.
getSize().width);
trialSpaceOccupied.y =
Math.abs(rand.nextInt() %
backgroundImage.
getSize().height);
// Iterate through existing
// sprites, checking if position
// is empty
boolean collision = false;
for(int cnt = 0;cnt < size(); cnt++)
Rectangle testSpaceOccupied = ((Sprite)elementAt(cnt)).getSpaceOccupied();
if (trialSpaceOccupied.intersects(testSpaceOccupied))
collision = true;
}//end if
}//end for loop
empty = !collision;
}//end while loop
return new Point(trialSpaceOccupied.x, trialSpaceOccupied.y);
}//end getEmptyPosition()
public void update()
Sprite sprite;
// treat special case of sprite #0 (the player)
sprite = (Sprite)elementAt(0);
sprite.updatePosition() ;
int hitIndex = testForCollision(sprite);
if (hitIndex != -1)
if (hitIndex < difficulty)
{ // if player collides with an hunter (red ball), he loose
sprite.setEaten() ;
game_over = true ;
else
// if player collides with an hunted (green ball), he eats the green
((Sprite)elementAt(hitIndex)).setEaten() ;
//Iterate through sprite list
for (int cnt = 1;cnt < size(); cnt++)
sprite = (Sprite)elementAt(cnt);
//Update a sprite's position
sprite.updatePosition();
//Test for collision. Positive
// result indicates a collision
hitIndex = testForCollision(sprite);
if (hitIndex >= 0)
//a collision has occurred
bounceOffSprite(cnt,hitIndex);
}//end if
}//end for loop
}//end update
public void setMessage(int message)
Sprite sprite;
//Iterate through sprite list
for (int cnt = 0;cnt < size(); cnt++)
sprite = (Sprite)elementAt(cnt);
//Update a sprite's stop status
sprite.setMessage(message);
}//end for loop
}//end update
public void goLeft()
Sprite sprite = (Sprite)elementAt(0);
sprite.goLeft() ;
public void goRight()
Sprite sprite = (Sprite)elementAt(0);
sprite.goRight() ;
public void goUp()
Sprite sprite = (Sprite)elementAt(0);
sprite.goUp() ;
public void goDown()
Sprite sprite = (Sprite)elementAt(0);
sprite.goDown() ;
private int testForCollision(Sprite testSprite)
//Check for collision with other
// sprites
Sprite sprite;
for (int cnt = 0;cnt < size(); cnt++)
sprite = (Sprite)elementAt(cnt);
if (sprite == testSprite)
//don't check self
continue;
//Invoke testCollision method
// of Sprite class to perform
// the actual test.
if (testSprite.testCollision(sprite))
//Return index of colliding
// sprite
return cnt;
}//end for loop
return -1;//No collision detected
}//end testForCollision()
private void bounceOffSprite(int oneHitIndex, int otherHitIndex)
//Swap motion vectors for
// bounce algorithm
Sprite oneSprite = (Sprite)elementAt(oneHitIndex);
Sprite otherSprite = (Sprite)elementAt(otherHitIndex);
Point swap = oneSprite.getMotionVector();
oneSprite.setMotionVector(otherSprite.getMotionVector());
otherSprite.setMotionVector(swap);
}//end bounceOffSprite()
public void drawScene(Graphics g)
//Draw the background and erase
// sprites from graphics area
//Disable the following statement
// for an interesting effect.
backgroundImage.drawBackgroundImage(g);
//Iterate through sprites, drawing
// each sprite
for (int cnt = 0;cnt < size(); cnt++)
((Sprite)elementAt(cnt)).drawSpriteImage(g);
}//end drawScene()
public void addSprite(Sprite sprite)
addElement(sprite);
}//end addSprite()
}//end class SpriteManager
//===================================//
class Sprite
private Component component;
private Image image;
private Rectangle spaceOccupied;
private Point motionVector;
private Rectangle bounds;
private Random rand;
private int message = 0 ; // number of message currently displayed (0 means "no message" = normal game)
private int max_speed = 7 ;
private boolean eaten = false ; // when a green sprite is eaten, it is no longer displayed on screen
private boolean wind = true ;
private boolean go_left = false ;
private boolean go_right = false ;
private boolean go_up = false ;
private boolean go_down = false ;
public Sprite(Component component,
Image image,
Point position,
Point motionVector,
boolean Wind
//Seed a random number generator
// for this sprite with the sprite
// position.
rand = new Random(position.x);
this.component = component;
this.image = image;
setSpaceOccupied(new Rectangle(
position.x,
position.y,
image.getWidth(component),
image.getHeight(component)));
this.motionVector = motionVector;
this.wind = Wind ;
//Compute edges of usable graphics
// area in the Frame.
int topBanner = ((Container)component).getInsets().top;
int bottomBorder = ((Container)component).getInsets().bottom;
int leftBorder = ((Container)component).getInsets().left;
int rightBorder = ((Container)component).getInsets().right;
bounds = new Rectangle( 0 + leftBorder, 0 + topBanner
, component.getSize().width - (leftBorder + rightBorder)
, component.getSize().height - (topBanner + bottomBorder));
}//end constructor
public void setMessage(int message_number)
message = message_number ;
public void setSpeed(int speed)
max_speed = speed ;
public void goLeft()
go_left = true ;
public void goRight()
go_right = true ;
public void goUp()
go_up = true ;
public void goDown()
go_down = true ;
public void setEaten()
eaten = true ;
setSpaceOccupied(new Rectangle(4000,4000,0,0)) ;
public boolean getEaten()
return eaten ;
public Rectangle getSpaceOccupied()
return spaceOccupied;
}//end getSpaceOccupied()
void setSpaceOccupied(Rectangle spaceOccupied)
this.spaceOccupied = spaceOccupied;
}//setSpaceOccupied()
public void setSpaceOccupied(
Point position){
spaceOccupied.setLocation(
position.x, position.y);
}//setSpaceOccupied()
public Point getMotionVector(){
return motionVector;
}//end getMotionVector()
public void setMotionVector(
Point motionVector){
this.motionVector = motionVector;
}//end setMotionVector()
public void setBounds(Rectangle bounds)
this.bounds = bounds;
}//end setBounds()
public void updatePosition()
Point position = new Point(spaceOccupied.x, spaceOccupied.y);
if (message != 0)
return ;
//Insert random behavior. During
// each update, a sprite has about
// one chance in 10 of making a
// random change to its
// motionVector. When a change
// occurs, the motionVector
// coordinate values are forced to
// fall between -7 and 7. This
// puts a cap on the maximum speed
// for a sprite.
if (!wind)
if (go_left)
motionVector.x -= 2 ;
if (motionVector.x < -15)
motionVector.x = -14 ;
go_left = false ;
if (go_right)
motionVector.x += 2 ;
if (motionVector.x > 15)
motionVector.x = 14 ;
go_right = false ;
if (go_up)
motionVector.y -= 2 ;
if (motionVector.y < -15)
motionVector.y = -14 ;
go_up = false ;
if (go_down)
motionVector.y += 2 ;
if (motionVector.y > 15)
motionVector.y = 14 ;
go_down = false ;
else if(rand.nextInt() % 7 == 0)
Point randomOffset =
new Point(rand.nextInt() % 3,
rand.nextInt() % 3);
motionVector.x += randomOffset.x;
if(motionVector.x >= max_speed)
motionVector.x -= max_speed;
if(motionVector.x <= -max_speed)
motionVector.x += max_speed ;
motionVector.y += randomOffset.y;
if(motionVector.y >= max_speed)
motionVector.y -= max_speed;
if(motionVector.y <= -max_speed)
motionVector.y += max_speed;
}//end if
//Move the sprite on the screen
position.translate(motionVector.x, motionVector.y);
//Bounce off the walls
boolean bounceRequired = false;
Point tempMotionVector = new Point(
motionVector.x,
motionVector.y);
//Handle walls in x-dimension
if (position.x < bounds.x)
bounceRequired = true;
position.x = bounds.x;
//reverse direction in x
tempMotionVector.x = -tempMotionVector.x;
else if ((position.x + spaceOccupied.width) > (bounds.x + bounds.width))
bounceRequired = true;
position.x = bounds.x +
bounds.width -
spaceOccupied.width;
//reverse direction in x
tempMotionVector.x =
-tempMotionVector.x;
}//end else if
//Handle walls in y-dimension
if (position.y < bounds.y)
bounceRequired = true;
position.y = bounds.y;
tempMotionVector.y = -tempMotionVector.y;
else if ((position.y + spaceOccupied.height)
> (bounds.y + bounds.height))
bounceRequired = true;
position.y = bounds.y +
bounds.height -
spaceOccupied.height;
tempMotionVector.y =
-tempMotionVector.y;
}//end else if
if(bounceRequired)
//save new motionVector
setMotionVector(
tempMotionVector);
//update spaceOccupied
setSpaceOccupied(position);
}//end updatePosition()
public void drawSpriteImage(Graphics g)
if (!eaten)
g.drawImage(image,
spaceOccupied.x,
spaceOccupied.y,
component);
}//end drawSpriteImage()
public boolean testCollision(Sprite testSprite)
//Check for collision with
// another sprite
if (testSprite != this)
return spaceOccupied.intersects(
testSprite.getSpaceOccupied());
}//end if
return false;
}//end testCollision
}//end Sprite class
//===================================//
Thanks for your help...Sorry,
Can you tell me how do you solve it because I have got the same problem.
Can you indicate me the topic where did you find solution.
Thank in advance. -
Problem Launching Java Applet with Plug-in: Version 1.4.2_01
Hello out there:
I recently installed j2re-1.4.2_01 on my home computer but have been unable to access Web sites emmploying JAva applets. The following is an email exchange with Jeff Hall of Lowell Observatory, manager of an educational site hosted by Lowell, trying to resolve my problem. The messages are better understood if read in reverse order.
I'm hoping that someone will recognize the source of my problem and can recommmend a solution. I would appreciate any help offered.
Thanks,
Mike Coucke
Hi Jeff:
Well, I guess the problem lies with me somewhere. Here's my answer/status to your questions/suggestions:
1) I'm using MS Windows Me version 4.90.3000
2) I do have the directory C:\Windows\.jpi_cache\jar\, but the only thing in it is an empty folder labeled "1.0". The file LP.jar does not exist anywhere on my hard drive.
3) I tried several game sites that utilized Java applets and got the same results: the Java cup in the upper left corner followed a few seconds later by the red "X". So, evidently the problem is somewhere on my end.
I'm going to post our email exchanges in a Java Users Forum managed by Sun to see if anyone out there can solve my problem. However, if you have any more suggestions, I'll be glad to try them.
Thanks for the help.
Mike Coucke
[email protected]
----- Original Message -----
From: "Jeffrey Hall" <[email protected]>
To: "'Mike Coucke'" <[email protected]>
Sent: Friday, September 05, 2003 1:02 PM
Subject: RE: Registration with Lowell Education Online
Mike,
Rats! What version of Windows are you using? It's a little strange to
see the user directory set to C:\Windows; if you're using XP, I'd expect
it to be something like C:\Documents and Settings\Mike Coucke. In any
event, the output that is of concern is these two lines:
java.lang.ClassNotFoundException: LPRemote.class
Caused by: java.net.UnknownHostException: proxy
It looks like your browser is not finding our server's IP when it comes
time to download the necessary Java code.
LPRemote.class is the fundamental code that runs LOPARC, and your
browser should be downloading it automatically when you click connect.
LPRemote.class is stored along with a bunch of other classes in a file
called "LP.jar" that you download from our server. So, if you go to C:
in Windows Explorer and do a file search for LP.jar, you should find it.
On my machine, it's stored in a directory called ".jpi_cache\jar\" in my
user home directory. Let me know if you have this file, or the
jpi-cache directory.
One other thing you might try is going to a different site that you know
uses Java applets -- I think some of the online game rooms at Yahoo use
Java. See if other sites that use Java load correctly. Then we'll know
if it's our server specifically, or a more general problem on your end.
Jeff Hall
Lowell Observatory
Hello Jeff:
I still have the Java "blues". I followed your instructions, but am still unable to launch a LOPARC session. After an initial failure, I uninstalled all three Java versions I had (1.4.0, 1.4.1, 1.4.2), then reinstalled 1.4.2_01 from the Sun website.
Now, when I try to launch LOPARC, I initially get a blank window with the Java cup in the upper left corner. After about 20 seconds, the cup changes to a red "X". During those 20 seconds, the following appear in the IE message bar at the bottom of the window: "Applet LPRemote notinited" (their spelling) which changes to "Loading Java Applet Failed..." when the red "X" appears.
Following is a copy of the log from my Java Console during all of this:
Java(TM) Plug-in: Version 1.4.2_01
Using JRE version 1.4.2_01 Java HotSpot(TM) Client VM
User home directory = C:\WINDOWS
Proxy Configuration: Manual Configuration
Proxy: http=proxy,https=proxy,ftp=proxy,gopher=proxy
Proxy Overrides:
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
p: reload proxy configuration
q: hide console
r: reload policy configuration
s: dump system properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
load: class LPRemote.class not found.
java.lang.ClassNotFoundException: LPRemote.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.net.UnknownHostException: proxy
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.plugin.net.protocol.http.HttpClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.http.HttpClient.privilegedOpenServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.plugin.net.protocol.http.HttpClient.<init>(Unknown Source)
at sun.plugin.net.protocol.http.HttpClient.New(Unknown Source)
at sun.plugin.net.protocol.http.HttpURLConnection.createConnection(Unknown Source)
at sun.plugin.net.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.plugin.net.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 10 more
I followed this up by executing the following three console commands:
"dump system properties"
"dump classholder list"
"dump thread list"
and obtained the following listings:
Dump system properties ...
acl.read = +
acl.read.default =
acl.write = +
acl.write.default =
application.home = C:\PROGRA~1\JAVA\J2RE14~1.2_0
awt.toolkit = sun.awt.windows.WToolkit
browser = sun.plugin
browser.vendor = Sun Microsystems, Inc.
browser.version = 1.1
deployment.javaws.cache.dir = C:\WINDOWS\.javaws\cache
deployment.javaws.jre.0.enabled = true
deployment.javaws.jre.0.location = http://java.sun.com/products/autodl/j2se
deployment.javaws.jre.0.osarch = x86
deployment.javaws.jre.0.osname = Windows
deployment.javaws.jre.0.path = C:\Program Files\Java\j2re1.4.2_01\bin\javaw.exe
deployment.javaws.jre.0.platform = 1.4
deployment.javaws.jre.0.product = 1.4.2_01
deployment.javaws.jre.0.registered = true
deployment.javaws.version = javaws-1.4.2_01
deployment.system.cacerts = C:\PROGRA~1\JAVA\J2RE14~1.2_0\lib\security\cacerts
deployment.system.home = C:\WINDOWS\Sun\Java\Deployment
deployment.system.jssecacerts = C:\PROGRA~1\JAVA\J2RE14~1.2_0\lib\security\cacerts
deployment.system.profile = C:\WINDOWS
deployment.system.security.policy = file:/C:/WINDOWS/Sun/Java/Deployment/security/java.policy
deployment.user.cachedir = C:\WINDOWS\Application Data\Sun\Java\Deployment\cache
deployment.user.certs = C:\WINDOWS\Application Data\Sun\Java\Deployment\security\deployment.certs
deployment.user.extdir = C:\WINDOWS\Application Data\Sun\Java\Deployment\ext
deployment.user.home = C:\WINDOWS\Application Data\Sun\Java\Deployment
deployment.user.jssecerts = C:\WINDOWS\Application Data\Sun\Java\Deployment\security\deployment.jssecerts
deployment.user.logdir = C:\WINDOWS\Application Data\Sun\Java\Deployment\log
deployment.user.profile = C:\WINDOWS\Application Data
deployment.user.security.policy = file:/C:/WINDOWS/Application%20Data/Sun/Java/Deployment/security/java.policy
deployment.user.tmpdir = C:\WINDOWS\Application Data\Sun\Java\Deployment\cache\tmp
file.encoding = Cp1252
file.encoding.pkg = sun.io
file.separator = \
file.separator.applet = true
http.agent = Mozilla/4.0 (Windows Me 4.90)
http.auth.serializeRequests = true
https.protocols = SSLv3,SSLv2Hello
java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment
java.awt.printerjob = sun.awt.windows.WPrinterJob
java.class.path = C:\PROGRA~1\JAVA\J2RE14~1.2_0\classes
java.class.version = 48.0
java.class.version.applet = true
java.endorsed.dirs = C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\lib\endorsed
java.ext.dirs = C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\lib\ext
java.home = C:\PROGRA~1\JAVA\J2RE14~1.2_0
java.io.tmpdir = C:\WINDOWS\TEMP\
java.library.path = D:\PROGRAM FILES\INTERNET EXPLORER 6;.;C:\WINDOWS\SYSTEM;C:\WINDOWS;D:\PROGRA~1\INTERN~1;;C:\WINDOWS;C:\WINDOWS\COMMAND
java.protocol.handler.pkgs = sun.plugin.net.protocol|sun.plugin.net.protocol
java.runtime.name = Java(TM) 2 Runtime Environment, Standard Edition
java.runtime.version = 1.4.2_01-b06
java.specification.name = Java Platform API Specification
java.specification.vendor = Sun Microsystems Inc.
java.specification.version = 1.4
java.util.prefs.PreferencesFactory = java.util.prefs.WindowsPreferencesFactory
java.vendor = Sun Microsystems Inc.
java.vendor.applet = true
java.vendor.url = http://java.sun.com/
java.vendor.url.applet = true
java.vendor.url.bug = http://java.sun.com/cgi-bin/bugreport.cgi
java.version = 1.4.2_01
java.version.applet = true
java.vm.info = mixed mode
java.vm.name = Java HotSpot(TM) Client VM
java.vm.specification.name = Java Virtual Machine Specification
java.vm.specification.vendor = Sun Microsystems Inc.
java.vm.specification.version = 1.0
java.vm.vendor = Sun Microsystems Inc.
java.vm.version = 1.4.2_01-b06
javaplugin.maxHeapSize = 96m
javaplugin.nodotversion = 142_01
javaplugin.proxy.config.list = http=proxy,https=proxy,ftp=proxy,gopher=proxy
javaplugin.proxy.config.type = manual
javaplugin.version = 1.4.2_01
javaplugin.vm.options = -Djava.class.path=C:\PROGRA~1\JAVA\J2RE14~1.2_0\classes -Xbootclasspath/a:C:\PROGRA~1\JAVA\J2RE14~1.2_0\lib\plugin.jar -Xmx96m -Djavaplugin.maxHeapSize=96m -Xverify:remote -Djavaplugin.version=1.4.2_01 -Djavaplugin.nodotversion=142_01 -Dbrowser=sun.plugin -DtrustProxy=true -Dapplication.home=C:\PROGRA~1\JAVA\J2RE14~1.2_0 -Djava.protocol.handler.pkgs=sun.plugin.net.protocol
line.separator = \r\n
line.separator.applet = true
os.arch = x86
os.arch.applet = true
os.name = Windows Me
os.name.applet = true
os.version = 4.90
os.version.applet = true
package.restrict.access.netscape = false
package.restrict.access.sun = true
package.restrict.definition.java = true
package.restrict.definition.netscape = true
package.restrict.definition.sun = true
path.separator = ;
path.separator.applet = true
sun.arch.data.model = 32
sun.boot.class.path = C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\lib\rt.jar;C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\lib\i18n.jar;C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\lib\sunrsasign.jar;C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\lib\jsse.jar;C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\lib\jce.jar;C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\lib\charsets.jar;C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\classes;C:\PROGRA~1\JAVA\J2RE14~1.2_0\lib\plugin.jar
sun.boot.library.path = C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\bin
sun.cpu.endian = little
sun.cpu.isalist = pentium i486 i386
sun.io.unicode.encoding = UnicodeLittle
sun.java2d.fontpath =
sun.net.client.defaultConnectTimeout = 120000
sun.os.patch.level =
trustProxy = true
user.country = US
user.dir = C:\WINDOWS\Desktop
user.home = C:\WINDOWS
user.language = en
user.name = Michael G. Coucke
user.timezone =
user.variant =
Done.
Dump classloader list ...
codebase=http://kraken.lowell.edu/, key=http://kraken.lowell.edu/,IONJava/classes/ion_16.jar,IONJava/classes/LP.jar, zombie=false, cache=true, refcount=1, info=sun.plugin.ClassLoaderInfo@109de5b
Done.
Dump thread list ...
Group main,ac=11,agc=2,pri=10
main,5,alive
AWT-Windows,6,alive,dameon
AWT-Shutdown,5,alive
Java2D Disposer,10,alive,dameon
AWT-EventQueue-0,6,alive
Group Plugin Thread Group,ac=3,agc=0,pri=10
Main Console Writer,6,alive
AWT-EventQueue-1,6,alive
TimerQueue,5,alive,dameon
Group http://kraken.lowell.edu/-threadGroup,ac=2,agc=0,pri=4
thread applet-LPRemote.class,4,alive
AWT-EventQueue-2,4,alive
Done.
I'm not a Java expert, so this may be more information than you ever wanted to see.
Once again, I hope that you can help. My experience has been that I usually have some obscure option set incorrectly and that causes me great grief.
Thanks fo your help,
Mike Coucke
[email protected]
----- Original Message -----
From: "Jeffrey Hall" <[email protected]>
To: "'Mike Coucke'" <[email protected]>
Sent: Thursday, September 04, 2003 11:48 AM
Subject: RE: Registration with Lowell Education Online
Hi Mike,
Try it now. I think this problem has arisen because Sun just
released a new version of the Plug-in (1.4.2), and when we released the
public beta of LOPARC, only one relevant version (1.4.0) was available
and the LOPARC code was written to look for that by default. I have
just recoded the relevant routines so they should now cause your browser
to simply pick up the latest 1.4 version of the Plug-in you have
installed, whatever it is. I "broke" Java on my machine to replicate
your problem, and the code I inserted today did fix it. Hopefully it
will have the same effect for you. I am running IE 6 and plugin
1.4.2_01 (as accessed via Tools->Sun Java Console).
One broader problem: some (non-LOPARC-specific) users on the Sun
forums have reported the "JRE collision" you are seeing when multiple
versions of the Plug-in are installed on the same machine. So if the
fix I made to our code doesn't work, one option would be to uninstall
all Java components from your computer and do a fresh install of the
latest runtime environment.
Let me know how/if this works. Thanks for the feedback and for your
patience.
Best regards,
Jeff Hall
Lowell Observatory
-----Original Message-----
From: Mike Coucke [mailto:[email protected]]
Sent: Wednesday, September 03, 2003 6:30 PM
To: [email protected]
Subject: Re: Registration with Lowell Education Online
Hello Jeff:
So far, I have been unable to launch a LOPARC session. I repeatedly
get the following error message:
"Exception: java.lang.ClassNotFoundException: LPRemote.class"
My browser is MS Internet Explorer version 6.0.2800.1106 Initially I was
using Java Plug-In version 1.4.1 and received the error message. I went
to the Sun website and downloaded/installed Java Plug-In version 1.4.2
and still get the message.
Before I try to launch LOPARC, I can select Tools->Sun Java Console from
IE's pull down menu to check my Java Plug-In version. When I try to
launch LOPARC, I get the following message:
"Applet(s) in this HTML page requires a version of Java different from
the one the browser is currently using. In order to run the applet(s)
in this HTML page, a new browser session is required, press 'Yes' to
start a new browser session." If I select 'No', I get the following
message: "Java Plug-in detected JRE collission"
If I select 'Yes', a new browser window opens and then I get the first
message above.
Can you help?
Mike Coucke
[email protected]
----- Original Message -----
From: <[email protected]>
To: <[email protected]>
Sent: Monday, September 01, 2003 5:30 PM
Subject: Registration with Lowell Education Online
September 1, 2003
Dear Michael Coucke:
Thank you for registering with Lowell Observatory's online education
site. We hope you enjoy using it and visit regularly as we continue to
expand its features and capabilities. This is a one-time welcoming
email.
For your records, your user ID is xxxxx, and your password is #########.
You'll need to supply these each time you log in.
This site gives you access to research-grade equipment including a 16"
telescope, CCD detector, and image processing software. Our online
archive of data is now available 24/7. The telescope will be opening to
our onsite users in May, and on select nights to the Internet at large
in June.
We have designed this site so you don't need a huge monitor or a
supercomputer to use it. All pages are viewable on screens running at
800x600 resolution or higher. To use LOPARC, you'll need a Java-enabled
browser with the Java 1.4 plug-in installed. If you don't have the
plug-in, you'll be prompted to download it the first time you attempt to
connect. This is an admittedly large (9 MB) but one-time-only download.
This site works correctly under Internet Explorer version 5 or higher.
If you use Netscape, you must be running version 6 or higher, and
display or applet behavior anomalies may occur.
If at any time you can't connect to our server, simply try again later.
We do experience several power outages each year, particularly during
Flagstaff's summer thunderstorm season. Our server is fully protected
and backed up, and can be quickly brought back on line, but any active
user sessions will be lost. Thanks for your patience during these
inevitable downtimes.
Your questions, comments, suggestions, and bug reports about this site
are always welcome. On behalf of the LOPARC development team, thanks
for signing up!
Jeffrey Hall
Assistant Research Scientist
Associate Director, Education and Special Programs
Lowell Observatory
Flagstaff, ArizonaHi Mike,
I see this in your logs:
Java(TM) Plug-in: Version 1.4.2_01
Using JRE version 1.4.2_01 Java HotSpot(TM) Client VM
User home directory = C:\WINDOWS
Proxy Configuration: Manual Configuration
Proxy: http=proxy,https=proxy,ftp=proxy,gopher=proxy
Proxy Overrides:
I just helped my Dad set up his computer with a new
cable modem, and had the situation where we couldn't
access any secure Web sites. The cable folks had us
disable the proxy. It looks like the error message is
saying it can't find your proxy server, and the logs
you posted say that you've decided to configure your
proxy manually, rather than using the settings from
IE (which is how mine is set up in the plugin
control panel.)
Could that be the problem?
--Steve -
Problem opening device from Java on Windows XP
Hi,
I am having trouble opening the TUN device (it is a virtual network device developed by the OpenVPN project - http://openvpn.net) from Java on Windows.
I found from the registry that the key for the device on my machine is
{5998ABF4-70CC-4B8C-9CBF-F2B985BAD4A2}.
From elsewhere on the web, I found that on Windows this device can be
addressed as \\.\{5998ABF4-70CC-4B8C-9CBF-F2B985BAD4A2}.tap
I then wrote up a short C code,
char *tun_dev_name = "\\\\.\\{5998ABF4-70CC-4B8C-9CBF-F2B985BAD4A2}.tap";
FILE *f = fopen(tun_dev_name, "rw");
fclose(f);
HANDLE h = CreateFile(tun_dev_name, GENERIC_WRITE | GENERIC_READ, 0, 0, \
OPEN_EXISTING, FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED, 0);
CloseHandle(h);In the above code, the FILE* returned is non-NULL and the HANDLE returned is positive.
However, when I try to do the same in Java using the code below,
String tun_dev_name =
new String("\\\\.\\{5998ABF4-70CC-4B8C-9CBF-F2B985BAD4A2}.tap");
RandomAccessFile raf = new RandomAccessFile(tun_dev_name, "rw");
[]/code]
a "java.io.IOException: Invalid argument" is thrown. The same exception is thrown when I try to open either FileInputStream or FileOutputStream instead of RandomAccessFile.
In fact, when I invoke the above C code as a native method from within Java,
though a valid HANDLE is still returned, the FILE* returned is now NULL. I
have tried giving all permissions to my codebase using Java's policytool, but that didn't help. BTW, I ran all this code on Windows XP from cygwin.
Clearly this problem isn't with OpenVPN because I'm able to open the device using both fopen and CreateFile from C. Please let me know if one of you knows what the problem could be and what I need to do to fix it. In case, this is not the right forum for this question, kindly let me know which other forum I should pose this question on.
Thanks!
HarshaI am sorry but looks like somehow some text got missed out from my message.
After the C code and before the Java code, I had intended to mention that when that C code is compiled and run independently, both the fopen and CreateFile calls work fine, with a non-NULL FILE* and a valid HANDLE being returned, respectively.
And as I have already mentioned, when I invoke the C code as a native method from within Java, the CreateFile still works but the fopen fails returning NULL.
Sorry for missing that out. Hope somebody will be able to help me out.
Thanks!
Harsha
Maybe you are looking for
-
Problems while creating a Java stored proc with dynamic SQL
Hi, I am trying to write a stored procedure which uses dynamic SQL. The code runs fine outside the database (on DOS PROMPT),but gives me an exception when I try to execute it as a procedure. Could somebody help me out? The exception given is: ERROR a
-
How to find out which materialized views are running on the DB?
So I have a long list of MVs stored on the DB. Is there a script to find out which MVs are being refreshed right now? Help! Thanks
-
Where XI payload gets stored in SAP
Hi, Can any one help me to find out tables used to store XI payload data in backend. I believe message header details can only be visible in ABAP tables.. where as actual message payload gets stored in database system. If my understanding is correct,
-
Keying video that has similar colour background, advice please-image included.
Last-year I visited America, and on the last day managed to secure an interview with a WW2 Ace, which had to be done within a very short time span. Unfortunately this left me with a situation that I couldn't really control, and so I am in a situation
-
Help Please Line IN disappeared
i have recorded a few tracks with my guitar going straight into my computer. Never any midi. About a month ago my line in under preferences-sound-input disappeared and all i get internal microphone, i tried everything i could think of. Today at the l