I have problem about applet

  I was create new project and use code form jmetest.awt.applet.AppletTestBoxColor to test running applet . But I have error when I run its



  Java console show  ::

   

  java.lang.ExceptionInInitializerError

at org.lwjgl.util.applet.LWJGLInstaller.<clinit>(LWJGLInstaller.java:75)

at com.jme.system.lwjgl.LWJGLSystemProvider.installLibs(Unknown Source)

at com.jmex.awt.applet.SimpleJMEApplet.init(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission org.lwjgl.util.Debug read)

at java.security.AccessControlContext.checkPermission(Unknown Source)

at java.security.AccessController.checkPermission(Unknown Source)

at java.lang.SecurityManager.checkPermission(Unknown Source)

at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)

at java.lang.System.getProperty(Unknown Source)

at java.lang.Boolean.getBoolean(Unknown Source)

at org.lwjgl.LWJGLUtil$4.run(LWJGLUtil.java:451)

at java.security.AccessController.doPrivileged(Native Method)

at org.lwjgl.LWJGLUtil.getPrivilegedBoolean(LWJGLUtil.java:449)

at org.lwjgl.LWJGLUtil.<clinit>(LWJGLUtil.java:268)

… 5 more





My Applet Code ::

    <applet code="displayModel.class" archive="lwjgl_util_applet.jar,lwjgl.jar,jme.jar,natives.jar,jme-awt.jar,displayModel.jar,jmetest.jar,jmetest-data-images.jar,display.jar" width="800"  height="600"> 

<param name="useAppletCanvasSize" value="true"/>

</applet>





MyCode was ::



import com.jmex.awt.applet.SimpleJMEApplet;

import com.jme.bounding.BoundingBox;

import com.jme.math.FastMath;

import com.jme.math.Vector3f;

import com.jme.math.Quaternion;

import com.jme.scene.TriMesh;

import com.jme.image.Texture;

import com.jme.scene.shape.Box;

import com.jme.scene.state.TextureState;

import com.jme.util.TextureManager;

import jmetest.renderer.TestBoxColor;



public class displayModel extends SimpleJMEApplet {



  private static final long serialVersionUID = 1L;



    private TriMesh t;

    private Quaternion rotQuat;

    private float angle = 0;

    private Vector3f axis;



public void simpleAppletSetup() {

    getLightState().setEnabled(false);

    rotQuat = new Quaternion();

    axis = new Vector3f(1, 1, 0.5f).normalizeLocal();



    Vector3f max = new Vector3f(5, 5, 5);

    Vector3f min = new Vector3f(-5, -5, -5);



    t = new Box("Box", min, max);

    t.setModelBound(new BoundingBox());

    t.updateModelBound();

    t.setLocalTranslation(new Vector3f(0, 0, -15));

    getRootNode().attachChild(t);



    t.setRandomColors();



    TextureState ts = getRenderer().createTextureState();

    ts.setEnabled(true);

    ts.setTexture(TextureManager.loadTexture(

            TestBoxColor.class.getClassLoader().getResource(

                    "jmetest/data/images/Monkey.png"), Texture.MM_LINEAR,

            Texture.FM_LINEAR));



    getRootNode().setRenderState(ts);

}





public void simpleAppletUpdate() {

    float tpf = getTimePerFrame();

    if (tpf < 1) {

        angle = angle + (tpf * 25);

        if (angle > 360) {

            angle -= 360;

        }

    }



    rotQuat.fromAngleNormalAxis(angle * FastMath.DEG_TO_RAD, axis);

    t.setLocalRotation(rotQuat);

}



public void stop() {

    status = STATUS_DESTROYING;

    long time = System.currentTimeMillis();

    while (status != STATUS_DEAD && (System.currentTimeMillis() - time) < 5000) { // only keep waiting for 5 secs

        try {

            Thread.sleep(100);

        } catch (InterruptedException e) {

            e.printStackTrace();

        }

    }

    super.stop();

}

}//========== end class ====================





Ps. I run applet at my local computer. I was read other previous forum but I can't fixed this Error …



  Please … Somebody Help me !!!  :cry:





 

Have you signed your libraries?

Thanks you for your answer … But I don't know How to singed … Because I just beginner for java … ???

http://www.jmonkeyengine.com/wiki/doku.php?id=jme_webstart_step_by_step

look for the step:create a certificate and sign the jars with it



also have a look at the sun tutorials, they helped me to get going:

signing jar files



Additionaly, if you use jme 2, you can use lwjgl’s new AppletLoader as your Applets main class. It will take care of downloading the native libraries.

see this thread for an example.

http://www.jmonkeyengine.com/jmeforum/index.php?topic=9205.0



good luck :slight_smile:


    Thanks you for everyone .. Now I can fix error about applet. But I have another problem.
 
    I run applet using ie 8 and firefox 3.0.3 But the page came up blank white page. It doesn't show anything ( I saw at Java Console . It doesn't show any error. ) and status bar at both browser show " Applet displayModel started ".


    ...  :'( ....

 
    PS. This code can run in eclipse.
 

i had such problems too when i played around with applets, did you try clicking into the applet to activate it ?

Not to hijack this post or anything but im very curious… with Java 6 update 10 applets can have a defined heap size (not being dependant on the 92MB constraint). Does this mean developing applets with JME is now just as good as webstart?



(btw, as far as I know, using Plug-in and launching an applet from jnlp also provided functionality to specify heapsize)

Core-Dump said:

i had such problems too when i played around with applets, did you try clicking into the applet to activate it ?




  Yes , I'm try to click for active but It doesn't show anythings ... May be I should to used jnlp... 

  :'(
Darklord said:

Not to hijack this post or anything but im very curious.. with Java 6 update 10 applets can have a defined heap size (not being dependant on the 92MB constraint). Does this mean developing applets with JME is now just as good as webstart?

Yes, I think that's the idea behind the changes to applet execution conditions in 6u10.

Oh, cool. This means I can use everything in an applet like I wanted. I am going to struggle through getting the applets to work too now.

jojoth said:
Thanks you for everyone .. Now I can fix error about applet. But I have another problem.
How? I signed my JARs, and it still doesn't work. I have the same error.

Oct 11, 2008 9:35:51 PM com.jme.system.lwjgl.LWJGLDisplaySystem <init>
INFO: LWJGL Display System created.
java.lang.ExceptionInInitializerError
   at org.lwjgl.Sys.createImplementation(Sys.java:109)
   at org.lwjgl.Sys.<clinit>(Sys.java:97)
   at org.lwjgl.opengl.AWTGLCanvas.<clinit>(AWTGLCanvas.java:85)
   at com.jmex.awt.lwjgl.LWJGLAWTCanvasConstructor.makeCanvas(LWJGLAWTCanvasConstructor.java:45)
   at com.jmex.awt.lwjgl.LWJGLAWTCanvasConstructor.makeCanvas(LWJGLAWTCanvasConstructor.java:42)
   at com.jme.system.lwjgl.LWJGLDisplaySystem.createCanvas(LWJGLDisplaySystem.java:212)
   at com.jme.system.lwjgl.LWJGLDisplaySystem.createCanvas(LWJGLDisplaySystem.java:189)
   at com.jmex.awt.applet.SimpleJMEApplet.init(SimpleJMEApplet.java:156)
   at sun.applet.AppletPanel.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.security.AccessControlException: access denied (java.util.PropertyPermission org.lwjgl.util.Debug read)
   at java.security.AccessControlContext.checkPermission(Unknown Source)
   at java.security.AccessController.checkPermission(Unknown Source)
   at java.lang.SecurityManager.checkPermission(Unknown Source)
   at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
   at java.lang.System.getProperty(Unknown Source)
   at java.lang.Boolean.getBoolean(Unknown Source)
   at org.lwjgl.LWJGLUtil$4.run(LWJGLUtil.java:451)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.lwjgl.LWJGLUtil.getPrivilegedBoolean(LWJGLUtil.java:449)
   at org.lwjgl.LWJGLUtil.<clinit>(LWJGLUtil.java:268)
   ... 10 more
java.lang.NoClassDefFoundError: Could not initialize class com.jmex.awt.lwjgl.LWJGLCanvas
   at com.jmex.awt.lwjgl.LWJGLAWTCanvasConstructor.makeCanvas(LWJGLAWTCanvasConstructor.java:45)
   at com.jmex.awt.lwjgl.LWJGLAWTCanvasConstructor.makeCanvas(LWJGLAWTCanvasConstructor.java:42)
   at com.jme.system.lwjgl.LWJGLDisplaySystem.createCanvas(LWJGLDisplaySystem.java:212)
   at com.jme.system.lwjgl.LWJGLDisplaySystem.createCanvas(LWJGLDisplaySystem.java:189)
   at com.jmex.awt.applet.SimpleJMEApplet.init(SimpleJMEApplet.java:156)
   at sun.applet.AppletPanel.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

hevee said:

Darklord said:

Not to hijack this post or anything but im very curious.. with Java 6 update 10 applets can have a defined heap size (not being dependant on the 92MB constraint). Does this mean developing applets with JME is now just as good as webstart?

Yes, I think that's the idea behind the changes to applet execution conditions in 6u10.


I thought so too, however reading the 6u10 release notes, they say that specifying applet heapsize is actually more or less a "dirty fix" and you should use the Plug-in platform (reffering to a .jnlp file in your html instead of embedding an applet with <APPLET></APPLET> tags ?).


Note that both the java_arguments and java_version parameters described here are essentially stopgap measures. The recommended way to access this functionality is via the new JNLP support in the new Java Plug-In; see the discussion of command line argument specification in JNLP-launched applets.

source: https://jdk6.dev.java.net/plugin2/#COMMAND_LINE_ARGS




Jedimace1:
http://wiki.plexinfo.net/index.php?title=How_to_sign_JAR_files