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 89576 - Error while creating Entity class from database.
Summary: Error while creating Entity class from database.
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 5.x
Hardware: All Windows XP
: P1 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords:
: 77605 88521 91806 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-11-18 04:53 UTC by nghyslain
Modified: 2007-01-07 13:37 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
My IDE log message file. (184.93 KB, text/plain)
2006-11-18 04:55 UTC, nghyslain
Details
DBSchema file sent by reporter by private e-mail (61.07 KB, application/octet-stream)
2006-11-21 14:36 UTC, Andrei Badea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nghyslain 2006-11-18 04:53:17 UTC
java.lang.NullPointerException
	at 
org.netbeans.modules.j2ee.persistence.entitygenerator.DbSchemaEjbGenerator.addJ
oinTable(DbSchemaEjbGenerator.java:185)
	at 
org.netbeans.modules.j2ee.persistence.entitygenerator.DbSchemaEjbGenerator.addA
llTables(DbSchemaEjbGenerator.java:139)
	at 
org.netbeans.modules.j2ee.persistence.entitygenerator.DbSchemaEjbGenerator.buil
dCMPSet(DbSchemaEjbGenerator.java:398)
	at 
org.netbeans.modules.j2ee.persistence.entitygenerator.DbSchemaEjbGenerator.<ini
t>(DbSchemaEjbGenerator.java:57)
	at 
org.netbeans.modules.j2ee.persistence.wizard.fromdb.RelatedCMPHelper.buildBeans
(RelatedCMPHelper.java:245)
	at 
org.netbeans.modules.j2ee.persistence.wizard.fromdb.RelatedCMPWizard.createBean
s(RelatedCMPWizard.java:308)
	at 
org.netbeans.modules.j2ee.persistence.wizard.fromdb.RelatedCMPWizard.access$000
(RelatedCMPWizard.java:53)
	at 
org.netbeans.modules.j2ee.persistence.wizard.fromdb.RelatedCMPWizard$1.run
(RelatedCMPWizard.java:227)
	at org.openide.util.RequestProcessor$Task.run
(RequestProcessor.java:499)
[catch] at org.openide.util.RequestProcessor$Processor.run
(RequestProcessor.java:932)
Comment 1 nghyslain 2006-11-18 04:55:50 UTC
Created attachment 36121 [details]
My IDE log message file.
Comment 2 Andrei Badea 2006-11-20 11:55:05 UTC
I recall seeing this error reported, but I have never managed to reproduce it.
Is the exception always reproducible? 

Can you please post the schema of your database, or any trimmed-down schema
which triggers the exception?

If not, please try to first generate a database schema file (New File -
Persistence - Database Schema) and then invoke the Entity Classes from DB wizard
and attempt to generate the entity classs from that schema file instead of the
database connection. Do you still get the error?

Thanks.
Comment 3 Andrei Badea 2006-11-21 14:36:07 UTC
Created attachment 36175 [details]
DBSchema file sent by reporter by private e-mail
Comment 4 Andrei Badea 2006-11-21 14:38:50 UTC
The cause of the issue is that the REGION table in the attached dbschema file is
considered a join table, which it is not.
Comment 5 Andrei Badea 2006-11-21 14:46:22 UTC
Fixed.

Checking in DbSchemaEjbGenerator.java;
/cvs/j2ee/persistence/src/org/netbeans/modules/j2ee/persistence/entitygenerator/DbSchemaEjbGenerator.java,v
 <--  DbSchemaEjbGenerator.java
new revision: 1.3; previous revision: 1.2
done
Comment 6 Andrei Badea 2006-11-21 14:47:44 UTC
*** Issue 88521 has been marked as a duplicate of this issue. ***
Comment 7 Andrei Badea 2006-11-21 14:51:18 UTC
*** Issue 77605 has been marked as a duplicate of this issue. ***
Comment 8 Andrei Badea 2007-01-07 13:37:46 UTC
*** Issue 91806 has been marked as a duplicate of this issue. ***