2

I just upgraded my comupters (Windows 8, Windows 7 and OS X Mountain Lion) to Java 7 update 45, and my Java applet doesn't work any more. I get the following exception in the console:

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 org.lwjgl.Sys.createImplementation(Sys.java:124)
at org.lwjgl.Sys.<clinit>(Sys.java:111)
at org.lwjgl.opengl.Display.<clinit>(Display.java:135)
at     com.jme.system.lwjgl.LWJGLDisplaySystem.setVSyncEnabled(LWJGLDisplaySystem.java:109)
at cohort.Utilities.CohortApplet.init(CohortApplet.java:105)
at avc.TackFoot3D.AVC_Applet.init(AVC_Applet.java:167)
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)
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 sun.plugin2.applet.AWTAppletSecurityManager.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:454)
at org.lwjgl.LWJGLUtil$4.run(LWJGLUtil.java:452)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.LWJGLUtil.getPrivilegedBoolean(LWJGLUtil.java:452)
at org.lwjgl.LWJGLUtil.<clinit>(LWJGLUtil.java:265)
... 22 more

I can't figure out why this has stopped working. Obviously there's some security update that's broken it but I can't see what it is. All jars are signed with the same Thawte certificate. The manifest files all contain the "Trusted-Library: true" and "Permissions: all-permissions" attributes. I tried the codebase attribute also, but that did nothing. I've read the update 45 release notes, but can't see anything that would cause this behaviour, but obviously I'm missing something. Can anyone help?

aritchie
  • 601
  • 10
  • 18
  • Which version did you use before? And which way did you use to grant the required privileges to the code? I believe you that the libraries ask for privileges but that does not imply that they will get them. – Holger Oct 16 '13 at 15:55
  • I used update 21 before I installed 45. I'm not sure what you mean about granting privileges to the code - it's signed by a trusted certificate, what else needs to be done? – aritchie Oct 16 '13 at 21:10
  • According to http://www.oracle.com/technetwork/java/javase/tech/java-code-signing-1915323.html#61 “signing no longer automatically equates to privileged execution” since 7u21. So the user agent (i.e. browser) should ask the user whether (s)he trusts the applet, even if it is signed. Maybe the user agent has remembered a wrong decision. But there’s a new feature in 7u45 that you can reset such decisions in the Java Control Panel. I don’t know whether this can interfere but resetting the decisions, reloading the applet and seeing whether it ask for permissions is worth a try imho. – Holger Oct 17 '13 at 07:36
  • Thanks for the suggestion, but that doesn't change anything. – aritchie Oct 17 '13 at 15:39

2 Answers2

1

The reason for this problem is a compatibility issue between Java 7 Update 45 and LWJGL security requirements...even the applet in LWJGL's website (http://lwjgl.org/applet/) and in Nvidia's website stopped working...

The temporary fix for this problem for a user in a hurry is to actually modify the LWJGL library and applet loader to allow running the applet with no regard to the security measures...This is a bothersome task and unreliable from the security point of view

The permanent fix for this is to wait until LWJGL releases an update since the latest update was "LWJGL 2.9.0" Sunday, April 21st, 2013 which was before Update 45, also this problem may reappear even after this fix at the next Java update at February 14st, 2014 because it's a major update and might contain more security measures...

0

You might want to try u25 -- which broke a lot of stuff using invoke and the event queue. In other words, I'm thinking this might be related to this bug and not update 45.

NullPointerException in invokeLater while running through Java Webstart

Community
  • 1
  • 1
blinkered
  • 1
  • 1
  • Yeah, It could be from u25. But I'm not sure that it's the same problem as in your link - the app works ok using WebStart, it's only when used as an applet that there's an issue. We're using a third party library that uses it's own applet loader, so I think that is possibly something to do with it. – aritchie Oct 24 '13 at 09:34