It's not a secret anymore!*
The moose likes Applets and the fly likes ClassNotFoundException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "ClassNotFoundException" Watch "ClassNotFoundException" New topic
Author

ClassNotFoundException

Michael Celaya
Greenhorn

Joined: Dec 21, 2005
Posts: 18
Hi, happy new year for all.

I have been trying to open a word document from an applet I took from this forum. I'm using the oracle jdeveloper10g and if I run it using the appletviewer it works right, but if I use the embedded oc4j server or deploy it to the tomcat server, I get this message in the status bar:"class WriteClientApplet not found" and the message in the server window in the jdeveloper shows the following:

java.lang.ClassNotFoundException: WriteClientApplet
at com/ms/vm/loader/URLClassLoader.loadClass
at com/ms/vm/loader/URLClassLoader.loadClass
at com/ms/applet/AppletPanel.securedClassLoad
at com/ms/applet/AppletPanel.processSentEvent
at com/ms/applet/AppletPanel.processSentEvent
at com/ms/applet/AppletPanel.run
at java/lang/Thread.run

I've tried everything, using the same folder for the class and the html page, using codebase... I don't know what else can I do.

Thanks in advance for any help given.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41106
    
  45
Could you describe in brief how your directory layout looks like, i.e., where is WriteClientApplet.class, where is the HTML file, and what does the applet tag look like?

Also, if you are trying to open a Word file, your applet needs to be signed or the security policy relaxed (more information about this in the Applet FAQ).

Finally, you are using the age-old, buggy, and no longer supported Microsoft JVM. You can probably save yourself a lot of trouble by installing the Sun JVM and its browser plugin.


Ping & DNS - my free Android networking tools app
Michael Celaya
Greenhorn

Joined: Dec 21, 2005
Posts: 18
Thanks for your reply Ulf.

Well, the directory in the tomcat server is quite simple:
http://localhost:8080/slide/users/root/carpeta1/WriteClientApplet.class
http://localhost:8080/slide/users/root/carpeta1/AppletCli.html

the html looks like this:



I will try to install the JVM. Thanks for all.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41106
    
  45
The several subdirectories look weird to me, and potentially troublesome, but if the server serves the HTML at that address, then the JVM should find the class. Can you download the class manually, i.e. by copying the link you provided into the browser? Just to make sure that there isn't a permissions problem on the server.
Michael Celaya
Greenhorn

Joined: Dec 21, 2005
Posts: 18
Hi Ulf.

You were right, it was the microsoft virtual machine. I have installed the JRE 1.4.2_10 and now another simple applets that had the same problem execute properly. Now displays a message (in oc4j) saying "../classes/WriteClientApplet applet notinited" (../classes/ must be the path so the server can find the applet), and in Tomcat the message is "subprogram WriteClientApplet started", nevertheless it doesn't open the word document, so I think that the next step must be signing the applet as you said before, I'll write if I'm in trouble.

Thanks for the replies,
best regards,
Michael.
[ January 04, 2006: Message edited by: Michael Celaya ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41106
    
  45
The applet is not even initializing properly, so there seems to be another problem.

Where does this
../classes/WriteClientApplet
come from? The URLs you posted above do not contain a "classes" directory, nor does the applet tag. You can't keep applet classes in the WEB-INF/classes directory - the JVM will not be able to get at those.
Michael Celaya
Greenhorn

Joined: Dec 21, 2005
Posts: 18
Well, the directory in my oc4j server is different to the one located in Tomcat. The folders in a workspace in jdeveloper has a classes folder at the same level of public_html(where the html page is). But I've also solved this problem: the jar file must be in the public_html folder, and that's it. I've also signed the jar file with my own key par and now it works.

Thanks for all Ulf.
 
Don't get me started about those stupid light bulbs.
 
subject: ClassNotFoundException
 
Similar Threads
Running Applet on Web
jdk 1.1.8 applet gives ClassNotFoundException
Cleared Part I with 93%
Unable to locate jar file
RMI