We are supporting one application that uses applet, There is an software updates happened in our company and then the applet in this particular application is not loading properly in most of the machines. I have checked the JRE versions and it is JRE 1.5.0_15 and JRE 1.4.2_13. In half of the machines the applet is loading fine and others are facing this problem.I have checked the script error which showing in the screen and displays "null pointer exception" which is occurs while trying to load the applet tree. This application is running fine when we tried it from our offshore location. Can anybody help me whether this may happen due to any environment problem.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35237
7
posted
0
Welcome to JavaRanch.
What's the applet trying to when the NPE is thrown? Post the full stack trace, and some relevant code excerpt.
The below exception is displaying the Sun jave console, this exception is coming in some machines. Please tell me if any body knows about this exception
java.security.PrivilegedActionException: java.lang.reflect.InvocationTargetException at java.security.AccessController.doPrivileged(Native Method) at sun.plugin.liveconnect.SecureInvocation$2.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.plugin.liveconnect.SecureInvocation.CallMethod(Unknown Source) at sun.plugin.liveconnect.SecureInvocation.access$300(Unknown Source) at sun.plugin.liveconnect.SecureInvocation$CallMethodThread.run(Unknown Source) Caused by: java.lang.reflect.InvocationTargetException 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.plugin.javascript.invoke.JSInvoke.invoke(Unknown Source) at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at sun.plugin.javascript.JSClassLoader.invoke(Unknown Source) at sun.plugin.liveconnect.PrivilegedCallMethodAction.run(Unknown Source) ... 6 more Caused by: java.lang.NullPointerException at sun.font.FontManager.getFont2D(Native Method) at sun.font.FontDesignMetrics.initMatrixAndMetrics(Unknown Source) at sun.font.FontDesignMetrics.<init>(Unknown Source) at sun.java2d.SunGraphics2D.makeFontMetrics(Unknown Source) at sun.java2d.SunGraphics2D.getFontMetrics(Unknown Source) at com.scand.jtree.z.X(Unknown Source) at com.scand.jtree.TreeCtrl.getPreferredSize(Unknown Source) at com.scand.jtree.w.XY(Unknown Source) at com.scand.jtree.TreeApplet.insertNewRoot(Unknown Source) at com.scand.jtree.TreeApplet.insertNewRoot(Unknown Source) ... 16 more Exception in thread "AWT-EventQueue-2" java.lang.NullPointerException at sun.font.FontManager.getFont2D(Native Method) at sun.font.FontDesignMetrics.initMatrixAndMetrics(Unknown Source) at sun.font.FontDesignMetrics.<init>(Unknown Source) at sun.java2d.SunGraphics2D.makeFontMetrics(Unknown Source) at sun.java2d.SunGraphics2D.getFontMetrics(Unknown Source) at com.scand.jtree.z.X(Unknown Source) at com.scand.jtree.TreeCtrl.getPreferredSize(Unknown Source) at com.scand.jtree.w.XY(Unknown Source) at com.scand.jtree.TreeCtrl.wy(Unknown Source) at com.scand.jtree.TreeCtrl.paint(Unknown Source) at sun.awt.RepaintArea.paintComponent(Unknown Source) at sun.awt.RepaintArea.paint(Unknown Source) at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(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) Exception in thread "AWT-EventQueue-2" java.lang.NullPointerException at sun.font.FontManager.getFont2D(Native Method) at sun.font.FontDesignMetrics.initMatrixAndMetrics(Unknown Source) at sun.font.FontDesignMetrics.<init>(Unknown Source) at sun.java2d.SunGraphics2D.makeFontMetrics(Unknown Source) at sun.java2d.SunGraphics2D.getFontMetrics(Unknown Source) at com.scand.jtree.z.Z(Unknown Source) at com.scand.jtree.z.V(Unknown Source) at com.scand.jtree.TreeCtrl.paint(Unknown Source) at sun.awt.RepaintArea.paintComponent(Unknown Source) at sun.awt.RepaintArea.paint(Unknown Source) at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(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) java.security.PrivilegedActionException: java.lang.reflect.InvocationTargetException at java.security.AccessController.doPrivileged(Native Method) at sun.plugin.liveconnect.SecureInvocation$2.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.plugin.liveconnect.SecureInvocation.CallMethod(Unknown Source) at sun.plugin.liveconnect.SecureInvocation.access$300(Unknown Source) at sun.plugin.liveconnect.SecureInvocation$CallMethodThread.run(Unknown Source) Caused by: java.lang.reflect.InvocationTargetException 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.plugin.javascript.invoke.JSInvoke.invoke(Unknown Source) at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at sun.plugin.javascript.JSClassLoader.invoke(Unknown Source) at sun.plugin.liveconnect.PrivilegedCallMethodAction.run(Unknown Source) ... 6 more Caused by: java.lang.NullPointerException at sun.font.FontManager.getFont2D(Native Method) at sun.font.FontDesignMetrics.initMatrixAndMetrics(Unknown Source) at sun.font.FontDesignMetrics.<init>(Unknown Source) at sun.java2d.SunGraphics2D.makeFontMetrics(Unknown Source) at sun.java2d.SunGraphics2D.getFontMetrics(Unknown Source) at com.scand.jtree.z.X(Unknown Source) at com.scand.jtree.TreeCtrl.getPreferredSize(Unknown Source) at com.scand.jtree.w.XY(Unknown Source) at com.scand.jtree.TreeApplet.insertNewRoot(Unknown Source) at com.scand.jtree.TreeApplet.insertNewRoot(Unknown Source) ... 16 more Exception in thread "AWT-EventQueue-3" java.lang.NullPointerException at sun.font.FontManager.getFont2D(Native Method) at sun.font.FontDesignMetrics.initMatrixAndMetrics(Unknown Source) at sun.font.FontDesignMetrics.<init>(Unknown Source) at sun.java2d.SunGraphics2D.makeFontMetrics(Unknown Source) at sun.java2d.SunGraphics2D.getFontMetrics(Unknown Source) at com.scand.jtree.z.X(Unknown Source) at com.scand.jtree.TreeCtrl.getPreferredSize(Unknown Source) at com.scand.jtree.w.XY(Unknown Source) at com.scand.jtree.TreeCtrl.wy(Unknown Source) at com.scand.jtree.TreeCtrl.paint(Unknown Source) at sun.awt.RepaintArea.paintComponent(Unknown Source) at sun.awt.RepaintArea.paint(Unknown Source) at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(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) java.security.PrivilegedActionException: java.lang.reflect.InvocationTargetException at java.security.AccessController.doPrivileged(Native Method) at sun.plugin.liveconnect.SecureInvocation$2.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.plugin.liveconnect.SecureInvocation.CallMethod(Unknown Source) at sun.plugin.liveconnect.SecureInvocation.access$300(Unknown Source) at sun.plugin.liveconnect.SecureInvocation$CallMethodThread.run(Unknown Source) Caused by: java.lang.reflect.InvocationTargetException 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.plugin.javascript.invoke.JSInvoke.invoke(Unknown Source) at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at sun.plugin.javascript.JSClassLoader.invoke(Unknown Source) at sun.plugin.liveconnect.PrivilegedCallMethodAction.run(Unknown Source) ... 6 more Caused by: java.lang.NullPointerException at sun.font.FontManager.getFont2D(Native Method) at sun.font.FontDesignMetrics.initMatrixAndMetrics(Unknown Source) at sun.font.FontDesignMetrics.<init>(Unknown Source) at sun.java2d.SunGraphics2D.makeFontMetrics(Unknown Source) at sun.java2d.SunGraphics2D.getFontMetrics(Unknown Source) at com.scand.jtree.z.X(Unknown Source) at com.scand.jtree.TreeCtrl.getPreferredSize(Unknown Source) at com.scand.jtree.w.XY(Unknown Source) at com.scand.jtree.TreeApplet.insertNewRoot(Unknown Source) at com.scand.jtree.TreeApplet.insertNewRoot(Unknown Source) ... 16 more Exception in thread "AWT-EventQueue-4" java.lang.NullPointerException at sun.font.FontManager.getFont2D(Native Method) at sun.font.FontDesignMetrics.initMatrixAndMetrics(Unknown Source) at sun.font.FontDesignMetrics.<init>(Unknown Source) at sun.java2d.SunGraphics2D.makeFontMetrics(Unknown Source) at sun.java2d.SunGraphics2D.getFontMetrics(Unknown Source) at com.scand.jtree.z.X(Unknown Source) at com.scand.jtree.TreeCtrl.getPreferredSize(Unknown Source) at com.scand.jtree.w.XY(Unknown Source) at com.scand.jtree.TreeCtrl.wy(Unknown Source) at com.scand.jtree.TreeCtrl.paint(Unknown Source) at sun.awt.RepaintArea.paintComponent(Unknown Source) at sun.awt.RepaintArea.paint(Unknown Source) at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(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)
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35237
7
posted
0
The call that's causing trouble is Graphics2D.getFontMetrics. Make sure that whatever is passed in as parameter (a Font object, most likely) describes a font that is available on that system.