db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timothy Luksha \(RIT Student\)" <tjl6...@rit.edu>
Subject apache derby with CDC/JSR 169
Date Fri, 23 Dec 2005 15:10:31 GMT
Unfortunately, With the CVM it seems like I must set the derby.jar path in the Xbootclasspath
or I get a class not found error on the EmbeddedSimpleDataSource.  We did some digging through
the source code here inside the basemonitor.java.  It seems like the NullPointerException
was possibly coming from the getDefaultModuleProperties method in basemonitor.  We noticed
this segment of code.
   ClassLoader cl = getClass().getClassLoader();
   try {
      for( Enumeration e = cl.getResources("org/apache/derby/modules.properties");
The javadoc for the getClassLoader states that in some situations it will return null to represent
a bootstraploader.  So we replaced that code with the following:

   ClassLoader cl = getClass().getClassLoader();
   try {
      Enumeration e;
         if ( cl != null ) {
            e = cl.getResources("org/apache/derby/modules.properties");
         } else {
            e = ClassLoader.getSystemResources("org/apache/derby/modules.properties" );
I recompiled this code and it has changed the results I was getting with CVM but Derby still
does not work right.  Now instead of getting a null pointer exception in BaseMonitor, the
getConnection sets my connection variable myconn to null when I do the following in runner:
Connection myconn = df.getConnection();

So I've succeeded in moving the null pointer exception into my program.  I guess my main point
was that getClassLoader() is allowed to return null and that's what it seems to be doing on
CVM when I try to run runner, and I am still not sure what to do to resolve my issues.  Thanks
for the help so far.
Happy Holidays!

View raw message