我们最近从 Update 21 更新到 Java 7 Update 25,现在在从 rmi 线程调用 SwingUtilities.isEventDispatchThread() 时遇到空指针异常,因为 AppContext.getAppContext() 返回 null。
java.lang.NullPointerException at sun.awt.SunToolkit.getSystemEventQueueImplPP(Unknown Source) at sun.awt.SunToolkit.getSystemEventQueueImplPP(Unknown Source) at sun.awt.SunToolkit.getSystemEventQueueImpl(Unknown Source) at java.awt.Toolkit.getEventQueue( Unknown Source) at java.awt.EventQueue.isDispatchThread(Unknown Source) at javax.swing.SwingUtilities.isEventDispatchThread(Unknown Source) 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(未知来源)在 sun.rmi.transport.Transport$1。在 sun.rmi.transport.Transport.serviceCall(Unknown Source) at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source) at sun.的 java.security.AccessController.doPrivileged(Native Method) 上运行(Unknown Source)。 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)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(未知来源)在 java.lang.Thread.run(未知来源)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(未知来源)在 java.lang.Thread.run(未知来源)
此错误仅在 web 启动时出现,当我们通过 IDE 运行我们的应用程序时,它很好。
有没有其他人遇到过这个?知道有关 AppContext 的最新更新中发生了什么变化吗?
似乎其他人在更新后与 AppContext 有一些相关的问题: https ://forums.oracle.com/message/11077767#11077767