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 167006 - [67cat] NullPointerException: The argumentValue parameter cannot be null
Summary: [67cat] NullPointerException: The argumentValue parameter cannot be null
Status: RESOLVED WORKSFORME
Alias: None
Product: db
Classification: Unclassified
Component: DB schema (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jiri Rechtacek
URL: http://statistics.netbeans.org/except...
Keywords:
: 175469 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-06-12 19:47 UTC by esmithbss
Modified: 2009-11-04 17:29 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 152542


Attachments
stacktrace (3.48 KB, text/plain)
2009-06-12 19:47 UTC, esmithbss
Details
stacktrace (3.48 KB, text/plain)
2009-06-12 20:05 UTC, esmithbss
Details
Sanitized Schema (JDBC Connect String <HIDDEN/>) (6.77 MB, text/xml)
2009-06-12 21:29 UTC, esmithbss
Details
client (no primary key) message (83.67 KB, image/png)
2009-10-27 13:36 UTC, Troy Giunipero
Details
db schema (96.16 KB, text/plain)
2009-10-27 14:09 UTC, Troy Giunipero
Details
correct db schema for tables above (420.51 KB, text/plain)
2009-10-27 14:23 UTC, Sergey Petrov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description esmithbss 2009-06-12 19:47:19 UTC
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)
Comment 1 esmithbss 2009-06-12 19:47:30 UTC
Created attachment 83519 [details]
stacktrace
Comment 2 esmithbss 2009-06-12 20:04:36 UTC
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)
Comment 3 esmithbss 2009-06-12 20:05:04 UTC
Created attachment 83520 [details]
stacktrace
Comment 4 esmithbss 2009-06-12 21:24:35 UTC
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.


Comment 5 esmithbss 2009-06-12 21:29:57 UTC
Created attachment 83522 [details]
Sanitized Schema (JDBC Connect String <HIDDEN/>)
Comment 6 Sergey Petrov 2009-09-11 12:02:52 UTC
looks like related tables shouldn't be added if there is no primary key or generation should skip tables without primary
key. will look.
Comment 7 Sergey Petrov 2009-10-02 13:40:06 UTC
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?
Comment 8 Sergey Petrov 2009-10-02 13:47:00 UTC
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?
Comment 9 Sergey Petrov 2009-10-02 14:04:06 UTC
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.
 
Comment 10 Sergey Petrov 2009-10-26 20:10:13 UTC
*** Issue 175469 has been marked as a duplicate of this issue. ***
Comment 11 Sergey Petrov 2009-10-26 20:11:05 UTC
see issue 175469 for details
Comment 12 Sergey Petrov 2009-10-27 10:23:43 UTC
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?
Comment 13 Sergey Petrov 2009-10-27 10:31:16 UTC
also do you use any version control system for your web project?
Comment 14 Troy Giunipero 2009-10-27 11:19:47 UTC
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 {

}
Comment 15 Sergey Petrov 2009-10-27 12:14:52 UTC
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?
Comment 16 Sergey Petrov 2009-10-27 12:21:01 UTC
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?
Comment 17 Troy Giunipero 2009-10-27 12:23:53 UTC
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...

Comment 18 Sergey Petrov 2009-10-27 12:35:56 UTC
strange I don't see dbschema too, as I remmber it was created before and was possible to use later instead of reconnection.
Comment 19 Sergey Petrov 2009-10-27 12:39:17 UTC
and it was under src/conf. it still good to verify if schema generation works and provide correct result.
Comment 20 Troy Giunipero 2009-10-27 13:15:50 UTC
Creating the schema using Persistence > Database Schema works fine. Also, there was no 'client (no primary key)' note
under 'Available Tables' in the wizard.
Comment 21 Sergey Petrov 2009-10-27 13:26:07 UTC
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.
Comment 22 Troy Giunipero 2009-10-27 13:34:44 UTC
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.
Comment 23 Troy Giunipero 2009-10-27 13:36:22 UTC
Created attachment 90133 [details]
client (no primary key) message
Comment 24 Sergey Petrov 2009-10-27 13:44:58 UTC
can you attach your schema?
Comment 25 Troy Giunipero 2009-10-27 14:09:21 UTC
Created attachment 90136 [details]
db schema
Comment 26 Sergey Petrov 2009-10-27 14:19:22 UTC
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.
Comment 27 Sergey Petrov 2009-10-27 14:22:25 UTC
for reference will attach correct schema, it also 4.5 times bigger.
Comment 28 Sergey Petrov 2009-10-27 14:23:55 UTC
Created attachment 90137 [details]
correct db schema for tables above
Comment 29 Troy Giunipero 2009-10-27 14:55:14 UTC
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.


Comment 30 Sergey Petrov 2009-10-27 16:12:50 UTC
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.
Comment 31 David Konecny 2009-10-28 02:59:24 UTC
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.
Comment 32 Troy Giunipero 2009-11-01 20:55:39 UTC
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.




Comment 33 Petr Jiricka 2009-11-03 10:23:57 UTC
Also works fine for me, closing as WORKSFORME.