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 77605 - failed to generate the entity class from database
Summary: failed to generate the entity class from database
Status: RESOLVED DUPLICATE of bug 89576
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-09 05:44 UTC by climberus
Modified: 2006-11-21 14:51 UTC (History)
1 user (show)

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 climberus 2006-06-09 05:44:02 UTC
When I use the entity class from database wizard, all steps works right. 
However  when the IDE try to generate the class, it got the 'nullPointerException'

I am using the Oracle XE

Here is the log:

[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:926)
*********** Exception occurred ************ at 9:25 PM on Jun 8, 2006
java.lang.NullPointerException
	at
org.netbeans.modules.j2ee.persistence.entitygenerator.DbSchemaEjbGenerator.addJoinTable(DbSchemaEjbGenerator.java:170)
	at
org.netbeans.modules.j2ee.persistence.entitygenerator.DbSchemaEjbGenerator.addAllTables(DbSchemaEjbGenerator.java:133)
	at
org.netbeans.modules.j2ee.persistence.entitygenerator.DbSchemaEjbGenerator.buildCMPSet(DbSchemaEjbGenerator.java:415)
	at
org.netbeans.modules.j2ee.persistence.entitygenerator.DbSchemaEjbGenerator.<init>(DbSchemaEjbGenerator.java:51)
	at
org.netbeans.modules.j2ee.persistence.wizard.fromdb.RelatedCMPHelper.buildBeans(RelatedCMPHelper.java:183)
	at
org.netbeans.modules.j2ee.persistence.wizard.fromdb.RelatedCMPWizard.createBeans(RelatedCMPWizard.java:238)
	at
org.netbeans.modules.j2ee.persistence.wizard.fromdb.RelatedCMPWizard.access$100(RelatedCMPWizard.java:42)
	at
org.netbeans.modules.j2ee.persistence.wizard.fromdb.RelatedCMPWizard$2.run(RelatedCMPWizard.java:191)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:493)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:926)
Comment 1 climberus 2006-06-09 07:23:40 UTC
Found out that there is one table failed to generate the class.

The table is a join table of USER_LAB_SITE and ROLES, which USER_LAB_SITE is the
join table.

Columns:
user_id PK  FK---- of USER_LAB_SITE
Business_id PK FK--- of USER_LAB_SITE
Role_id PK FK --ROLES

The join table (USER_LAB_SITE) is not generated, when it try to generate the
USER_LAB_SITE_ROLE, it bombs whole process.  Solution suggested, catch this
nullPointerException, give a warning in the wizard instead of bomb whole process.

Temp Workout, I modified the table.  However it takes me 2 hours to find out
that table causes the problem.

Thanks. 
Comment 2 Rochelle Raccah 2006-06-13 00:04:16 UTC
I just tried to create these tables on derby given your textual description and
was able to generate entity from db without a problem.

So, please post more info:
- what build of NB 5.5 are you using
- sql script or dbschema file from which you are generating
Comment 3 Andrei Badea 2006-06-15 16:57:08 UTC
Sorry, but I can't reproduce it either. (Rochelle, thanks for looking at this!)
It would help if you could post a short SQL script creating a schema for which
you always get the NPE. Thanks!
Comment 4 Andrei Badea 2006-07-19 19:00:54 UTC
No further information from the reporter for a long time. Closing, please reopen
with the required information. Thanks!
Comment 5 jcampuzano 2006-08-17 15:24:04 UTC
it´s impossible to know wich is the table or the relation that is wrong
Comment 6 Andrei Badea 2006-09-06 15:44:31 UTC
Sorry, but I can't fix this issue if I can't reproduce it. Would it be possible
to get an SQL script creating the schema with which you get the exception? Is
the exception random or always reproducible? Thanks.
Comment 7 Andrei Badea 2006-09-06 15:45:09 UTC
Also adding jcampuzano to CC. jcampuzano, please see my last comment.
Comment 8 Andrei Badea 2006-09-20 09:35:55 UTC
Guys, any progress on this?
Comment 9 Andrei Badea 2006-09-20 10:25:31 UTC
From jcampuzano by private e-mail:

I have the same problem all the times i try, i don´t have a sql script its a
very big DB and may be a little bit confidential.
I´m using Informix 7.2
i´m sure that the hole schema is not fine, but i can´t find the error, i solved
one to one relations but the problem is not solved
actually i only need that netbeans gives me more information about the error.
Comment 10 Andrei Badea 2006-09-20 10:37:09 UTC
I could try to add some logging statements, but they won't make it into 5.5.
Informix is not a supported database, so I am downgrading to P3.
Comment 11 Andrei Badea 2006-11-21 14:51:19 UTC
Based on the exception stack trace in desc1 this could be a duplicate of issue
89576. Please verify (the Entity Class from DB is currently disabled because of
the changes in the Java infrastructure, but should be back in NB 6.0 M6).

jcampuzano: if you still feel NetBeans should give you more information during
the entity class bean generation process please file a new issue with some
details. Thanks.


*** This issue has been marked as a duplicate of 89576 ***