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 212636 - Hibernate Mapping Files and POJOs from Database on Firebird DB java.lang.NullPointerException
Summary: Hibernate Mapping Files and POJOs from Database on Firebird DB java.lang.Null...
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Hibernate (show other bugs)
Version: 7.0.1
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Sergey Petrov
URL:
Keywords:
: 209546 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-05-17 12:42 UTC by Coban
Modified: 2012-06-01 05:29 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 Coban 2012-05-17 12:42:36 UTC
Hi all,
I have tables on Firebird database. I want to use Hibernate for Data Layer. 
I can create hibernate.cfg.xml and hibernate.reveng.xml files but when I want to 
create java files from database with Hibernate Mapping Files and POJOs from Database, there is no any create files. It gives me an error as below. Please help..

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)
[catch] at org.netbeans.modules.hibernate.wizards.HibernateCodeGenWizard.generateClasses(HibernateCodeGenWizard.java:328)
	at org.netbeans.modules.hibernate.wizards.HibernateCodeGenWizard.instantiate(HibernateCodeGenWizard.java:426)
	at org.openide.loaders.TemplateWizard$InstantiatingIteratorBridge.instantiate(TemplateWizard.java:1019)
	at org.openide.loaders.TemplateWizard.handleInstantiate(TemplateWizard.java:591)
	at org.openide.loaders.TemplateWizard.instantiateNewObjects(TemplateWizard.java:412)
	at org.openide.loaders.TemplateWizardIterImpl.instantiate(TemplateWizardIterImpl.java:256)
	at org.openide.loaders.TemplateWizardIteratorWrapper.instantiate(TemplateWizardIteratorWrapper.java:168)
	at org.openide.WizardDescriptor.callInstantiateOpen(WizardDescriptor.java:1548)
	at org.openide.WizardDescriptor.callInstantiate(WizardDescriptor.java:1505)
	at org.openide.WizardDescriptor.access$1700(WizardDescriptor.java:137)
	at org.openide.WizardDescriptor$Listener$2$1.run(WizardDescriptor.java:2099)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1424)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1968)
Comment 1 Sergey Petrov 2012-05-17 13:22:25 UTC
*** Bug 209546 has been marked as a duplicate of this bug. ***
Comment 2 Sergey Petrov 2012-05-17 13:25:49 UTC
exception is thrown from hibernate code and may mean incomplete setup, also firebird may not be handled properly by netbeans, but anyway npe need to be wrapped somehow if can't be fixed on nb side.
please provide some details on you db setup, db version, what driver is used, tables schema may be usefull also.
Comment 3 Coban 2012-05-17 14:29:53 UTC
thanks for your replay my friend. Versions inf. as below

db version : 2.5.1.26351 FireBird 2.5
Driver     : jaybird 2.1.6

there is no any tables schema..

Hibernate.cfg.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
  <session-factory>
    <property name="hibernate.dialect">org.hibernate.dialect.FirebirdDialect</property>
    <property name="hibernate.connection.driver_class">org.firebirdsql.jdbc.FBDriver</property>
    <property name="hibernate.connection.url">jdbc:firebirdsql://localhost:3050/d:/HATA_DB.FDB</property>
    <property name="hibernate.connection.username">sysdba</property>
    <property name="hibernate.connection.password">masterkey</property>
  </session-factory>
</hibernate-configuration>


hibernate.reveng.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd">
<hibernate-reverse-engineering>
  <schema-selection/>
  <table-filter match-name="TEST"/>
</hibernate-reverse-engineering>
Comment 4 Sergey Petrov 2012-05-29 13:44:56 UTC
from topics like https://forum.hibernate.org/viewtopic.php?f=1&t=992423
looks like hibernate/firebird compatibility isse (unfortunately solution from topic above have n effect).
i can wrap the message on nb side to avoid throwing and nothing else in my opinion, will be shown as short message in wizard panel and full will go into message.log.
but feel free to add more details if feel I'm wrong with my assumptions.
Comment 5 Sergey Petrov 2012-05-30 13:11:00 UTC
it's not really exception fix as it may be valid exception from hibernate,
but "configuration fail" exceptions are shown on last wizard step now instead of generation time and are logged in message log instead of exception window.
http://hg.netbeans.org/web-main/rev/d1184b8c5294
if any exception is related to wrongly generated  by nb hibernate config etc, it still may be valid issue and need to be filed separately.
Comment 6 Quality Engineering 2012-06-01 05:29:00 UTC
Integrated into 'main-golden', will be available in build *201206010001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/d1184b8c5294
User: Sergey B. Petrov <sj-nb@netbeans.org>
Log: #212636  wrap exceptions from ibernate in pojo wizard on last wizard step