File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem when calling applet

 
Dani Acedos
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am facing problems when I try to execute an applet from a Struts application, I have seen some threads but none posted the last code to resolve it.

I want to call an applet from one of my jsp's under web/jsp

I created the folder applets under web as well and I placed the JavaApplication15.jar which is only a Main.class (no packages, no libs... just a System.out.println to know if it is being called)



it works if I call the applet from a static html file with


I have tried to include this applet into my struts app but I always get "java.lang.ClassNotFoundException: Main.class"

I tried to copy the jar into web/applets and call it with or
I tried to unpack the jar,place the classes under web/applets/JavaApplication15 and call with
unpack the jar,place the classes under web/applets/ and call with

I even tried to copy Main.class to the same folder where I have the JSP /web/jsp/admin and call with without "archive" or "codebase"

Whatever I try, I always get the ClassNotFoundException. What am I doing wrong!

Thank you!

 
Dani Acedos
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is the stack of the javaconsole
 
Tim Moores
Bartender
Posts: 2501
13
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does https://localhost:8443/Stimula/applets/Applet.jar exist? What happens if you paste that URL into a browser - can you download the jar file?

You should not use an applet's constructor, by the way. An applet's lifycycle is handled by the browser - if you need to do something when the applet is created, override its init() method and put your code there.
 
Dani Acedos
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I checked and yes, and I can download the jar if I paste the url.

I add, I try to run the applet in Firefox, If I try in IE I get another error: java.lang.RuntimeException: java.lang.ExceptionInInitializerError.

Probably due to permissions?

Thanks!
 
Andrew Thompson
Ranch Hand
Posts: 77
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Besides all the sage advice offered by Tim, I'll just point out that calling in an applet does not make much sense no matter what the value is.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic