Classpath somehow different between develop and deploy?
Classpath somehow different between develop and deploy?
- Subject: Classpath somehow different between develop and deploy?
- From: Johan Henselmans <email@hidden>
- Date: Thu, 28 May 2009 00:10:44 +0200
I am having troubles, and I would like to share it with you, my fellow
WA'ers (Webobjects Anonymous). I am sure without your support I will
have serious relapses...
I have to use some third party jars that are used to make a connection
to a secure website, which is taken care of by an SSL connection with
a certificate which is stored in a java keystore. (the java keychains
that you can create with keytool). The class that uses this keystore
knows which one to use it via a file called config.properties. The jar
class that uses this data assumes the data is all available somewhere
in the classpath: it is searching for this specific information via
ClassLoader loader =
Thread.currentThread().getContextClassLoader();
Enumeration p = loader.getResources(keystoreFile);
as I found out via JD-GUI (great app!).
I thought it might be a good idea to store the the keystores and the
config file in Resources. I have added that file to the Resources too.
Then I added the Resources folder as a class folder to the Library
path of the application, so that it is available in the Java Build Path.
In Development Everything works, the keystores get loaded, the
connection is made and the whole world rejoices.
Then I install the Application, and somehow it does not work any more.
I tried to find out if the classpath that contained the configuration
and the keystores were loaded, but I did not get any messages
whatsoever about the classpath:
This is the code I tried to find out the classpath:
==================================================================
ClassLoader classLoader = ClassLoader.getSystemClassLoader();
Util.log.info("\nClassPath Follows....\n");
URL[] urls = ((URLClassLoader) classLoader).getURLs();
for (int i = 0; i < urls.length; i++) {
Util.log.info(urls[i].toString() + "\n");
}
==================================================================
and this is the output.
==================================================================
ClassPath Follows....
May 27 23:13:38 WOIdealTestApp[2002] DEBUG IdealConnector - file:/
Library/WebObjects/Applications/WOIdealTestApp.woa/WOBootstrap.jar
==================================================================
WOLips 3.4.5800
Eclipse 3.5RC2.
WebObject 5.4.3
Regards,
Johan Henselmans
http://www.netsense.nl
Tel: +31-20-6267538
Fax: +31-20-6279159
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden