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 188462 - JPA Entity Class creation fails but no error message or dialog is provided to the user.
Summary: JPA Entity Class creation fails but no error message or dialog is provided to...
Status: RESOLVED INCOMPLETE
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P2 normal (vote)
Assignee: Jiri Rechtacek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-07 20:35 UTC by esmithbss
Modified: 2010-07-12 13:29 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
<no description> (1.18 MB, application/octet-stream)
2010-07-07 20:38 UTC, esmithbss
Details

Note You need to log in before you can comment on or make changes to this bug.
Description esmithbss 2010-07-07 20:35:33 UTC
Product Version = NetBeans IDE 6.9.1 Dev (Build 201006282301)
Operating System = Windows XP version 5.1 running on x86
Java; VM; Vendor = 1.6.0_20
Runtime = Java HotSpot(TM) Client VM 16.3-b01

Using a legacy Oracle database with Primary Keys defined on all of the tables (489 of them), I attempted to create a new Java Web Application project and immediately add JPA Entity Classes from the database using an existing connection defined within the Services tab and connected to the development environment.

1) I selected File -> New -> Other -> Persistence -> Entity Classes from Database

2) Selected Next, chose the proper jndi data source (double checked and verified that it works).

At this point, the Table Selection dialog should load the set of tables in the database, but instead, it just sits there.  No error messages.  No table list.  Nothing.


Looking at the IDE Log file, there is an exception:
INFO [glassfish]: Requested Entity: public id = -//Sun Microsystems, Inc.//DTD Application Server 9.0 Resource Definitions //EN, system id = http://www.sun.com/software/appserver/dtds/sun-resources_1_3.dtd
WARNING [org.netbeans.modules.dbschema.jdbcimpl.SchemaElementImpl]: Some older versions of the Oracle  driver do not support getDatabaseMajorVersion().   Setting recycle bin tables to an empty list.
java.sql.SQLException: Unsupported feature
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
        at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
        at oracle.jdbc.dbaccess.DBError.throwUnsupportedFeatureSqlException(DBError.java:689)
        at oracle.jdbc.OracleDatabaseMetaData.getDatabaseMajorVersion(OracleDatabaseMetaData.java:4442)
        at org.netbeans.modules.dbschema.jdbcimpl.SchemaElementImpl.getOracleRecycleBinTables(SchemaElementImpl.java:730)
        at org.netbeans.modules.dbschema.jdbcimpl.SchemaElementImpl.initTables(SchemaElementImpl.java:242)
        at org.netbeans.modules.dbschema.jdbcimpl.SchemaElementImpl.initTables(SchemaElementImpl.java:216)
        at org.netbeans.modules.j2ee.persistence.wizard.fromdb.DBSchemaManager$3.run(DBSchemaManager.java:197)
        at org.netbeans.modules.j2ee.core.api.support.progress.ProgressSupport$ActionInvoker.invokeNextActionsOfSameKind(ProgressSupport.java:270)
        at org.netbeans.modules.j2ee.core.api.support.progress.ProgressSupport$ActionInvoker.access$100(ProgressSupport.java:118)
[catch] at org.netbeans.modules.j2ee.core.api.support.progress.ProgressSupport$ActionInvoker$1.run(ProgressSupport.java:159)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
        at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1957)

Which should be indicated to the developer in some way shape or form so the developer can correct the problem.  The message should indicate to the end user the minimum version of the driver for the Entity Class generation.

As it stands, it appears that the IDE is broken and incapable of completing the wizard operations.
Comment 1 esmithbss 2010-07-07 20:38:02 UTC
Created attachment 100669 [details]
<no description>
Comment 2 Jiri Rechtacek 2010-07-09 19:14:36 UTC
It's not P1 in NetBeans, NetBeans cannot guarantee all JDBC driver implements fully all interfaces.  It's not a primary functionality, moreover a bug in Oracle JDBC driver. Better report the bug there I think. NetBeans can add some workaround this bug.
Comment 3 esmithbss 2010-07-09 20:09:07 UTC
The bug at issue here is not whether the underlying JDBC driver did it's job properly or not.

The issue is that the JDBC driver threw an exception which was not caught by NetBeans and reported back to the user properly.

As a result, NetBeans appears to the user to be frozen (which it isn't) or worse, incomplete, broken and poorly tested (which it isn't).

In fact, I left NB running this for 30 minutes (large database) and when I came back, I thought NetBeans was hung.  If I hadn't known about the View IDE Log capability (which I only know due to working with NetCat6x) or where the log files were stored, I would never have known it wasn't.

The simple fix for this is to politely notify the user of the exception.
Comment 4 Jiri Rechtacek 2010-07-12 13:29:06 UTC
I'm not able to reproduce it from Oracle Sample database, using ojdbc6.jar driver. Eric, what Oracle JDBC driver are you using? Could you attach your dbschema file which makes the problems. Thanks