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

Hello!

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(Plugin2ClassLoader.java:1097)
at sun.plugin2.applet.Plugin2ClassLoader.access$100(Plugin2ClassLoader.java:64)
at sun.plugin2.applet.Plugin2ClassLoader$2.run(Plugin2ClassLoader.java:1055)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Plugin2ClassLoader.java:1019)
at sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:130)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Plugin2ClassLoader.java:259)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:189)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:170)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Plugin2ClassLoader.java:721)
at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:3148)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1536)
at java.lang.Thread.run(Thread.java:695)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.plugin2.applet.Plugin2ClassLoader.defineClassHelper(Plugin2ClassLoader.java:1078)
… 13 more
Caused by: java.lang.NullPointerException
at sun.plugin2.applet.Plugin2ClassLoader.loadAllowedCodebases(Plugin2ClassLoader.java:462)
at sun.plugin2.applet.Plugin2ClassLoader.getPermissions(Plugin2ClassLoader.java:452)
at sun.plugin2.applet.Applet2ClassLoader.getPermissions(Applet2ClassLoader.java:680)
at java.security.SecureClassLoader.getProtectionDomain(SecureClassLoader.java:235)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:217)
… 18 more
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException


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

https://wiki.jmonkeyengine.org/legacy/doku.php/sdk:application_deployment#browser_applet

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.

https://www.java.com/en/download/faq/release_changes.xml

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.