db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepa Remesh <drem...@gmail.com>
Subject Re: apache derby with CDC/JSR 169
Date Fri, 23 Dec 2005 23:30:10 GMT
Hi Tim,

I did not know that CVM does not use "CLASSPATH" environment variable.
Maybe you already tried using "-Djava.class.path=<...>" and
"-classpath <...>" options. I cannot help much because I have not used
CVM. I have tried the same with IBM's CDC implementation
(j9 foundation VM available in WCTME 5.7) and it works.

Your solution to check for bootstrap class loader works with no
problems for me (I had tried this on j9_foundation VM). With this, I
can specify derby.jar in bootclasspath and I don't get NPE when
getting a connection using EmbeddedSimpleDataSource. Again, I do not
know if it is okay to put Derby jars in bootclasspath. It would be
good to hear from others if this is okay. You may open a JIRA entry
for this. Information to do this is at
http://db.apache.org/derby/derby_comm.html

Thanks for your interest in Derby.

Deepa

On 12/23/05, Timothy Luksha (RIT Student) <tjl6426@rit.edu> wrote:
> 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!
>
> Tim

Mime
View raw message