Skip to main content

Java 7u40-b40, 7u25, 6u51 throwing NPE in SwingUtilities.isEventDispatchThread() when launched via Web Start in our app

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
3 replies [Last post]
dfacts
Offline
Joined: 2013-08-22
Points: 0

Everything is fine when running as desktop app. Issue only affects webstart. We are doing RMI login. AppContext.getAppContext() is returning null.

Have tried many of the fixes posted in StackOverflow and on Oracle forums for 7u25. So far none of the workarounds have worked for us.

This is the same bug that Apple patched. Seems like Apple's fix is working for people. The bugs.sun.com site says the issue has been fixed, but 7u40-b40 is still broken, so I'm worried that Oracle isn't using the same fix as Apple.

Stack trace:
javax.security.auth.login.LoginException: java.lang.NullPointerException
at sun.awt.SunToolkit.getSystemEventQueueImplPP(SunToolkit.java:1011)
at sun.awt.SunToolkit.getSystemEventQueueImplPP(SunToolkit.java:1007)
at sun.awt.SunToolkit.getSystemEventQueueImpl(SunToolkit.java:1002)
at java.awt.Toolkit.getEventQueue(Toolkit.java:1730)
at java.awt.EventQueue.isDispatchThread(EventQueue.java:1013)
at javax.swing.SwingUtilities.isEventDispatchThread(SwingUtilities.java:1362)
at com.ourcompany.ourproduct.ui.util.RedSwingUtilities.invokeNowOrWait(RedSwingUtilities.java:55)
at com.ourcompany.ourproduct.ui.console.ConsoleAuthUI.handle(ConsoleAuthUI.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
at sun.rmi.transport.Transport$1.run(Transport.java:177)
at sun.rmi.transport.Transport$1.run(Transport.java:174)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(Unknown Source)
at java.rmi.server.RemoteObjectInvocationHandler.invoke(Unknown Source)
at $Proxy1.handle(Unknown Source)
at com.ourcompany.ms.rmi.MsLogin$1.handle(MsLogin.java:99)
at javax.security.auth.login.LoginContext$SecureCallbackHandler$1.run(Unknown Source)
at javax.security.auth.login.LoginContext$SecureCallbackHandler$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext$SecureCallbackHandler.handle(Unknown Source)
at com.ourcompany.ms.auth.ourproductLoginModule.login(ourproductLoginModule.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at javax.security.auth.login.LoginContext.invoke(Unknown Source)
at javax.security.auth.login.LoginContext.access$000(Unknown Source)
at javax.security.auth.login.LoginContext$4.run(Unknown Source)
at javax.security.auth.login.LoginContext$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokePriv(Unknown Source)
at javax.security.auth.login.LoginContext.login(Unknown Source)
at com.ourcompany.ms.rmi.MsLogin.authenticate(MsLogin.java:110)
at com.ourcompany.ms.rmi.MsLogin.login(MsLogin.java:91)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
anthony_p
Offline
Joined: 2006-07-23
Points: 0
dfacts
Offline
Joined: 2013-08-22
Points: 0

Thanks for that link. It's interesting reading.

As of 8/23, they don't appear to have a resolution for it. I want to emphasize that Apple has successfully patched Java 6u51, which has the same bug. Perhaps they can contact Apple to get their patch.

dfacts
Offline
Joined: 2013-08-22
Points: 0

Thanks for that link. It's interesting reading.

As of 8/23, they don't appear to have a resolution for it. I want to emphasize that Apple has successfully patched Java 6u51, which has the same bug. Perhaps they can contact Apple to get their patch.