How to create a Processing 2 P3D web Applet?

edited May 2016 in Library Questions

I need to export a web application that uses toxiclibs, hemesh and other libraries.

Is that not possible when using Processing 2, and should I just stick to Processing 1.5.1?

I managed to create an applet when using JAVA2D, but with P3D it stays blank. I export from Eclipse.

If it's not possible, what changed on P3D between 1.5.1 and 2 to make it harder to achieve?

Thanks!

Tagged:

Answers

  • Answer ✓

    The first question you should ask yourself is: do you really want to deploy as an applet? They've basically been killed. Maybe deploying as a packaged jar or executable would be better?

    If you really want to try deploying as an applet, you need to figure out what's going on. You say you have a blank applet, but what errors are printing out to the Java console?

  • edited June 2014
    • In Processing 1.x.x series, only OPENGL renderer used OpenGL.
    • In Processing 2.x.x series, only JAVA2D renderer isn't OpenGL.
    • Also, the OpenGL version in 2.x.x is higher than 1.x.x's. Dunno exactly those version numbers though.
  • @KevinWorkman I don't really want to deploy an applet, but the client wants a version that runs on a web page. Converting everything to JS is too much work, and the performance would probably suffer too much.

    The console was a good point. I was seeing nothing, but only because I was connecting the console to the application afterwards. I found out that in Oracle Java 7 Plugin Control Panel I could enable the console, so it now opens automatically and shows this:

    Exception in thread "Animation Thread" java.lang.ExceptionInInitializerError
        at javax.media.opengl.GLProfile.<clinit>(GLProfile.java:79)
        at processing.opengl.PJOGL.initSurface(PJOGL.java:250)
        at processing.opengl.PGraphicsOpenGL.initPrimary(PGraphicsOpenGL.java:6306)
        at processing.opengl.PGraphicsOpenGL.requestDraw(PGraphicsOpenGL.java:1653)
        at processing.core.PApplet.run(PApplet.java:2254)
        at java.lang.Thread.run(Thread.java:745)
    Caused by: java.security.AccessControlException: access denied ("java.security.AllPermission" "<all permissions>" "<all actions>")
        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:372)
        at java.security.AccessController.checkPermission(AccessController.java:559)
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
        at sun.plugin2.applet.AWTAppletSecurityManager.checkPermission(Unknown Source)
        at com.jogamp.common.util.SecurityUtil.checkPermission(SecurityUtil.java:118)
        at com.jogamp.common.util.SecurityUtil.checkAllPermissions(SecurityUtil.java:109)
        at com.jogamp.common.util.PropertyAccess.addTrustedPrefix(PropertyAccess.java:63)
        at jogamp.opengl.Debug.access$000(Debug.java:50)
        at jogamp.opengl.Debug$1.run(Debug.java:59)
        at java.security.AccessController.doPrivileged(Native Method)
        at jogamp.opengl.Debug.<clinit>(Debug.java:56)
        ... 6 more
    

    I'll investigate the security settings and the signing of the applet.

    Thanks, also @GoToLoop for the details.

  • Converting everything to JS is too much work,...

    If it ever comes to this, I advise you to try out CoffeeScript mode, since it got a class structure close to Java's. *-:)
    Also you'd have access to any other JavaScript libraries. Perhaps similar to Toxic & Hemesh. Who knows? :-?

  • You might want to talk to your client about what an applet actually is. There are going to be warning popup messages with an applet, which really hurts the user experience.

    It looks like you at least have a direction to go in with the security problem. You might have to look into how you're deploying the applet, how you're signing the jar, all that drama.

Sign In or Register to comment.