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 176866 - NullPointerException at org.netbeans.modules.websvc.rest.support.DOMHelper.findElement
Summary: NullPointerException at org.netbeans.modules.websvc.rest.support.DOMHelper.fi...
Status: VERIFIED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: REST (show other bugs)
Version: 6.x
Hardware: All All
: P2 normal (vote)
Assignee: Milan Kuchtiak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-15 16:15 UTC by carljmosca
Modified: 2009-12-04 13:54 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 152510


Attachments
stacktrace (6.41 KB, text/plain)
2009-11-15 16:15 UTC, carljmosca
Details

Note You need to log in before you can comment on or make changes to this bug.
Description carljmosca 2009-11-15 16:15:48 UTC
Build: NetBeans IDE 6.8 Beta (Build 200910212001)
VM: Java HotSpot(TM) 64-Bit Server VM, 14.1-b02-90, Java(TM) SE Runtime Environment, 1.6.0_15-b03-219
OS: Mac OS X, 10.6.2, x86_64

User Comments:
GUEST: try to create new file  with restful webservice 

and 

select tables 

add all

then  occured

carljmosca: RESTful web services from database



Stacktrace: 
java.lang.NullPointerException
        at org.netbeans.modules.websvc.rest.support.DOMHelper.findElement(DOMHelper.java:134)
        at org.netbeans.modules.websvc.rest.support.PersistenceHelper.getPersistenceUnit(PersistenceHelper.java:101)
        at org.netbeans.modules.websvc.rest.wizard.Util.getPersistenceUnit(Util.java:421)
        at org.netbeans.modules.websvc.rest.wizard.fromdb.DatabaseTablesWizardPanel.isValid(DatabaseTablesWizardPanel.java:98)
        at org.openide.WizardDescriptor.updateStateOpen(WizardDescriptor.java:907)
        at org.openide.WizardDescriptor.updateState(WizardDescriptor.java:851)
Comment 1 carljmosca 2009-11-15 16:15:51 UTC
Created attachment 91060 [details]
stacktrace
Comment 2 Milan Kuchtiak 2009-11-16 02:15:00 UTC
The issue seem to be rather serious. I got another exception:

java.lang.NullPointerException
	at org.netbeans.modules.websvc.rest.codegen.model.TypeUtil.getSimpleAnnotationValues(TypeUtil.java:160)
	at org.netbeans.modules.websvc.rest.codegen.model.TypeUtil.getAnnotationValueName(TypeUtil.java:175)
	at org.netbeans.modules.websvc.rest.wizard.fromdb.DatabaseResourceWizardIterator.getEntities(DatabaseResourceWizardIterator.java:422)
	at org.netbeans.modules.websvc.rest.wizard.fromdb.DatabaseResourceWizardIterator.generate(DatabaseResourceWizardIterator.java:268)
	at org.netbeans.modules.websvc.rest.wizard.fromdb.DatabaseResourceWizardIterator.access$000(DatabaseResourceWizardIterator.java:109)
	at org.netbeans.modules.websvc.rest.wizard.fromdb.DatabaseResourceWizardIterator$1.run(DatabaseResourceWizardIterator.java:168)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:602)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1084)
Caused: org.openide.util.RequestProcessor$FastItem: task failed due to
Comment 3 Milan Kuchtiak 2009-11-16 07:04:41 UTC
Fixed.

See:
http://hg.netbeans.org/main/rev/0a8c4d8f917
Comment 4 Quality Engineering 2009-11-17 03:06:08 UTC
Integrated into 'main-golden', will be available in build *200911170201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/0a8c4d8f9170
User: mkuchtiak@netbeans.org
Log: #176866: display warning if persistence unit is broken, resolve annotations from runUserActionTask
Comment 5 Lukas Jungmann 2009-12-02 08:39:06 UTC
v. in 6.8
Comment 6 carljmosca 2009-12-04 07:56:17 UTC
(In reply to comment #5)
> v. in 6.8

Tested...very nice and thanks much for such a fast reply and fix!!
Comment 7 carljmosca 2009-12-04 13:54:05 UTC
I am not sure if this is an NB or the GAE plugin issue but the code which is generated when the "RESTful Web Services from Database" is done for apps which use the Google App Engine, the code which is generated in the PersistenceService.java file uses javax.naming.InitialContext which is not available on the Google App Engine.

I think the required/valid generated code should be something like this:

EntityManagerFactory emf = Persistence.createEntityManagerFactory("PERSISTENCE_UNIT_NAME");
EntityManager em = emf.createEntityManager();