Friday, December 23, 2011

Java Applet java.lang.InternalError: couldn't create component peer

Sometimes our customers notice the following exception in Java console when they try to open the page with Scanner Applet and load it:

 Exception in thread "AWT-EventQueue-2" java.lang.InternalError: couldn't create component peer
    at sun.awt.windows.WComponentPeer.checkCreation(Unknown Source)
    at sun.awt.windows.WComponentPeer.<init>(Unknown Source)
    at sun.awt.windows.WCanvasPeer.<init>(Unknown Source)
    at sun.awt.windows.WPanelPeer.<init>(Unknown Source)
    at sun.awt.windows.WWindowPeer.<init>(Unknown Source)
    at sun.awt.windows.WFramePeer.<init>(Unknown Source)
    at sun.awt.windows.WEmbeddedFramePeer.<init>(Unknown Source)
    at sun.awt.windows.WToolkit.createEmbeddedFrame(Unknown Source)
    at sun.awt.windows.WEmbeddedFrame.addNotify(Unknown Source)
    at sun.plugin2.main.client.PluginEmbeddedFrame.addNotify(Unknown Source)
    at sun.awt.windows.WEmbeddedFrame.<init>(Unknown Source)
    at sun.plugin2.main.client.PluginEmbeddedFrame.<init>(Unknown Source)
    at sun.plugin2.main.client.PluginMain$StartAppletRunner.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$000(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$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)




Actually, it is a know problem for Oracle. Anyway, exception appears before the applet starts. Sometimes it has not an influence on the applet and it works without problem. Sometimes the applet is not loaded at all. In this case to resolve the issue you need to do the following steps:
  1. Open Java Control Panel
  2. Open Advanced tab
  3. Expand Java Plug-in item
  4. Uncheck Enable the next-generation Java Plug-in
  5. Click Apply
BUT!... Sometimes Enable the next-generation Java Plug-in checkbox is grayed out. In this situation follow the steps below to disable new java plugin via registy and see how it goes.
  1. Go to start, type regedit.exe and press Enter.
  2. Navigate to the location below:
  3. HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Plug-in
  4. Navigate to the subfolder of Java Plug-in. It should be something like:1.6.0_29
  5. Set the dword value of  "UseNewJavaPlugin" to 00000000 to disable new java plugin.
  6. Close the registry editor.
Free Web Directory - Add Your Link

No comments:

Post a Comment