try:

foreign.class.getClassLoader().getResource(name)

regards,

Karl

2010/4/15  <[email protected]>:
>
>    I have a problem which I'm not even sure how to start explaining. I'm 
> porting an application called hop to felix. this application is running fine 
> stand alone (e.g., java -jar
> hop.jar), but within felix I have problems with the mentioned method.
>
>    hop uses ClassLoader.getSystemResourse() for testing existence of and 
> loading files from the .jar archive which are not java classes. for instance:
>
>   public static boolean exists( String name ) {
>      return java.lang.ClassLoader.getSystemResource( name ) != null;
>   }
>
>    as I said this works fine while standalone, but not under felix. I even 
> changed that to:
>
>   public static boolean exists( String name ) {
>      return foreign.class.getClassLoader().getSystemResource( name ) != null;
>   }
>
>    where foreign is a class already loaded. I'm not sure if felix uses it's 
> own ClassLoader or not, so that code aims to catch that possibility. at the 
> same time, I'm not a java
> expert, so probably this does not address properly the problem. in any case, 
> this change doesn't work either, and I'm not sure how to continue.
>
> --
> Lic. Marcos Dione
> Engineer Expert - Hop Project
> http://hop.inria.fr/
> INRIA Sophia Antipolis - Méditerranée
> Phone: +33 (0)4 92 38 79 67
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>



-- 
Karl Pauls
[email protected]

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to