You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Pete Haidinyak <ja...@cox.net> on 2009/04/09 07:02:56 UTC

Thread context class loader question

Hi,
	In the application I am porting to OSGi I created my own URL Classloader  
to setup a classpath based on which service I was trying to launch. This  
was modeled after how JBoss use to do their classloading to launch  
different servers. Anyway, OSGi ignores my Classloader's classpath so I  
couldn't load any resources etc. To get around this I am setting the  
Thread that starts Felix Context Classloader with my custom classloader  
and using that to load resources, etc.
	My question is am I really doing something stupid that is going to bit me  
in the ass later on  and if so what would be a better way to load various  
resources (configuration file, images, resource bundles, SQL scripts, etc)?

Thanks again for your help

-Pete


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Thread context class loader question

Posted by "Richard S. Hall" <he...@ungoverned.org>.
I don't really understand your scenario, but are you looking into some 
quick hack to port your application in the short term or is this your 
strategy long term?

Class loader tricks to launch servers sounds like a bad idea in general. 
Typically you do these sorts of things when you are not using OSGi. With 
OSGi, you should let it do the work for you. If all goes well, you won't 
have to mess with class loaders again.

-> richard

On 4/9/09 1:02 AM, Pete Haidinyak wrote:
> Hi,
>     In the application I am porting to OSGi I created my own URL 
> Classloader to setup a classpath based on which service I was trying 
> to launch. This was modeled after how JBoss use to do their 
> classloading to launch different servers. Anyway, OSGi ignores my 
> Classloader's classpath so I couldn't load any resources etc. To get 
> around this I am setting the Thread that starts Felix Context 
> Classloader with my custom classloader and using that to load 
> resources, etc.
>     My question is am I really doing something stupid that is going to 
> bit me in the ass later on  and if so what would be a better way to 
> load various resources (configuration file, images, resource bundles, 
> SQL scripts, etc)?
>
> Thanks again for your help
>
> -Pete
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org