This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Applets and the fly likes Another Applet on Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Applets
Reply Bookmark "Another Applet on Tomcat" Watch "Another Applet on Tomcat" New topic
Author

Another Applet on Tomcat

Max Qua
Greenhorn

Joined: Sep 27, 2008
Posts: 20
Hello,
I have developed a Web application using an eclipse project. It is a servlet working properly. Now I have developed a client code which is an applet. This applet has been developed using another eclipse project, using ant. The jar file created by ant is automatically saved into the Web application directory. After creating the html code to call the applet, I discovered the class I specifyed in the html gets not found. Could someone help me please? I suspect it is a silly issue but I am wasting a lot of time on it.
This is the dir structure:
- WebContent
|
+-dist
| |
| +-lib
| |
| +-ChessGame.jar (this is the applet)
+-lib
| |
| +- (other libraries *.jar used by ChessGame.jar)
+-META-INF
+-WEB-INF
|
+-chess.html

Here below there is the html file chess.html

<!DOCTYPE HTML><HTML>
<HEAD>
</HEAD>
<BODY>
<APPLET CODE="ChessGame.class" CODEBASE="." ARCHIVE= "dist/lib/ChessGame.jar;lib/*.jar" WIDTH=520 HEIGHT=580></APPLET>
</BODY>
</HTML>

When I load the html page with the browser (IE) the result is:

java.lang.ClassNotFoundException: ChessGame.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)

Where I'm wrong?
/Max
Max Qua
Greenhorn

Joined: Sep 27, 2008
Posts: 20
Sorry, it was not clear in the last post but ChessGame.jar is in the following path:

WebContent/dist/lib

/Max
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Another Applet on Tomcat
 
Similar Threads
Help launching an applet created in Netbeans environment
Argh....all I want to do is load this applet..
Problem with an applet
Cannot find applet class
Applet Axis Client Errors