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.
Build: NetBeans IDE Dev (Build 200906120201) VM: Java HotSpot(TM) Client VM, 11.3-b02, Java(TM) SE Runtime Environment, 1.6.0_13-b03 OS: Windows XP, 5.1, x86 User Comments: esmithbss: Generating Entity Classes from my database and creating the persistence unit Stacktrace: java.lang.NullPointerException: The argumentValue parameter cannot be null at org.openide.util.Parameters.notNull(Parameters.java:86) at org.netbeans.modules.j2ee.core.api.support.java.GenerationUtils.createAnnotationArgument(GenerationUtils.java:285) at org.netbeans.modules.j2ee.persistence.wizard.fromdb.JavaPersistenceGenerator$Generator$EntityClassGenerator.initialize(JavaPersistenceGenerator.java:814) at org.netbeans.modules.j2ee.persistence.wizard.fromdb.JavaPersistenceGenerator$Generator$ClassGenerator.run(JavaPersistenceGenerator.java:670) at org.netbeans.modules.j2ee.persistence.wizard.fromdb.JavaPersistenceGenerator$Generator$1.run(JavaPersistenceGenerator.java:441) at org.netbeans.modules.j2ee.persistence.wizard.fromdb.JavaPersistenceGenerator$Generator$1.run(JavaPersistenceGenerator.java:437)
Created attachment 83519 [details] stacktrace
Build: NetBeans IDE Dev (Build 200906120201) VM: Java HotSpot(TM) Client VM, 11.3-b02, Java(TM) SE Runtime Environment, 1.6.0_13-b03 OS: Windows XP, 5.1, x86 User Comments: Attempted regeneration of contents from database. Stacktrace: java.lang.NullPointerException: The argumentValue parameter cannot be null at org.openide.util.Parameters.notNull(Parameters.java:86) at org.netbeans.modules.j2ee.core.api.support.java.GenerationUtils.createAnnotationArgument(GenerationUtils.java:285) at org.netbeans.modules.j2ee.persistence.wizard.fromdb.JavaPersistenceGenerator$Generator$EntityClassGenerator.initialize(JavaPersistenceGenerator.java:814) at org.netbeans.modules.j2ee.persistence.wizard.fromdb.JavaPersistenceGenerator$Generator$ClassGenerator.run(JavaPersistenceGenerator.java:670) at org.netbeans.modules.j2ee.persistence.wizard.fromdb.JavaPersistenceGenerator$Generator$1.run(JavaPersistenceGenerator.java:441) at org.netbeans.modules.j2ee.persistence.wizard.fromdb.JavaPersistenceGenerator$Generator$1.run(JavaPersistenceGenerator.java:437)
Created attachment 83520 [details] stacktrace
This may be a new instance of #149847 which is marked as fixed in 6.7. Unfortunately, the fixed status on 149847 is WORKSFORME because it could not be reproduced. I have reproduced this behavior on 6.5 and 6.7(200906120201) on both Windows XP and Linux using Java6-v13 and Java6-v14. The database that I am generating entity classes from contains a large number (20%) of the tables with no primary keys. As a result, when I select the tables to generate classes for (hit the Add-All button), with the default setting of "Include Related Tables", the system lists a number of tables in the SelectedTables list on the second page of the wizard in a "grayed out" style. However, if I disable the "Include Related Tables", checkbox these tables are listed as full members of the list. Regardless of the setting for this check-box, the results are the same. NPE from the Java Persistence Generator's Entity Class Generator (line 799) where it tries to create an annotation.
Created attachment 83522 [details] Sanitized Schema (JDBC Connect String <HIDDEN/>)
looks like related tables shouldn't be added if there is no primary key or generation should skip tables without primary key. will look.
tried CREATE TABLE PKSAMPLE ( id integer primary key, name varchar(10) ); CREATE TABLE NOPK ( col1 integer, col2 integer, foreign key (col2) references PKSAMPLE ); and found no way to add NOPK to selected tables, also tried schema attache above and ths schema provide no table at all. should I correct this schema somehow?
what I see, there is a problem with table name resolving, but I can't reproduce this problem. can schema be reattached or sql script for table creation provided?
may be related, 2 from 3 reports have java.io.FileNotFoundException: org.netbeans.modules.masterfs.filebasedfs.utils.FSException: Cannot get shared access to path\CBM_ENTEK_CBM_Entek_WebServices.dbschema (probably opened for writing). before reported exception.
*** Issue 175469 has been marked as a duplicate of this issue. ***
see issue 175469 for details
tgiunipero can you provide more details? I can't reproduce the problem with suggested steps. it may have sense: what mysql database is used, what jdbc driver is used? can you try latest if it's not latest. what server do you use (I tried gf 2.1 and latest gf 3 b68)? how data source was created/registered on server? are classes completely empty? is it always reproducible for you?
also do you use any version control system for your web project?
NetBeans IDE Dev (Build 200910260201) GlassFish v3 b68 MySQL 5.1.39 driver is whatever was used through NB + GF automatic JDBC driver deployment new datasource created in the Entities from DB wizard (select New Data Source from the drop-down) click Add All button (note that under 'Available Tables' it states: client (no primary key)) create default PU using EclipseLink create package named 'entities' run wizard Using the above steps, an 'org.openide.util.RequestProcessor$FastItem' exception occurs. This is always reproducible for me. Not using a vcs for this. Entity classes appear as follows: package entities; /** * * @author troy */ public class Address { }
can you check db schema generated with "entity from db" in your project WEB-INF folder if it contain all tables and columns with properties?
I don't see any messages about missed primary key, can you generate database schema separately also with Persstence|Database Schema to verify if it will be generated correctly? do you see all tables with columns on Services tab?
you mean under src/conf, right? There's usually a .dbschema file that's created and displays under the Configuration Files node in the Projects window. It seems that no schema is being generated in this case...
strange I don't see dbschema too, as I remmber it was created before and was possible to use later instead of reconnection.
and it was under src/conf. it still good to verify if schema generation works and provide correct result.
Creating the schema using Persistence > Database Schema works fine. Also, there was no 'client (no primary key)' note under 'Available Tables' in the wizard.
can you try if entities generation fails the same way for this schema as for generation from data source? /as for pk warning, schema generation shouldn't check it, it's Entities requirement to have pk.
Same deal. Running the Create Entity Classes from Database wizard on the new schema results in the 'RequestProcessor$FastItem' occurring, with empty entity classes. I'm attaching a screenshot to show what I mean about the 'client (no primary key)' message.
Created attachment 90133 [details] client (no primary key) message
can you attach your schema?
Created attachment 90136 [details] db schema
Client have composite primary key, and t works on my system, do you have mysql driver somewhere in classpath? it may conflict with nb driver, or may be nb driver do not work well with 5.1.x (I'm using 5.0.67). In my opinion the main issue is in db schema resolving and secondary one is incorrect handling of wrong (or incomplete) schema on persistence side. Attached schema do not have columns information for tables (or ide don't see it as I tried to expand it in project tree and found no columns) the issue need to be evaluated on db-schema side.
for reference will attach correct schema, it also 4.5 times bigger.
Created attachment 90137 [details] correct db schema for tables above
Well, the mysql-connector-java-5.1.6-bin.jar exists in GF's domain1/lib folder. I didn't add it there explicitly, so it must have got there using NB's driver auto deployment feature. As mentioned, I'm using MySQL version 5.1.39. Not sure if that answers your question. If not, pls clarify.
I mean mysql-connector-java-5.1.6-bin.jar may not support MySQL version 5.1.39 and need to be updated. But let someone from db look at the issue too.
I cannot reproduce either. Troy's dbschema looks corrupted (columns are missing) and sanitized.dbschema throws exception during opening: "org.xml.sax.SAXException: Saw tag HIDDEN when OBJECT, ARRAY, NULLVALUE was expected." while parsing STORED_VIEW.
I tried running the Create Entity Classes from Database wizard again and this time it seems to work okay. The only thing I did differently was that I deleted the database instance /outside of NetBeans/, then recreated it from the script. If nobody can reproduce, maybe close as worksforme.
Also works fine for me, closing as WORKSFORME.