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 146785 - NullPointerException at org.hibernate.cfg.SettingsFactory.buildSettings
Summary: NullPointerException at org.hibernate.cfg.SettingsFactory.buildSettings
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Hibernate (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Vadiraj Deshpande
URL: http://statistics.netbeans.org/except...
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2008-09-10 14:15 UTC by tutus
Modified: 2009-03-18 06:22 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 67446


Attachments
stacktrace (1.51 KB, text/plain)
2008-09-10 14:17 UTC, tutus
Details
stacktrace (1.51 KB, text/plain)
2008-12-08 17:01 UTC, Jan Horvath
Details
stacktrace (1.51 KB, text/plain)
2009-03-18 06:22 UTC, saeed_z_f
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tutus 2008-09-10 14:16:51 UTC
Build: NetBeans IDE 6.5 Beta (Build 200808111757)
VM: Java HotSpot(TM) Client VM, 1.5.0_09-b01, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_09-b01
OS: Windows XP, 5.1, x86

User Comments: 
Hi,
I tried to create a reverse engineering configuration file, just like in this Tutorial:

http://wiki.netbeans.org/HibernateAndWebApp#section-HibernateAndWebApp-UsingNetBeansForBuildingHibernateBasedWebApplications 

Thanks

Stacktrace: 
java.lang.NullPointerException
        at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:86)
        at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2005)
        at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:40)
        at org.netbeans.modules.hibernate.wizards.HibernateRevengWizard.generateClasses(HibernateRevengWizard.java:329)
        at org.netbeans.modules.hibernate.wizards.HibernateRevengWizard.instantiate(HibernateRevengWizard.java:448)
        at org.openide.loaders.TemplateWizard$InstantiatingIteratorBridge.instantiate(TemplateWizard.java:1023)
Comment 1 tutus 2008-09-10 14:17:06 UTC
Created attachment 69537 [details]
stacktrace
Comment 2 Vadiraj Deshpande 2008-09-10 16:57:46 UTC
HI, Can you post the entire stack trace please ? I am sure there would be another set of stack trace before the one attached to this issue and that would be the 
root cause. And have you established the database connection before trying creating the Reverse Engg. file as suggested in that tutorial ? Thanks.
Comment 3 tutus 2008-09-11 07:54:58 UTC
Hi, there is another Stacktrace but it disappear so qwick that i didn't see it.It is an Exception: Access denied
'root'@'localhost'(using password:YES)==> but i don't use any Password for de database...And yes the connection to the
database was established before i tried to creat the Reverse Engg.
Comment 4 tutus 2008-09-11 09:44:16 UTC
Hi, the Privileges for the User Root wasent set. After setting, Everything works :-) 
Comment 5 Exceptions Reporter 2008-11-14 01:13:39 UTC
Reopening - reproduced in NetBeans IDE 6.5 RC2 (Build 200810270001)
http://statistics.netbeans.org/exceptions/detail.do?id=139355
Comment 6 Vadiraj Deshpande 2008-11-18 10:41:03 UTC
To be taken up in 7.0 release.
Comment 7 Jan Horvath 2008-12-08 17:01:08 UTC
Build: NetBeans IDE Dev (Build 081208)
VM: Java HotSpot(TM) 64-Bit Server VM, 1.6.0_07-b06-57, Java(TM) SE Runtime Environment, 1.6.0_07-b06-153
OS: Mac OS X, 10.5.5, x86_64

User Comments: 
exception raised while generation POJOs from Sakila sample database

Stacktrace: 
java.lang.NullPointerException
        at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:86)
        at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2005)
        at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:40)
        at org.netbeans.modules.hibernate.wizards.HibernateRevengWizard.generateClasses(HibernateRevengWizard.java:332)
        at org.netbeans.modules.hibernate.wizards.HibernateRevengWizard.instantiate(HibernateRevengWizard.java:459)
        at org.openide.loaders.TemplateWizard$InstantiatingIteratorBridge.instantiate(TemplateWizard.java:1016)
Comment 8 Jan Horvath 2008-12-08 17:01:17 UTC
Created attachment 74703 [details]
stacktrace
Comment 9 Jan Horvath 2008-12-09 12:02:56 UTC
I'm not able to workaround this issue in latest build. Should be fixed for M1.
Comment 10 Jan Horvath 2008-12-09 12:31:10 UTC
working for me in 6.5 FCS with the same database, marking as regression
Comment 11 Vadiraj Deshpande 2008-12-09 13:13:21 UTC
Will look into this.
Comment 12 Vadiraj Deshpande 2008-12-09 13:17:44 UTC
Hi Honza,

Can you please attach the full IDE log ? I believe there should be another stacktrace with the root cause.

Thanks,
-Vadiraj
Comment 13 Vadiraj Deshpande 2008-12-10 07:31:15 UTC
Not able to reproduce by normal flow.. Asked Honza for help.
Comment 14 Jan Horvath 2008-12-10 09:54:01 UTC
as the steps already mentioned are not 100% reproducible, I've found slightly different steps to reproduce the same exception:

-create new project
-create hibernate.cfg with a wrong db password
-start the wizard
-you are prompted for the correct password, list of tables is retrived
-select tables
-finish the wizard
-NPE, nothing created
Comment 15 Vadiraj Deshpande 2008-12-11 19:04:30 UTC
Fixed:
(added database connection verification before calling reverse engg. processor)
http://hg.netbeans.org/main/rev/1f1d25cc805f
Comment 16 Jan Horvath 2008-12-12 14:24:26 UTC
v.
Comment 17 petabyte 2008-12-13 06:53:46 UTC
As a workaround for this issue.
include the hibernate.connection.password in hibernate.cfg.xml
Comment 18 saeed_z_f 2009-03-18 06:22:33 UTC
Build: NetBeans IDE 6.5 (Build 200811100001)
VM: Java HotSpot(TM) Client VM, 11.0-b16, Java(TM) SE Runtime Environment, 1.6.0_11-b03
OS: Windows XP, 5.1, x86

User Comments: 


Stacktrace: 
java.lang.NullPointerException
        at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:86)
        at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2005)
        at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:40)
        at org.netbeans.modules.hibernate.wizards.HibernateRevengWizard.generateClasses(HibernateRevengWizard.java:332)
        at org.netbeans.modules.hibernate.wizards.HibernateRevengWizard.instantiate(HibernateRevengWizard.java:459)
        at org.openide.loaders.TemplateWizard$InstantiatingIteratorBridge.instantiate(TemplateWizard.java:1016)
Comment 19 saeed_z_f 2009-03-18 06:22:43 UTC
Created attachment 78345 [details]
stacktrace