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 80862 - Can't generate entities using MySQL: NPE writeDBSchema
Summary: Can't generate entities using MySQL: NPE writeDBSchema
Status: RESOLVED INVALID
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 5.x
Hardware: Other Linux
: P3 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2006-07-21 23:16 UTC by sitongia
Modified: 2006-08-09 19:34 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 sitongia 2006-07-21 23:16:29 UTC
Installed Beta 2, installed Profiler (which works now).
Add MySQL driver (3.1.11)
Configure Servers for JBoss 4.0.4.GA and Glassfish
Configure database connection using Runtime tab:
        Connect Using MySQL to my database
New Web Application: 
        Source Structure: Jakarta
        Sun app server
        Java EE 5
        Frameworks: JSF
New Persistence Unit:
        TopLink
        New Data Source
                JNDI Name: VAVOOM (my project)
                Database Connection: the one I configured in Runtime tab
        Data Source: VAVOOM
        Strategy: Drop and Create
                (note that when the Design view of persistence.xml displays, 
it has the
                Create Strategy selected, not Drop and Create
New Entity Classes from Database:
        Data Source: VAVOOM (it retrieves all the Tables, numbering 16)
        Add All
        Next
        Package: edu.ucar.entity
        Finish

Unexpected Exception alert comes up: NPE.  Show Details:
java.lang.NullPointerException
        at 
org.netbeans.modules.j2ee.persistence.wizard.fromdb.DBSchemaManager.writeDBSchema(DBSchemaManager.java:233)
        at 
org.netbeans.modules.j2ee.persistence.wizard.fromdb.RelatedCMPWizard.createBeans(RelatedCMPWizard.java:266)
        at 
org.netbeans.modules.j2ee.persistence.wizard.fromdb.RelatedCMPWizard.access$000
(RelatedCMPWizard.java:49)
        at 
org.netbeans.modules.j2ee.persistence.wizard.fromdb.RelatedCMPWizard$1.run(RelatedCMPWizard.java:194)
        at 
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:499)
[catch] at 
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:932)

I changed the PU Provider to Hibernate, and I get the same exception.

Then I tried New Entity Classes from Database with one table, and it worked!
Then I went back to New Entity Classes from Database will Add All, and it 
worked!
Comment 1 Andrei Badea 2006-07-28 13:18:46 UTC
I'm not able to reproduce this. It seems the schema name is null, but this
should never happen. Were there any exceptions in the console or in the message
log before this NPE?

Can you reproduce it again starting for a clean userdir? If yes, I could provide
a dbschema module with some more loggging, which would allow us to tell where
the problem is. Do you have time for this testing? Thanks.
Comment 2 sitongia 2006-08-09 19:34:31 UTC
Hi,

I tried my steps again with a fresh userdir, and did not get the error.  Must 
be something about my userdir.  I went back and tried again with my old 
userdir, and again it worked fine.  I don't know what the glitch was before.

Thanks for your help.  

==Leonard