Although I have read the forum for some time now, it's my first post. So hello everyone!
Ok, I have read several threads in different forums regarding applet deployment under Tomcat, but still can't get it to work.
I have a Turbine project in /webapps/autos, and I need to embed an applet inside a Velocity page (which ultimately translates into a regular HTML page), so I have put my ImageUploader.jar file under /webapps/autos, and I'm embedding it this way:
However, I get a "java.lang.ClassFormatError: Incompatible magic value 1008813135 in class file ImageUploaderApplet", which as far as I know and have read means that, since Tomcat can't find the applet, it's serving an error HTML page, such that the JVM tries to "interpret" it resulting in incompatible magic numbers, obviously because Java files and HTML are different.
Any pointers on how to embed a Java Applet in a Turbine dynamic page?
The thing is, I've read somewhere else that changes should be made inside the Tomcat config files, but the problem is I need to deploy the whole Turbine project as a War file into another server I have no config privileges in.
So the HTML file containing the applet and the ImageUploader.jar file are both located in "/webapps/autos"? The first thing I'd do is remove the "codebase" attribute from the applet tag - it serves no purpose here.
The next thing is to check the Java Console to see whether there are any error messages. If there are, post them here.
Also, try to download the jar file manually through the browser by entering its URL in the browser; it should be something like http://myServer:myPort/auto/ImageUploader.jar (replace "myServer" and "myPort" as appropriate). Does the jar file get downloaded?
Lastly, take a look at the access logs in Tomcat's log directory. In it, you should see which files the browser JVM is actually trying to download. In particular, look for the attempts to download the jar files, and make a note of their HTTP status code - it's generally the last item in the log entry. If that's not 200, then there's a problem.