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.
Summary: | NullPointerException at org.netbeans.modules.hibernate.wizards.HibernateMappingWizardPanel.fillDatabaseTable | ||
---|---|---|---|
Product: | javaee | Reporter: | csmart <csmart> |
Component: | Hibernate | Assignee: | Vadiraj Deshpande <vadirajvd> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | alcmontejo, gowri, kganfield, psysephiroth |
Priority: | P2 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://statistics.netbeans.org/exceptions/detail.do?id=43598 | ||
Issue Type: | DEFECT | Exception Reporter: | 43598 |
Attachments: |
stacktrace
stacktrace stacktrace stacktrace |
Description
csmart
2008-04-17 15:54:08 UTC
Created attachment 60350 [details]
stacktrace
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 Created attachment 62135 [details]
stacktrace
reassigning... This issue has already 5 duplicates see http://statistics.netbeans.org/exceptions/detail.do?id=43598 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. 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. 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? 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) Created attachment 67169 [details]
stacktrace
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. 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. 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. There's unfortunately, no work around exists for this bug. Wow speedy response, thanks 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? 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) 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) Created attachment 70341 [details]
stacktrace
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. Need to be fixed for 6.5 Fixed : http://hg.netbeans.org/main/rev/2ee445f42d6a Now the database tables are read using db api. |