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 147870 - sample DB not found in tests
Summary: sample DB not found in tests
Status: RESOLVED DUPLICATE of bug 144222
Alias: None
Product: db
Classification: Unclassified
Component: Derby (show other bugs)
Version: 6.x
Hardware: All Linux
: P2 blocker (vote)
Assignee: John Baker
URL:
Keywords: REGRESSION, T9Y, TEST
Depends on:
Blocks:
 
Reported: 2008-09-22 13:15 UTC by Lukas Jungmann
Modified: 2008-10-10 20:08 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot (255.74 KB, image/png)
2008-09-23 13:20 UTC, Lukas Jungmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Jungmann 2008-09-22 13:16:39 UTC
-run IDE on JDK 5 (I have local MySQL installation, if that matters), ie by:

./netbeans --userdir /tmp/52 --jdkhome /space/java/sdk/jdk1.5.0_16/
-J-Dcom.sun.aas.installRoot=/space/java/servers/glassfish

-go to services window
-expand Databases node

=>
 Expected: there will be preregistered connection to Sample db
 Actual: no javadb connections are preregistered
Comment 1 Lukas Jungmann 2008-09-22 13:21:29 UTC
btw: another steps to reproduce:

cd main
ant -Dcluster.config=j2ee
cd websvc.restkit
ant clean test-qa-functional -Dtest.config=stable -Dtest-qa-functional-sys-prop.glassfish.home=/path/to/glassfish

first test creates entities from sample DB - if it passes (entities are created) everything is OK, if not then there's
something wrong mostly in DB area
Comment 2 John Baker 2008-09-22 20:05:01 UTC
Vince, were there any changes in the Glassfish plugin w/respect to sample database creation ?
Comment 3 Vince Kraemer 2008-09-22 20:35:22 UTC
The code that does the registration doesn't look like it has changed in about 1 year....
Comment 4 John Baker 2008-09-22 21:03:35 UTC
Thanks Vince
Also, no changes to the Java DB Database support module in the past few weeks.

May be caused by changes to the connection nodes?
Comment 5 John Baker 2008-09-22 21:10:04 UTC
The code to add a connection is in DerbyDatabases

        DatabaseConnection dbconn = DatabaseConnection.create(drivers[0], "jdbc:derby://localhost:" +
RegisterDerby.getDefault().getPort() + "/" + databaseName, user, schema, password, rememberPassword); // NOI18N

If drivers[0] is null then a NullPointerException would occur, so drivers[0] is not null.

I'll debug this
Comment 6 John Baker 2008-09-22 22:18:40 UTC
Not reproducible when adding Glassfish manually.  Sample database connections are added.

I tried the example command provided , but this option didn't register Glassfish (at least on Mac)

-J-Dcom.sun.aas.installRoot=/Applications/NetBeans/glassfish-v2ur2

Comment 7 Lukas Jungmann 2008-09-23 00:10:16 UTC
Did you run IDE w/ -J-Dcom.sun.aas.... option with clean userdir? It works only for the first start of the IDE.
Comment 8 John Baker 2008-09-23 01:26:29 UTC
Yes, I did.  

Here's the command I ran on Mac:

/Users/test/r17/main/nbbuild/netbeans/bin/netbeans --userdir .r3  --jdkhome
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home 
-J-Dcom.sun.aas.installRoot=/Applications/NetBeans/glassfish-v2ur2
Comment 9 John Baker 2008-09-23 01:29:56 UTC
Maybe I need to download the latest Nightly build.  

When I execute a local build, Glassfish isn't registered
Comment 10 John Baker 2008-09-23 06:13:15 UTC
When I use the commandline options to point to Glassfish v2, when NB starts up, Glassfish v3 is registered.

Is this the correct option to register Glassfish v2 
 -J-Dcom.sun.aas.installRoot  
?

Note that the sample databases are registered if Glassfish v3 is only registered.

Marking incomplete since either the command provided is incorrect or there was a misunderstanding that GFv3 plugin
registers the sample databases
Comment 11 John Baker 2008-09-23 06:20:38 UTC
Actually this appears to be a problem with the command.

If I omit the Glassfish installPath then Glassfish v2 and v3 are registered and the sample database connections are
registered.

/netbeans --userdir ~/.r7  --jdkhome /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home

In the automation scripts, try omitting , 
-J-Dcom.sun.aas.installRoot=/space/java/servers/glassfish
Comment 12 Lukas Jungmann 2008-09-23 13:19:39 UTC
looks like this is linux-only (GF-v2 -v2ur2 and v2.1-b51- are used), I also got rid of local MySQL this time

I tried the same on Vista and it works there. The option is correct (at least for win, linux and solaris; I have almost
no experience with mac).

See also attached screenshot
Comment 13 Lukas Jungmann 2008-09-23 13:20:48 UTC
Created attachment 70315 [details]
screenshot
Comment 14 Lukas Jungmann 2008-09-24 16:18:44 UTC
another steps to reproduce are mentioned in #desc2 (or you can use same command as in issue 148211 - only use JDK5
instead of JDK6)

btw: I experienced this more then six months ago for the first time but didn't report it as I expected that it's only
issue in my shortcut to run the IDE but apparently it isn't, sorry for this
Comment 15 John Baker 2008-09-24 16:55:02 UTC
It appears the Java DB path and database location do not get set,  only on Linux
Comment 16 John Baker 2008-09-25 01:57:17 UTC
It seems the automated test don't really "register" Glassfish, they just set some property.

Glassfish is registered by invoking "register(..)" in RegisterPointbase.java  (this class resides in the Glassfish module)

When register(...) is invoked, Java DB path is set.  If Java DB is not set then the sample databases can't be created
Comment 17 John Baker 2008-09-25 03:38:42 UTC
The Java DB registered can come from JDK 1.6 or Glassfish.

I tried to reproduce this manually, but the sample database was registered.
Comment 18 John Baker 2008-09-25 18:26:20 UTC
GF team says "This could also be related to IZ 144222
The 'com.sun.aas.installRoot' should be used for registering GlassFish but does not in certain cases."
Comment 19 John Baker 2008-10-08 04:27:41 UTC
144222 has been fixed and verified, so since this issue may be a duplicate, is it also fixed?
Comment 20 Lukas Jungmann 2008-10-10 19:58:02 UTC
yes, seems to be OK now
Comment 21 John Baker 2008-10-10 20:07:59 UTC
turned out to be a duplicate of 144222

*** This issue has been marked as a duplicate of 144222 ***