Hey Steve,

in my services, when I load a resource using the classloaders, the classloader I have to use is different depending on whether or not the .aar is exploded or not. Additionally its worth naming your log 4j file specifically to your service, instead of having a generic "log4j.properties", as I've found it conflicts with .jar files in the WEB-INF/lib that also have the same named file in them.  E.g. my user-service would have a log4j properties file named "user-service-log4j.properties".

e.g to load resources out of .aar file/exploded file

InputStream input = AuthenticationHandler.class.getClassLoader().getResourceAsStream( "service.properties");
if ( input == null) {
    // Loading from an .aar file, so have to use parent class loader!
    input = AuthenticationHandler.class.getClassLoader().getParent().getResourceAsStream( "service.properties");
}       

cheers, let us know if it works for you, so future readers of the archive can try it out.

Ants.


[EMAIL PROTECTED] wrote:
Charitha,

Thanks for your suggestions ...

Charitha Kankanamge <[EMAIL PROTECTED]> wrote on 02/26/2008 08:01:33 PM:

  
Hi Steve,
Please have a look at [1] or [2]

|AxisService service = msgCtx.getAxisService();
||ClassLoader loader = service.getClassLoader ();
||InputSream in=loader.getResourceAsStream(“MyResources”);|

[1] "Service and Module Isolation" section of http://wso2.org/library/259
[2]http://ws.apache.org/axis2/faq.html#b1
    

Unfortunately, I've already read and re-read both of those. That's where
the the code I tried came from.
My code is different only because the examples don't specify how to get
msgCtx .
Maybe this is obvious to those experienced with Axis. Am I doing that
correctly for the
service implementation class?

- Steve


-- 

Anthony
------------------------------------- 
Anthony Bull
Senior Developer
Black Coffee Software Ltd
PO Box 10-192 The Terrace
Wellington, New Zealand
 
[EMAIL PROTECTED]
Ph  +64 4 472 8818
Fax +64 4 472 8811
------------------------------------- 
www.bcsoft.co.nz
--------------------------------------------------------------- 
This email may contain confidential or privileged information, 
and is intended for use only by the addressee, or addressees. 
If you are not the intended recipient please advise the sender 
immediately and do not copy, use or disclose the contents to 
any other person or organisation.
Black Coffee Software Ltd accepts no responsibility for viruses 
received with this email, or to any changes made to the original 
content. Any views or opinions expressed in this email may be
personal to the sender and are not necessarily those of Black 
Coffee Software Ltd.
--------------------------------------------------------------- 
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to