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 fa...@uniserv.com on 2012/02/15 08:35:32 UTC

Axis2 and class loading

Hi,

we have Tomcat and axis2 (1.6) running. 

One of our web services needs jaxen.jar and dom4j.jar. 
The web service archive file contains these jar files within the
service's WEB-INF/lib.

Nevertheless by executing the method the web service throws the
exeception
 
org.dom4j.InvalidXPathException: Invalid XPath expression: 
'myPath'. Caused by: org/dom4j/Element ..

(The same method runninmg as a standalone application does function)

The real problem is, the dom4j classes are not found.

I've copied the dom4j.jar into axis2 WEB-INF/lib and it does function.

Now my question:
- do I have any possibility to control the axis2 classloader,
so my required jar-file (dom4j) would be found (at the right time).
- is it an axis2 issue at all, or is it the tomcat class loader?

- is there any negative side-effect if I solve the problem by copying
the dom4j into the axis2 WEB-INF/lib?

Thank you,
Fadila





---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: Axis2 and class loading

Posted by Sagara Gunathunga <sa...@gmail.com>.
On Wed, Feb 15, 2012 at 1:05 PM, <fa...@uniserv.com> wrote:

> Hi,
>
> we have Tomcat and axis2 (1.6) running.
>
> One of our web services needs jaxen.jar and dom4j.jar.
> The web service archive file contains these jar files within the
> service's WEB-INF/lib.
>

 If you use .aar archive format then you have to place your 3rd party jars
inside the 'lib" directory not WEB-INF/lib.

e.g - yourServiceArchive.aar/lib/dom4j.jar. etc.

Also if you want you can enable Axis2 child first class loading [1].

[1] -
http://amilachinthaka.blogspot.com/2009/05/axis2-child-first-class-loading.html

Thanks !



>
> Nevertheless by executing the method the web service throws the
> exeception
>
> org.dom4j.InvalidXPathException: Invalid XPath expression:
> 'myPath'. Caused by: org/dom4j/Element ..
>
> (The same method runninmg as a standalone application does function)
>
> The real problem is, the dom4j classes are not found.
>
> I've copied the dom4j.jar into axis2 WEB-INF/lib and it does function.
>
> Now my question:
> - do I have any possibility to control the axis2 classloader,
> so my required jar-file (dom4j) would be found (at the right time).
> - is it an axis2 issue at all, or is it the tomcat class loader?
>
> - is there any negative side-effect if I solve the problem by copying
> the dom4j into the axis2 WEB-INF/lib?
>
> Thank you,
> Fadila
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
> For additional commands, e-mail: java-user-help@axis.apache.org
>
>


-- 
Sagara Gunathunga

Blog      - http://ssagara.blogspot.com
Web      - http://people.apache.org/~sagara/
LinkedIn - http://www.linkedin.com/in/ssagara

RE: Axis2 and class loading

Posted by Dipesh Garg <di...@erevmax.com>.
YOU CAN RENAME THE JAR FILE starting with aa, then this jar will be loaded
first

Dipesh Garg

-----Original Message-----
From: fadila.mumbasic@uniserv.com [mailto:fadila.mumbasic@uniserv.com] 
Sent: Wednesday, February 15, 2012 1:06 PM
To: axis-user@ws.apache.org
Subject: Axis2 and class loading

Hi,

we have Tomcat and axis2 (1.6) running. 

One of our web services needs jaxen.jar and dom4j.jar. 
The web service archive file contains these jar files within the
service's WEB-INF/lib.

Nevertheless by executing the method the web service throws the
exeception
 
org.dom4j.InvalidXPathException: Invalid XPath expression: 
'myPath'. Caused by: org/dom4j/Element ..

(The same method runninmg as a standalone application does function)

The real problem is, the dom4j classes are not found.

I've copied the dom4j.jar into axis2 WEB-INF/lib and it does function.

Now my question:
- do I have any possibility to control the axis2 classloader,
so my required jar-file (dom4j) would be found (at the right time).
- is it an axis2 issue at all, or is it the tomcat class loader?

- is there any negative side-effect if I solve the problem by copying
the dom4j into the axis2 WEB-INF/lib?

Thank you,
Fadila





---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org