cornercorner
FeaturesPluginsDocs & SupportCommunityPartners

Bug 133124 - NullPointerException at org.netbeans.modules.hibernate.wizards.HibernateMappingWizardPanel.fillDatabaseTable
: NullPointerException at org.netbeans.modules.hibernate.wizards.HibernateMappi...
Status: RESOLVED FIXED
: javaee
Hibernate
: 6.1
: All All
: P2 (vote)
: 6.8
Assigned To:
:
: http://statistics.netbeans.org/except...
: EXCEPTIONS_REPORT
:
:
:
  Show dependency treegraph
 
Reported: 2008-04-17 15:54 by
Modified: 2008-10-07 22:58 (History)
Issue Type: DEFECT
:


Attachments
stacktrace (4.64 KB, text/plain)
2008-04-17 15:54, csmart
Details
stacktrace (4.64 KB, text/plain)
2008-05-29 19:55, josiahhaswell
Details
stacktrace (4.56 KB, text/plain)
2008-08-12 19:36, psysephiroth
Details
stacktrace (4.71 KB, text/plain)
2008-09-23 16:38, Kenneth Ganfield
Details


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2008-04-17 15:54:08
Build: NetBeans IDE 6.1 RC1 (Build 200804100130)
VM: Java HotSpot(TM) Client VM, 10.0-b19, Java(TM) SE Runtime Environment,
1.6.0_05-b13
OS: Windows XP, 5.1, x86

User Comments:
------- Comment #1 From 2008-04-17 15:54:12 -------
Created an attachment (id=60350) [details]
stacktrace
------- Comment #2 From 2008-05-11 10:00:19 -------
I guess this is in case of creating a mapping file with malformed
configuration.
Can you please attach your configuration (.cfg.xml) file that you selected on
the wizard ? Thnx
------- Comment #3 From 2008-05-29 19:55:11 -------
Created an attachment (id=62135) [details]
stacktrace
------- Comment #4 From 2008-05-29 23:08:10 -------
reassigning...
------- Comment #5 From 2008-06-04 18:04:35 -------
This issue has already 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=43598
------- Comment #6 From 2008-06-04 18:57:26 -------
I am not able to reproduce this bug. Please attach either the project or the
steps to reproduce. 
I want to know what db you are using and hibernate.cfg.xml file. It could be
possible that you have a corrupted
configuration. Please open it with some steps. Till then marking it as works
for me.
------- Comment #7 From 2008-08-12 16:31:26 -------
I have been experiencing this as well. For me, this problem persists after
reinstall of the entire IDE. I am using
Netbeans 6.1 with the hibernate plugin and hibernate 3 library. Upon trying to
add a mapping file this error is thrown.
The config xml is as follows:

<?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 name="newsession">
    <property
name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
    <property
name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
    <property
name="hibernate.connection.url">jdbc:oracle:thin:@linus:1521:02</property>
    <property name="hibernate.connection.username">wiped for
security</property>
    <property name="hibernate.connection.password">wiped for
security</property>
  </session-factory>
</hibernate-configuration>

which is a direct result of the design view. I am connecting to an oracle 9i R2
database via the oracle 9i driver in
ojdbc14.jar. I think there is a problem with interpreting some kind of oracle
request or response. The services tab
works perfectly; however, there is no success with the mapping file wizard.
------- Comment #8 From 2008-08-12 16:57:23 -------
This may be a database setup issue, digging through the data shows an oracle
error "Maximum open cursors exceeded". How
many connections does netbeans open when using this plugin?
------- Comment #9 From 2008-08-12 19:36:28 -------
Build: NetBeans IDE 6.1 (Build 200805300101)
VM: Java HotSpot(TM) Client VM, 1.5.0_16-b02, Java(TM) 2 Runtime Environment,
Standard Edition, 1.5.0_16-b02
OS: Windows XP, 5.1, x86

User Comments: 
I believe I have discovered the root of the problem.

Stacktrace: 
java.lang.NullPointerException
        at
org.netbeans.modules.hibernate.wizards.HibernateMappingWizardPanel.fillDatabaseTable(HibernateMappingWizardPanel.java:107)
        at
org.netbeans.modules.hibernate.wizards.HibernateMappingWizardPanel.<init>(HibernateMappingWizardPanel.java:88)
        at
org.netbeans.modules.hibernate.wizards.HibernateMappingWizardDescriptor.getComponent(HibernateMappingWizardDescriptor.java:74)
        at
org.netbeans.modules.hibernate.wizards.HibernateMappingWizard.createSteps(HibernateMappingWizard.java:265)
        at
org.netbeans.modules.hibernate.wizards.HibernateMappingWizard.getPanels(HibernateMappingWizard.java:103)
        at
org.netbeans.modules.hibernate.wizards.HibernateMappingWizard.current(HibernateMappingWizard.java:240)
------- Comment #10 From 2008-08-12 19:36:38 -------
Created an attachment (id=67169) [details]
stacktrace
------- Comment #11 From 2008-08-12 19:40:21 -------
I have discovered the root of this issue. It is a problem when connecting to
large databases. The hibernate plugin
attempts to read from all tables in the database at once (not just the schema
to which you are connected) with a slew of
open cursors. This causes the user to exceed the maximum cursor limit and the
database refuses further connections. The
solution is to ensure tables are only queried from a specific schema when
trying to add a mapping file. This is a
serious error for users working with production level databases as the table
count can reach the ten thousands and no
amount of system DBA settings will solve the problem.
------- Comment #12 From 2008-08-12 20:01:33 -------
I have attempted to discover a workaround by setting various hibernate
properties, these have no effect on resolving the
error. I have also tried changing the syntax of the connection string and using
the Oracle oci driver, no workaround was
found here either.
------- Comment #13 From 2008-08-12 20:25:29 -------
There appears to be a bug in finding the correct schema for the given database
details (from cfg file). Will provide the fix. 
Thanks for reporting the issue.
------- Comment #14 From 2008-08-12 20:27:57 -------
There's unfortunately, no work around exists for this bug.
------- Comment #15 From 2008-08-12 21:49:34 -------
Wow speedy response, thanks
------- Comment #16 From 2008-08-14 21:03:39 -------
I have found a second problem in Netbeans 6.5 Beta that I believe is related to
this issue. I have been unable to submit
an issue for it due to some error communicating with issuezilla; however, the
exception is exception #: 64090. I was
trying to see if I would have any more luck with the hibernate module in
netbeans 6.5 beta and tested the generation of
POJOs and mapping files. Unfortunately it threw an error (although it managed
to complete the reveng.xml anyway, no
POJOs or mappings though, but I believe it is mentioned that this is not
implemented yet). Delving into the errors the
two problems I saw were the "MAXIMUM CURSORS EXCEEDED" error as well as an
insufficient privileges error. The first
error suggests the initial schema issue and the second error is very common to
querying tables that do not belong to a
user. I suspect the schema selection is the problem again. Have you had any
success with solving this?
------- Comment #17 From 2008-09-19 11:19:26 -------
Build: NetBeans IDE Dev (Build 200809180201)
VM: Java HotSpot(TM) Client VM, 1.6.0_02-b06, Java(TM) SE Runtime Environment,
1.6.0_02-b06
OS: Windows XP, 5.1, x86

User Comments:
alcmontejo: Occurs when I Click the Create hibernate mapping file on submenu.

Steps.
1. Right click the package.
2. Select Create Hibernate Mapping file on submenu.

GUEST: Tried to create a new Hibernate mapping file

GUEST: creating a new Hibernate mapping file from the menu.

GUEST: ${buildday}

GUEST: Attempting to create a new hibernate mapping file via the wizard results
in this error.

GUEST: This problem persists after reinstall. I am using Netbeans 6.1 with the
hibernate plugin and hibernate 3 library. Upon trying to add a mapping file
this error is thrown. The config xml is as follows:

<?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 name="newsession">
    <property
name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
    <property
name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
    <property
name="hibernate.connection.url">jdbc:oracle:thin:@linus:1521:02</property>
    <property name="hibernate.connection.username">wiped for
security</property>
    <property name="hibernate.connection.password">wiped for
security</property>
  </session-factory>
</hibernate-configuration>

which is a direct result of the design view. I am co

psysephiroth: Attempting to apply a default schema still results in failure

psysephiroth: I believe I have discovered the root of the problem.

alcmontejo: Occurs when I Click the Create hibernate mapping file on submenu.

Steps.
1. Right click the package.
2. Select Create Hibernate Mapping file on submenu.



Stacktrace: 
java.lang.NullPointerException
        at
org.netbeans.modules.hibernate.wizards.HibernateMappingWizardPanel.fillDatabaseTable(HibernateMappingWizardPanel.java:108)
        at
org.netbeans.modules.hibernate.wizards.HibernateMappingWizardPanel.<init>(HibernateMappingWizardPanel.java:89)
        at
org.netbeans.modules.hibernate.wizards.HibernateMappingWizardDescriptor.getComponent(HibernateMappingWizardDescriptor.java:74)
        at
org.netbeans.modules.hibernate.wizards.HibernateMappingWizard.createSteps(HibernateMappingWizard.java:297)
        at
org.netbeans.modules.hibernate.wizards.HibernateMappingWizard.getPanels(HibernateMappingWizard.java:115)
        at
org.netbeans.modules.hibernate.wizards.HibernateMappingWizard.current(HibernateMappingWizard.java:271)
------- Comment #18 From 2008-09-23 16:38:24 -------
Build: NetBeans IDE Dev (Build 200809220201)
VM: Java HotSpot(TM) 64-Bit Server VM, 1.6.0_05-b13-52, Java(TM) SE Runtime
Environment, 1.6.0_05-b13-120
OS: Mac OS X, 10.5.4, x86_64

User Comments: 
using the new file wizard to create a hibernate mapping file

Stacktrace: 
java.lang.NullPointerException
        at
org.netbeans.modules.hibernate.wizards.HibernateMappingWizardPanel.fillDatabaseTable(HibernateMappingWizardPanel.java:108)
        at
org.netbeans.modules.hibernate.wizards.HibernateMappingWizardPanel.<init>(HibernateMappingWizardPanel.java:89)
        at
org.netbeans.modules.hibernate.wizards.HibernateMappingWizardDescriptor.getComponent(HibernateMappingWizardDescriptor.java:74)
        at
org.netbeans.modules.hibernate.wizards.HibernateMappingWizard.createSteps(HibernateMappingWizard.java:297)
        at
org.netbeans.modules.hibernate.wizards.HibernateMappingWizard.getPanels(HibernateMappingWizard.java:115)
        at
org.netbeans.modules.hibernate.wizards.HibernateMappingWizard.current(HibernateMappingWizard.java:271)
------- Comment #19 From 2008-09-23 16:38:29 -------
Created an attachment (id=70341) [details]
stacktrace
------- Comment #20 From 2008-09-24 13:36:56 -------
There are two problems associated with this bug :
- Reading all database tables should be modified to query only tables under the
given schema/catalog.
- Graceful handling of database operation exceptions and notification.
------- Comment #21 From 2008-09-25 19:19:14 -------
Need to be fixed for 6.5
------- Comment #22 From 2008-10-07 22:58:36 -------
Fixed : http://hg.netbeans.org/main/rev/2ee445f42d6a

Now the database tables are read using db api.