Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem Deploying Applet

 
Jeff Terry
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone!

I'm developing a Java applet for the web that I am having trouble deploying using Eclipse.

Info:
It uses an external jar (mysql-connector) in the build path.
The entry class is Main.class (no main method in there, it's just called Main) which is in package userInterfaces
I have tried Export -> JAR File to generate the JAR
I have tried using the open source Fat Jar Exporter to generate the JAR

However, when I try to run the applet within a browser (with the following HTML)
<html>
<title>My Applet</title>
<body>
<applet code="userInterface/Main.class"
archive="newProjectForm_fat.jar"
width=320 height=320>
</applet>
</body>
</html>

It always just shows an error saying that Main.class is not found

java.lang.RuntimeException: java.lang.NoClassDefFoundError: Could not initialize class userInterface.Main
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class userInterface.Main
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$12.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Any help would be appreciated!

(hopefully I put this in the right place, I figured it's probably something wrong I am doing in eclipse)
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps the applet isn't in that jar. Or perhaps it is, but not in the right place in the jar's directory structure. Or perhaps you didn't put the jar in the right place in your application server, so the browser can't see it.
 
Jeff Terry
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm actually just running it from my desktop at the moment (the html page and the jar file are in the same spot).

The jars structure looks like

newProjectForm_fat.jar
- userInterface package
-class Main is directly in here
- guts package
- .svn directory
- com package
- META-INF package
- org package
<image files>
 
Maneesh Godbole
Saloon Keeper
Posts: 11027
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its a long time I have worked with applets, but this looks fishy to me

Shouldn't it me userInterface.Main.class ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic