This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 123006

Summary: NPE at JavaDataLoader$JavaFileEntry.modifyMap
Product: java Reporter: Nam Nguyen <nnguyen>
Component: SourceAssignee: Jan Lahoda <jlahoda>
Status: VERIFIED FIXED    
Severity: blocker CC: exceptions_reporter, jbecicka, jpokorsky, mmirilovic, msauer, pgebauer, robertmacgregor
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: patch based on release60 branch

Description Nam Nguyen 2007-11-28 19:30:16 UTC
User reported this exception:

SEVEREjava.lang.NullPointerException
       at org.netbeans.modules.java.JavaDataLoader$JavaFileEntry.modifyMap(JavaDataLoader.java:256)
       at org.netbeans.modules.java.JavaDataLoader$JavaFileEntry.createFormat(JavaDataLoader.java:207)
...
       at org.openide.loaders.DataObject.createFromTemplate(DataObject.java:793) 

Looking at the code and javadoc, since CreateFromTemplateAttributesProvider.attributesFor could return null, we should 
check for null 'attrs' on JavaDataLoader.java:256.
Comment 1 Jan Lahoda 2007-11-28 19:57:54 UTC
Added a check for null. Hard to verify if it helps without steps to reproduce.
Comment 2 Ayub Khan 2007-11-28 22:06:38 UTC
See issue 123017 for details on how to reproduce.
Comment 3 Nam Nguyen 2007-11-28 23:26:39 UTC
User IDE has all JRuby plugins installed.  If this is the reason for the NPE, I think we have a stopper P1 on our 
hands.  I think this a low risk candidate for 6.0 FCS.
Comment 4 Nam Nguyen 2007-11-29 06:03:48 UTC
So the additional plugins theory is confirmed from issue 123017.
In summery, the test case is like this:

- Install RC2 All-Feature binaries for MacOS X.
- Download plugins for RESTful WS, JavaFX and Weather Service JavaFx sample
- Create Web Application
- Do New wizard: Entity Classes from Database
- Do New wizard: RESTful Web Services from Entity Classes
Comment 5 Jan Lahoda 2007-11-29 11:28:57 UTC
I also was not able to reproduce so far (on Linux). I do not think there is enough time to fix this in NB6.0. Maybe we
could make a patch for the AUC? The problem was fixed in trunk in revision 1.9 of
java/source/src/org/netbeans/modules/java/JavaDataLoader.java
Comment 6 Jan Pokorsky 2007-11-29 12:22:52 UTC
I can verify the fix is really simple and safe.
Comment 7 Marian Mirilovic 2007-11-29 12:58:43 UTC
No additional fixes into release60.

pgebauer, 
please let us know what would be the process about ? Thanks in advance.
Comment 8 Petr Blaha 2007-11-30 16:16:39 UTC
Reporter, please verify the fix. Thanks
Comment 9 Nam Nguyen 2007-11-30 16:40:54 UTC
Created attachment 53727 [details]
patch based on release60 branch
Comment 10 Nam Nguyen 2007-11-30 16:56:41 UTC
Hi Rob, 

Since Ayub still could not reproduce the NPE base on you information from issue 123017, could you please verify this 
fix.  The steps is to download the attached:
http://www.netbeans.org/nonav/issues/showattachment.cgi/53727/org-netbeans-modules-java-source.jar
into your <netbeans 6.0 installation directory>/java1/modules directory, restart the IDE and re-install the javaFx and 
weather sample plugins.

Thanks much for helping put closure to this issue.
Comment 11 pgebauer 2007-12-03 14:12:52 UTC
The fix has been ported into the release60_fixes branch.

Checking in JavaDataLoader.java;
/cvs/java/source/src/org/netbeans/modules/java/JavaDataLoader.java,v  <--  JavaDataLoader.java
new revision: 1.8.4.1; previous revision: 1.8
done
Comment 12 Jan Lahoda 2007-12-06 09:03:22 UTC
*** Issue 122662 has been marked as a duplicate of this issue. ***
Comment 13 Max Sauer 2007-12-10 10:04:54 UTC
Verified inside 6.0 with patch1.
---
Product Version: NetBeans IDE 6.0 (Build 200711261600)
Java: 1.6.0_05-ea; Java HotSpot(TM) Client VM 1.6.0_05-ea-b05
System: Linux version 2.6.20-16-generic running on i386; UTF-8; en_US (nb)
Userdir: /home/maxa/.netbeans/6.0
Comment 14 robertmacgregor 2007-12-12 23:56:32 UTC
Fix verified.

I followed these instructions:
-------------Cut 8<---------------------
------- Additional comments from nnguyen@netbeans.org Fri Nov 30 16:56:41 +0000 2007 -------
Hi Rob, 

Since Ayub still could not reproduce the NPE base on you information from issue 123017, could you please verify this 
fix.  The steps is to download the attached:
http://www.netbeans.org/nonav/issues/showattachment.cgi/53727/org-netbeans-modules-java-source.jar
into your <netbeans 6.0 installation directory>/java1/modules directory, restart the IDE and re-install the javaFx and 
weather sample plugins.
----------------------------------------------

I installed the JavaFx weather plugins.
I created a Web App. Added a persistent store and created a RESTful service from the persistent store.
I was able to test my RESTful service using Glassfish.

Comment 15 Nam Nguyen 2008-01-14 22:54:09 UTC
*** Issue 123017 has been marked as a duplicate of this issue. ***
Comment 16 Jan Lahoda 2010-04-09 06:57:07 UTC
*** Bug 183746 has been marked as a duplicate of this bug. ***