|incorrect URL from thread.getContextClassLoader().getResource() [message #109337]
||Fri, 09 May 2008 12:01
Originally posted by: rgokulakrishnan.novell.com|
We using Equinox for our application. One of the third party jars used in
this application, requires the JAR file name for its self integrity test.
It obtains the JAR file name using the following code pattern:
Thread thread = Thread.currentThread();
URL url = thread.getContextClassLoader().getResource(someClass.class);
The above code when run outside OSGi environment, gives url resembling
jar:file:/<location of jar file>/someJar.jar!/someClass.class
On running the same code in OSGi, we get URL resembling following output:
where 18 is bundle id.
The 3rd party JAR file has been included in the same bundle using
How can we get the location of JAR file in OSGi environment?
Thanks in advance
Powered by FUDForum
. Page generated in 0.01264 seconds