You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Juergen Umbrich <ju...@umbrich.net> on 2006/01/25 11:28:54 UTC

[axis2] classloader poblem?

Hi

i have a poblem to load a file diectly in my .aar archive.
structure of the aar-achive
aar
 |
 |-lib/
    |-mypackage.jar
           |-properties.file
	   |-loadpoperties.java

in loadproperties i run the following command

InputStream in =
Thread.currentThread().getContextClassLoader().getResourceAsStream(properties.file);


and i get in = null as result.
as anyone an idea what happens here, and how i can solve the problem?

thx

Re: [axis2] classloader poblem?

Posted by Deepal Jayasinghe <de...@opensource.lk>.
hmmmm ,
I have reply to this mail several time , any way the right way is this
 1. if your are trying to access the resources out side the service impl 
class , then u have to get the axisService.getClassLoader() and using that 
load ur resources
 2. if you are trying to access the property inside ServiceImpl class , then 
the way is
      getClass().getClassLoader().getResourceAsStream("myResource.resourec");

Thanks,
 Deepal
................................................................
~Future is Open~

----- Original Message ----- 
From: "Juergen Umbrich" <ju...@umbrich.net>
To: <ax...@ws.apache.org>
Sent: Wednesday, January 25, 2006 4:28 PM
Subject: [axis2] classloader poblem?


>
> Hi
>
> i have a poblem to load a file diectly in my .aar archive.
> structure of the aar-achive
> aar
> |
> |-lib/
>    |-mypackage.jar
>           |-properties.file
>    |-loadpoperties.java
>
> in loadproperties i run the following command
>
> InputStream in =
> Thread.currentThread().getContextClassLoader().getResourceAsStream(properties.file);
>
>
> and i get in = null as result.
> as anyone an idea what happens here, and how i can solve the problem?
>
> thx
>