I think perhaps more relevant is which class loader your code is using since
it sounds like you are attempting to load the JDBC driver yourself.
 
Your module will get loaded by the code in
org.argouml.moduleloader.ModuleLoader2.  If you are attempting to use the
same classloader that loaded your module, you can see how it is set up
there.  If you're using the default classloader, that may not be relevant.
Have you tried putting the driver jar in the same directory that your module
jar is in?  That's one place that the classloader is likely to find it since
it loaded the module from there.
 
Don't forget that whatever scheme you come up with needs to work not only
from the command line, but also when running as a Java WebStart app and,
ideally, when running under Eclipse.  Each environment has slightly
different classloader setups.
 
Tom

-----Original Message-----
From: Gunderson, Jeff [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 22, 2007 11:07 AM
To: [email protected]
Subject: [argouml-dev] Classpath with modules



Hi,

 

Our module needs to be able to load JDBC driver classes dynamically.  If we
need to load a driver we specify the driver jar file in the CLASSPATH.  This
works fine when we run ArgoUML and our module from an Ant build.

 

But when we try to run ArgoUML from the argouml.jar file we can't find the
drivers.  We tried specifying the driver jar in:

 

java -jar -cp driver.jar argouml.jar

 

And with

 

set CLASSPATH=driver.jar

 

but when our module tries to load the driver class, it can't be found.  

 

However, if we specify driver.jar in the Class-Path in the manifest of
argouml.jar, it works.  

 

This is odd as the class loader should be looking in the jars specified by
-cp and CLASSPATH.  Is ArgoUML  using the default class loader?

 

Thanks,

Jeff

Reply via email to