Browser Applet trouble, can't run/create even the most simple applet


Sorry for any spelling and grammar mistake, I’m not a native english speaker.

As the title says I can not seem to get the most simple jme3 project to work as a browser applet. Just testing with the default example code when creating a new project I do as follows:

  1. I right-click the project, select properties, check “create applet”.
  2. I right-click the project, click on “Clean and build”. Output: “BUILD SUCCESSFUL”
  3. Navigate to project folder
  4. In dist/Applet i open run-applet.html i browser (tested with firefox, chrome, and safari)

I get an error and console shows as below:

java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at sun.plugin2.applet.Plugin2ClassLoader.defineClassHelper(
at sun.plugin2.applet.Plugin2ClassLoader.access$100(
at sun.plugin2.applet.Plugin2ClassLoader$
at Method)
at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(
at sun.plugin2.applet.Applet2ClassLoader.findClass(
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(
at sun.plugin2.applet.Plugin2Manager.createApplet(
at sun.plugin2.applet.Plugin2Manager$
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at sun.plugin2.applet.Plugin2ClassLoader.defineClassHelper(
… 13 more
Caused by: java.lang.NullPointerException
at sun.plugin2.applet.Plugin2ClassLoader.loadAllowedCodebases(
at sun.plugin2.applet.Plugin2ClassLoader.getPermissions(
at sun.plugin2.applet.Applet2ClassLoader.getPermissions(
… 18 more
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException

I thought this was the right way do to it after reading here (se below),

but I must be missing something. Googeling for some hours has not gotten me anywhere, and official posts like this always is always a dead end since all links to any sort of browser applet instructions seems dead. Tested creating an applet with many different earlier working jme3 projects and tried running the applet on several computers but never succeeded. I have tried running other java browser applets and had no problem.

Can anybody please put me in the right direction? Or is the browser applet considered dead? Any thought or hint is very appreciated!

I can’t help you with how to get it working but there have been many changes in the latest updates to java7/8 from oracle, to the point where applets are almost impossible to get running. They have to be signed, by a trusted certificate, with correct permissions et c.

1 Like

Not really what I wanted to hear. For me it seems really strange for the jme neatbeans IDE to have the option of applet creation if it is regarded as obsolete.

Thanks anyways, I really appreciate you answering!

JME has been around for a while and applets were still usable way back in the day. It’s sad that they are almost unusable now because they can be a great deployment method for games. Maybe a custom browser plugin could solve the issue, but would be a lot of work.