• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

applet giving ClassNotFoundException

 
vysh nars
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I deploy my application only by using war files and not jar files. It is necessary i specify anything in "archive". Because the applet is not loading and giving ClassNotFoundException. What mistake am I doing

test.jsp:portal\src\main\webapp\WEB-INF\jsp\test.jsp


Main.java:portal\src\main\webapp\WEB-INF\jsp\Main.java

 
Paul Clapham
Sheriff
Posts: 21551
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I assume you have a servlet, or something similar, which is forwarding to that JSP? (That must be the case because it's in the WEB-INF directory, which isn't accessible to users via the web.)

So look at the URL which requests that servlet. It should look something like http://host/application/something, right? Your applet Main.class will be loaded via a URL which is relative to that URL. So the URL for the applet would be something like http://host/application/Main.class.

So you should review how you build your war file to make sure your applet is at the right place, and to make sure it can be loaded from a web client. You could put the applet somewhere else, but it must still be accessible by a web client. And its URL should still be relative to the URL of the page which is trying to load it. (Alternatively you could specify an absolute URL in the web page which loads the applet, but that would be a much less good idea. Hard-coded URLs like that are usually ill-advised.)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic