Initializing real applet error

Guys I have a problem. I try to run my game on a browser embeded as applet. I have signed all jars I have. Lwjgl automatically downloads all jars onto my pc when I go to the webpage. In the meantime I also accept the permissions. However, at some point I get this:
[java]INFO: Extraction Directory: /home/erayt
This occurred while ‘Initializing real applet’
null
java.lang.NullPointerException
at sun.plugin.net.protocol.jar.CachedJarURLConnection.getHeaderField(Unknown Source)
at java.net.URLConnection.getHeaderFieldDate(Unknown Source)
at java.net.URLConnection.getLastModified(Unknown Source)
at com.jme3.system.Natives.extractNativeLib(Natives.java:161)
at com.jme3.system.Natives.extractNativeLib(Natives.java:113)
at com.jme3.system.Natives.extractNativeLibs(Natives.java:294)
at com.jme3.system.JmeDesktopSystem.initialize(JmeDesktopSystem.java:309)
at com.jme3.system.JmeDesktopSystem.newContext(JmeDesktopSystem.java:228)
at com.jme3.system.JmeSystem.newContext(JmeSystem.java:128)
at com.jme3.app.Application.createCanvas(Application.java:418)
at main.GameApplet.init(GameApplet.java:58)
at org.lwjgl.util.applet.AppletLoader.switchApplet(AppletLoader.java:1330)
at org.lwjgl.util.applet.AppletLoader$2.run(AppletLoader.java:909)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$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)[/java]

Use the SDK “lwjgl applet” checkbox in the project settings to make an applet.

I could not find a checkbox named “lwjgl applet”. Are you talking about “ProjectProperties->Application->Applet->Create Applet”?
If so I have already checked it.

I talk about this, yeah http://i.imgur.com/tCmbBO9.png

How do you sign your jar files? You don’t need to with the lwjgl deployment, the lwjgl cert is being used.

I have extract the all classes in the build folder and put them into a jar and named it as code.jar just like in the distro. I moved that jar and the dependencies like ,jME3-core.jar and so on, to a folder. I also downloaded lwjgl and put the dependencies of lwjgl like “lwjgl_util_applet.jar” into that folder. Then I signed all jar files except those I extracted from lwjgl. I have organized the applet tags similar to yours.
[java]
<html>
<body>
<applet code=“org.lwjgl.util.applet.AppletLoader”
archive=“lwjgl_util_applet.jar”
codebase="."
width=“800” height=“600”>

       &lt;param name="al_title" value="Game"&gt;
       &lt;param name="al_main" value="main.GameApplet"&gt;
       &lt;param name="al_jars" value="code.jar,
                                    jinput.jar,
                                    lwjgl.jar,
                                    jME3-core.jar,
                                    jME3-desktop.jar,
                                    jME3-lwjgl.jar,
                                    jME3-lwjgl-natives.jar"&gt;

       &lt;param name="al_windows" value="windows_natives.jar"&gt;
       &lt;param name="al_linux" value="linux_natives.jar"&gt;
       &lt;param name="al_mac" value="macosx_natives.jar"&gt;
    &lt;/applet&gt;
&lt;/body&gt;

</html>[/java]

and yeah that is what I have done so far. However, marking the applet option on the SDK is like a blackbox and it does not work. Because it is a blackbox I cannot debug :S

You only need to check the checkbox, in a clean BasicGame project it works, check whats different in your setup. And its not a “black box”, the build file is in the nbproject folder.

Now I get these:
[java]This occurred while ‘Initializing real applet’
null
java.lang.reflect.InvocationTargetException
at java.awt.EventQueue.invokeAndWait(Unknown Source)
at java.awt.EventQueue.invokeAndWait(Unknown Source)
at org.lwjgl.util.applet.AppletLoader.run(AppletLoader.java:906)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.jme3.app.AppletHarness.createCanvas(AppletHarness.java:107)
at com.jme3.app.AppletHarness.init(AppletHarness.java:154)
at org.lwjgl.util.applet.AppletLoader.switchApplet(AppletLoader.java:1326)
at org.lwjgl.util.applet.AppletLoader$2.run(AppletLoader.java:909)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$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)
Caused by: java.security.AccessControlException: access denied (“java.util.PropertyPermission” “user.home” “read”)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at sun.plugin2.applet.AWTAppletSecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
at java.lang.System.getProperty(Unknown Source)
at game.GameController.<clinit>(GameController.java:31)
… 20 more[/java]

Also I get this warning at the beginning:

[java]
CacheEntry[http://.com/lwjgl_util_applet.jar]: updateAvailable=true,lastModified=Mon Sep 02 16:56:29 EEST 2013,length=40191
Missing Permissions manifest attribute for: http://
.com/lwjgl_util_applet.jar
Missing Codebase manifest attribute forchessgame.comxa: http://.com/lwjgl_util_applet.jar
Missing Permissions manifest attribute for: http://
.com/lwjgl_util_applet.jar
Missing Codebase manifest attribute for: http://.com/lwjgl_util_applet.jar
Missing Permissions manifest attribute for: http://
.com/lwjgl_util_applet.jar
Missing Codebase manifest attribute for: http://.com/lwjgl_util_applet.jar
CacheEntry[http://
.com/lzma.jar]: updateAvailable=true,lastModified=Mon Sep 02 16:56:29 EEST 2013,length=9296
Missing Permissions manifest attribute for: http://.com/lzma.jar
Missing Codebase manifest attribute for: http://
.com/lzma.jar
Missing Permissions manifest attribute for: http://.com/lzma.jar
Missing Codebase manifest attribute for: http://
.com/lzma.jar
[/java]

I dont have to sign anything right?

<cite>@normen said:</cite> You only need to check the checkbox, in a clean BasicGame project it works, check whats different in your setup. And its not a "black box", the build file is in the nbproject folder.

I say blackbox because for example I dont know if I should have the method “public static void main(String args)” in the class extending simpleapplication?

@ErayT said: I say blackbox because for example I dont know if I should have the method "public static void main(String[] args)" in the class extending simpleapplication?

Your main and jME SimpleApplication class should be the same, yes. The main won’t be called for applets though. As said, just make a new BasicGame project and check whats different in your setup.

<cite>@normen said:</cite> Your main and jME SimpleApplication class should be the same, yes. The main won't be called for applets though. As said, just make a new BasicGame project and check whats different in your setup.

Ok I have just created a basic game and changed nothing. I created its distro as applet and uploaded to my webpage. And this is what I get :

[java]Exception in thread “LWJGL Renderer Thread” java.lang.IllegalStateException: No loader registered for type “fnt”
at com.jme3.asset.ImplHandler.aquireLoader(ImplHandler.java:199)
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:266)
at com.jme3.asset.DesktopAssetManager.loadFont(DesktopAssetManager.java:365)
at com.jme3.app.SimpleApplication.loadGuiFont(SimpleApplication.java:178)
at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:186)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:130)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:207)
at java.lang.Thread.run(Unknown Source)[/java]

Then you have a more basic problem like filesystem rights or a borked JDK.

Because I do not know what the problem is, I cannot do anything :confused: Which mechanism does not work, what is lack…