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 53265 - NPE in RelatedCMPWizard
Summary: NPE in RelatedCMPWizard
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 4.x
Hardware: All All
: P2 blocker (vote)
Assignee: Tomas Hurka
URL:
Keywords:
: 51558 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-01-12 00:15 UTC by Rochelle Raccah
Modified: 2007-09-26 09:14 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rochelle Raccah 2005-01-12 00:15:57 UTC
I saw this in last week's build (Wed or Thurs),
but see it again today with slightly different
line numbers.  It happens when choosing 2 tables
out of a bunch in the dbschema to do cmp entity
bean gen:

java.lang.NullPointerException
    at
org.netbeans.modules.j2ee.ejbjarproject.ejb.wizard.cmp.RelatedCMPWizard.propagateCreateMethod(RelatedCMPWizard.java:315)
    at
org.netbeans.modules.j2ee.ejbjarproject.ejb.wizard.cmp.RelatedCMPWizard.createBeans(RelatedCMPWizard.java:391)
    at
org.netbeans.modules.j2ee.ejbjarproject.ejb.wizard.cmp.RelatedCMPWizard.access$000(RelatedCMPWizard.java:68)
    at
org.netbeans.modules.j2ee.ejbjarproject.ejb.wizard.cmp.RelatedCMPWizard$1.run(RelatedCMPWizard.java:169)
    at org.openide.util.Task.run(Task.java:189)
    at
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:330)[catch]
at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:721)
Comment 1 Rochelle Raccah 2005-01-13 18:37:40 UTC
Raising priority - it now seems to happen every time for my dbschema
and I can no longer create CMP beans from the schema.
Comment 2 Petr Blaha 2005-01-14 16:29:48 UTC
I get this exeception every time:
java.lang.NullPointerException
	at
org.netbeans.modules.j2ee.ejbjarproject.ejb.wizard.cmp.RelatedCMPWizard.addFieldsToComponentInterface(RelatedCMPWizard.java:288)
	at
org.netbeans.modules.j2ee.ejbjarproject.ejb.wizard.cmp.RelatedCMPWizard.createBeans(RelatedCMPWizard.java:392)
	at
org.netbeans.modules.j2ee.ejbjarproject.ejb.wizard.cmp.RelatedCMPWizard.access$000(RelatedCMPWizard.java:68)
	at
org.netbeans.modules.j2ee.ejbjarproject.ejb.wizard.cmp.RelatedCMPWizard$1.run(RelatedCMPWizard.java:169)
	at org.openide.util.Task.run(Task.java:189)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:330)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:721)
Comment 3 _ ludo 2005-01-21 18:57:57 UTC
I've see a fix to check for the npe in:
RCS file:
/cvs/j2ee/ejbjarproject/src/org/netbeans/modules/j2ee/ejbjarproject/ejb/wizard/cmp/RelatedCMPWizard.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -r1.17 -r1.18
46a47
> import org.netbeans.modules.db.explorer.infos.ConnectionNodeInfo;
403c404,407
<             e.setDescription(helper.getConnectionNodeInfo().getName());
---
>             ConnectionNodeInfo connectionNodeInfo =
helper.getConnectionNodeInfo();
>             if(connectionNodeInfo != null) {
>                 e.setDescription(connectionNodeInfo.getName());
>             }

This shoudl be in builds after 1/20/2005.
Can QE verify is this is enough?
Chris, can you comment?
Comment 4 Chris Webster 2005-01-21 19:17:44 UTC
The code ludo is referring to was a fix for a change to allow zero
configuration deployment for cmp beans (adding the connection string
if possible). The NPE in this bug is caused by code which basically is
doing the following:

create file
generate code
get java model
do a bit more generation

The NPE is occuring at the third step as the java model cannot be
retrieved. There are several ways to fix this issue:
* change the generation to not rely on the java model 
* rely on the java model resolution

changing the generation is relatively straightforward. 
Comment 5 Martin Adamek 2005-01-24 14:01:20 UTC
Tomas Hurka from java team made some review of this bug and it looks
similar to 51558. After fix for 51558, this one will be evaluated by
java team.
Comment 6 Tomas Hurka 2005-01-26 12:45:15 UTC
*** Issue 51558 has been marked as a duplicate of this issue. ***
Comment 7 Tomas Hurka 2005-01-26 12:56:05 UTC
The source of this (and related) problems is that FileObject.lastModified().getTime() has 
only 1 second granularity. Therefor javacore cannot distinguish two changes, which 
happen in one second timeframe.
Fixed in trunk.
Checking in RepositoryUpdater.java;
/cvs/java/javacore/src/org/netbeans/modules/javacore/RepositoryUpdater.java,v  <--  
RepositoryUpdater.java
new revision: 1.32; previous revision: 1.31
done
Comment 8 Tomas Hurka 2005-01-31 13:17:26 UTC
*** Issue 54060 has been marked as a duplicate of this issue. ***
Comment 9 Max Sauer 2007-02-14 14:22:09 UTC
Marking as verified. Obsolete since retouche intergration.
---
NetBeans IDE Dev (Build 070214)
1.6.0; Java HotSpot(TM) Server VM 1.6.0-b105
Linux version 2.6.12-1.1390_FC4smp running on i386
en_US (nb); UTF-8
Comment 10 Quality Engineering 2007-09-20 12:01:39 UTC
Reorganization of java component