Hi;

first its not bug in Axis2 , that is because we have concept call Service isolation , there each service get its own classloder and which is created using the archive file. So if you want to get some resources in archive file you need to get the class loader from corresponding service and then load your resources.

But in Spring case as I know you can not give that guy a class loader , what it does is it gets the context class loader and try to load resources from that. Since service has its own class loader you can not get service resources from context class loader.

In that scenario the best way is put your those resources in WEB-INF/lib in that case CCL will have access to those.



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

----- Original Message ----- From: "Inigo Surguy" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, January 18, 2006 8:55 PM
Subject: [Axis2-0.94] Classpath for Axis code running inside an .aar?


Hi,

I've deployed a .aar to Axis 2, and I'm trying to use Spring within it. However, when Spring tries to access it's applicationContext.xml file from the classpath, it doesn't work. When I try to access the classpath in my own code, using MyObject.class.getResource() or Thread.currentThread().getContextClassLoader().getResource(), I can't find the file either; and when I check the classloader roots of the current context classloader, it only shows Tomcat 5.5\webapps\axis2_094\WEB-INF\classes - and not the .aar itself.

When I move my applicationContext.xml to the Axis WEB-INF/classes directory, then Spring can find it, which is consistent with the behaviour above. However, it then can't load any of my application classes - presumably because they're not on the classpath available to my application.

I can presumably solve this by moving all of my code into the Axis WEB-INF/lib directory - but this defeats the point of having an .aar!

What am I doing wrong, please? How can I get the contents of the .aar onto the classpath of classes within that .aar?

(I'm running Axis 0.94 inside Tomcat 5.5.12 on Windows XP with JDK 1.5)

Cheers

Inigo





Reply via email to