File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Applets and the fly likes Applets in Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Applets in Tomcat" Watch "Applets in Tomcat" New topic

Applets in Tomcat

Clifton Sothoron

Joined: Jan 09, 2008
Posts: 2
I'm having a terrible time getting an applet to work in Tomcat 5.5. I have an application webapps/rdWeb. I've copied in the JDK TicTacToe.class and example1.html into rdWeb. It works properly under IIS. However I get "applet noinited" when I do the same under Tomcat 5.5. It fails the same under IE, and Firefox. It fails on Windows 2003 server and Suse Linux. I've tried modifying catalina.policyas follows:

grant codeBase "file:${catalina.home}/webapps/rdWeb/-" {

The Java Console is installed (SE 6).It says that it can't find TicTacToe.class even though it's exactly where the classloader is looking. What do I have to do to get Tomcat 5.5 to work with applets?
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Please check your private messages.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

How are you forming the URL for the class file?
Can you post the relevant part of the JSP or HTML page that hosts the applet?

I doubt this has to do with catalina.permissions.
Clifton Sothoron

Joined: Jan 09, 2008
Posts: 2
Here is the Sun example1.html. It runs fine with IIS but generates a Class not found exception in Tomcat 5.5.

<title>TicTacToe v1.1</title>
<h1>TicTacToe v1.1</h1>
<applet code="TicTacToe.class" width=120 height=120>
alt="Your browser understands the <APPLET> tag but isn't running the applet, for some reason."
Your browser is completely ignoring the <APPLET> tag!
<a href="">The source.</a>
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Welcome to JavaRanch.

First off, whatever the problem turns out to be, you do not need to modify the security policy file. That is definitely not part of the issue.

Might it be a file permission problem? Can you use the browser to download the class file manually (by accessing http://localhost:8080/rdWeb/TicTacToe.class)? The file permissions might have been changed during copying, or maybe Tomcat runs under a special account.
I agree. Here's the link:
subject: Applets in Tomcat
It's not a secret anymore!