File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes Deploy applet in Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Deploy applet in Tomcat" Watch "Deploy applet in Tomcat" New topic
Author

Deploy applet in Tomcat

Swetha Mohan
Greenhorn

Joined: Dec 23, 2005
Posts: 15
Hello

I devoloped an applet which needs to be installed in Tomcat.Can anybody tell me the steps how to deploy an applet in Tomcat.I also want to know how and where to deploy the external jar files(used by the applet)in Tomcat.

Thanks in advance
Swetha
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41186
    
  45
Welcome to JavaRanch.

Unlike web apps, applets do not really have a "deployment" process. You just put them in one of the publicly accessible directories, and they're available right away. Any jar files you have go into the same directory that the HTML file containing the applet is in, not into the WEB-INF/lib directory. To use them, you need to specify them in yout applet tag via " archive="some.jar" ".


Ping & DNS - my free Android networking tools app
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41186
    
  45
I tried it out the way you suggested and I am getting the following exception:

java.lang.NoClassDefFoundError:com/jgoodies/looks/plastic/PlasticXPLookAndFeel
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(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)
I am using a external jar file to load a new look and feel for the applet.I tried to run the applet without the look and feel,then its running.But with the look and feel..its sowhing the above exception.


Then you have not added the jar file containing the LAF correctly. I have no idea if JGoodies comes in one or more jar files; it is possible to add several jar files to an applet. What does your applet tag and your directory structure look like?
Swetha Mohan
Greenhorn

Joined: Dec 23, 2005
Posts: 15
Hello Ulf

I placed the jar file in the same working folder as you suggested.The HTML code is as follows

<HTML>
<HEAD>
<TITLE>EXAMPLE</TITLE>
</HEAD>
</CENTER>
<APPLET CODE="Login.class" ARCHIVE="looks ver 1.3.jar"
width=350
height=150>
</APPLET>
</CENTER>
</BODY>
</HTML>


both the class file and the jar file are specified in the code.When i try to double click and open the html file directly from the working folder,the applet with the LAF is correctly working.The problem with LAF arises only when I try to access the html file using Tomcat.
I have created a working folder iniside the ROOT
Tomcat 5.0\webapps\ROOT\MY FOLDER
Inside the MY FOLDER I have the html file,the class files and the jar file.
Hope I have made things clear to you.

Swetha
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41186
    
  45
I'm assuming that the jar file does not actaully contain spaces - that would be a problem.

Does the jar file have the right permissions to be downloadable over HTTP? Can you do it manually? Looking the web log, does it get accessed when the plugin tries to download it?
Swetha Mohan
Greenhorn

Joined: Dec 23, 2005
Posts: 15
Hello Ulf

sorry for the late reply
Yes the jar had spaces in it...
I removed the spaces and renamed it to looks.jar
now its working perfectly
Thanks a lot

Swetha
graham king
Ranch Hand

Joined: Dec 30, 2004
Posts: 133
Originally posted by Ulf Dittmer:
Welcome to JavaRanch.

Unlike web apps, applets do not really have a "deployment" process. You just put them in one of the publicly accessible directories, and they're available right away. Any jar files you have go into the same directory that the HTML file containing the applet is in, not into the WEB-INF/lib directory. To use them, you need to specify them in yout applet tag via " archive="some.jar" ".



Thanks ULF,
It's been awhile since I've worked with an Applet and you just saved me alot of pain.

This is a gem: http://www.javapowupload.com/


write, revise, re-write, revise, again...<br />write, revise, re-write, revise, again...
 
Consider Paul's rocket mass heater.
 
subject: Deploy applet in Tomcat
 
Similar Threads
to copy a policy file from server machine to client machine in java
Deploying the webservice
Tomcat servlet resource not available
Deploying application that uses client callback in tomcat
How to Deploy a JavaFX Application as an Applet?