cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niclas Hedhman <>
Subject Re: [osgi] Component management
Date Tue, 05 Jul 2005 16:20:11 GMT
On Tuesday 05 July 2005 23:15, Daniel Fagerstrom wrote:

<snip />

I have nothing much to add to all your comments, other than I agree with every 
bit you mention.

> That is a limiting factor ;), anyway its great to beeing able discuss
> OSGi and component management with someone who allready has experience
> in the field.

I don't feel I have any experience. I am probablty pretty much at the same 
stage as you, Daniel. Reading the spec up and down, 4 times a day, trying to 
work out how some small detail is supposed to work.

Right now I am struggling with getting my "artifact:" protocol to work 
together with classloaders inside the OSGi platform.


I can do;
  URL url = new URL( "artifact:jar:log4j/log4j#1.2.8" );
  InputStream in = url.openStream();
  ....; ...

with out problems, but if I do
  URL url = new URL( "artifact:jar:log4j/log4j#1.2.8" );
  URL[] urls = new URL[] { url };
  ClassLoader parent = getClass().getClassLoader();
  URLClassLoader ucl = new URLClassLoader( urls, parent );
  Class cls = ucl.loadClass( "org.apache.log4j.Logger" );

I will get a ClassNotFoundException. (Same goes for any getResourceAsStream() 

All of the above in Knopflerfish.

I am starting to think that the Classloading mechanism doesn't not go through 
the registered URLStreamHandlerFactory that OSGi put in place.
In any event, this detail have already taken 2 days and a lo of frustration 


View raw message