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 Applets in Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Applets in Tomcat" Watch "Applets in Tomcat" New topic
Author

Applets in Tomcat

Clifton Sothoron
Greenhorn

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/-" {
permission java.security.AllPermission;
};

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?
Thanks,
Clif...
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

"cbsoth",
Please check your private messages.


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

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
Greenhorn

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.
--Clif

<html>
<head>
<title>TicTacToe v1.1</title>
</head>
<body>
<h1>TicTacToe v1.1</h1>
<hr>
<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!
</applet>
<hr>
<a href="TicTacToe.java">The source.</a>
</body>
</html>
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42946
    
  70
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: http://aspose.com/file-tools
 
subject: Applets in Tomcat