Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 133092 - NPE from on JDK 1.5
NPE from on JDK 1.5
Product: platform
Classification: Unclassified
Component: Text
PC Windows XP
: P2 (vote)
: 6.x
Assigned To: mslama
jdk_bug_6704417 65fixes2-verified
: 135592 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2008-04-17 11:53 UTC by snelson
Modified: 2009-02-19 22:53 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description snelson 2008-04-17 11:53:57 UTC
SteveNB wrote:
 Hello Folks,
 Well it my first posting and I usually don't post problems unless I've
 reached my wits end. So here's what I am trying to accomplish. Hopefully,
 I can example it properly.
 1. I have a DataNode Object which has the following assignments.
 getCookieSet().assign(PaletteSupportProvider.class, new
 CookieSet cookies = getCookieSet();
 cookies.add((Node.Cookie) DataEditorSupport.create(this,
 getPrimaryEntry(), cookies));
 2. I have an action which the following:
 FileObject fileobject =
 DataObject dob = DataObject.find(fileobject);                       
 EditorCookie ec = (EditorCookie) dob.getCookie(EditorCookie.class);
 if ( ec != null ) {;
 This work great. However, when I try to print the content of the
 EditorCookie Pane (using the native PrintAction instance), I get the
 	at org.openide.text.DefaultPrintable.<init>(
 	at org.openide.text.DefaultPrintable.<init>(
 	at org.openide.text.NbDocument.findPageable(
 	at org.openide.text.CloneableEditorSupport.print(
 	at org.openide.actions.PrintAction.performAction(
 	at org.openide.util.actions.NodeAction.performAction(
 	at org.openide.util.actions.CallableSystemAction$
 	at org.netbeans.modules.openide.util.ActionsBridge$ActionRunnable.actionPerformed(
 	at org.netbeans.core.ModuleActions.invokeAction(
 	at org.netbeans.modules.openide.actions.ActionsBridgeImpl.invokeAction(
 	at org.netbeans.modules.openide.util.ActionsBridge$ActionRunnable.doRun(
 	at org.netbeans.modules.openide.util.ActionsBridge$
 	at org.openide.util.RequestProcessor$
 [catch] at org.openide.util.RequestProcessor$
 I have looked all over creation, but nothing. If anyone has an idea what I
 am doing wrong, I would be most appreciative. Using JDK 1.5.0_12-b02.
 Steve Nelson
 --- Interesting Note --- 
 I am using JDK 1.5.0_14-b03 at home and I get:
 java.lang.NullPointerException: null pData
         at Method)
         at java.awt.Component.dispatchEventImpl(
         at java.awt.Container.dispatchEventImpl(
         at java.awt.Window.dispatchEventImpl(
         at java.awt.Component.dispatchEvent(
         at java.awt.EventQueue.dispatchEvent(
 [catch] at java.awt.EventDispatchThread.pumpOneEventForHierarchy(
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(
         at java.awt.Dialog$
         at java.awt.Dialog$
         at Method)
         at org.openide.text.CloneableEditorSupport.print(
         at com.cca.model204module.PrintFileAction.performAction(
         at org.openide.util.actions.NodeAction.performAction(
         at org.openide.util.actions.CallableSystemAction$
         at org.netbeans.modules.openide.util.ActionsBridge.doPerformAction(
         at org.openide.util.actions.CallableSystemAction.actionPerformed(
         at org.openide.util.actions.NodeAction.actionPerformed(
         at javax.swing.AbstractButton.fireActionPerformed(
         at javax.swing.AbstractButton$Handler.actionPerformed(
         at javax.swing.DefaultButtonModel.fireActionPerformed(
         at javax.swing.DefaultButtonModel.setPressed(
         at javax.swing.AbstractButton.doClick(
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(
         at java.awt.Component.processMouseEvent(
         at javax.swing.JComponent.processMouseEvent(
         at java.awt.Component.processEvent(
         at java.awt.Container.processEvent(
         at java.awt.Component.dispatchEventImpl(
         at java.awt.Container.dispatchEventImpl(
         at java.awt.Component.dispatchEvent(
         at java.awt.LightweightDispatcher.retargetMouseEvent(
         at java.awt.LightweightDispatcher.processMouseEvent(
         at java.awt.LightweightDispatcher.dispatchEvent(
         at java.awt.Container.dispatchEventImpl(
         at java.awt.Window.dispatchEventImpl(
         at java.awt.Component.dispatchEvent(
         at java.awt.EventQueue.dispatchEvent(
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(
         at java.awt.EventDispatchThread.pumpEvents(
         at java.awt.EventDispatchThread.pumpEvents(

-- Interesting Note --

I've install JDK 1.6.0_06-b02 the method works fine!
Comment 1 mslama 2008-04-24 10:40:24 UTC
Please could you attach test module (or send it to me) to reproduce issue?
Comment 2 mslama 2008-05-19 16:10:47 UTC
I filed #6704417 against JDK/AWT for NPE on Windows when opening PageSetup dialog. It happens on JDK 5.0u15 (latest
released update). In any case it is JDK issue both on Linux/Windows. Closing as WONTFIX. I will update status of issue
on Windows.
Comment 3 Lukas Hasik 2008-05-22 12:29:40 UTC
*** Issue 135592 has been marked as a duplicate of this issue. ***
Comment 4 pzajac 2008-12-12 09:47:59 UTC
I found 32 duplicates:

This excetpion is too confusing for our users. We had to patch platform:


static void notify (
        final NbErrorManager.Exc t

     // error in jdk during printing
       if ("java.lang.NullPointerException".equals(t.getClassName())) {
            StringWriter sw = new StringWriter();
            PrintWriter pw = new PrintWriter(sw);
            if (sw.toString().contains("")) {

The patch is safe. Printing works correctly.
Comment 5 mslama 2008-12-12 10:01:20 UTC
Jarda is this patch ok?
Comment 6 mslama 2009-01-06 10:42:10 UTC
As it can happen any time even when there is no our code in call stack there is no better way. I added check for JDK
version and exception dialog is not shown on JDK 5 only. As said above it does not happen on JDK 6.

core-main #bb9e27ad5280

Because of special exception handling in java.awt.EventDispatchThread.pumpOneEventForHierarchy code is not interrupted.
It has no visible effect on functionality. It happens when native printing or page setup dialog is displayed. There is
no progress in JDK to fix this.
Comment 7 mslama 2009-01-06 11:04:36 UTC
There is generated event and NPE is thrown during its processing. Our code is on call stack because modal dialog is
Comment 8 mslama 2009-01-06 11:07:19 UTC
Fix summary
Comment 9 Quality Engineering 2009-01-07 05:35:33 UTC
Integrated into 'main-golden', will be available in build *200901070201* on (upload may still be in progress)
User: Marek Slama <>
Log: #133092: Do not show exception dialog when NPE from WComponentPeer.nativeHandleEvent is thrown on JDK 5.
Comment 10 Lukas Hasik 2009-01-09 15:36:11 UTC
snelson, could verify if the patch (or trunk) works for you?
Comment 11 Lukas Hasik 2009-01-13 09:24:33 UTC
I checked the code - in any way it seems safe -> verified
Comment 12 Lukas Hasik 2009-01-13 11:34:08 UTC
from snelson's email:

Works as advertised..

Thank you,
Comment 13 pgebauer 2009-01-13 16:10:17 UTC
The fix has been ported into the release65_fixes repository.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo