This is the biggest headache with Axis2.  Typically the only time you have
to worry about the ClassLoader is when your classes need access to
resources.   If your jars do this and don't provide methods for passing a
ClassLoader or don't provide a way to pass the resource, then you are forced
to put that jar in the WEB-INF/lib directory.

Chad

On 10/16/07, Kahler, Jason J (US SSA) <[EMAIL PROTECTED]> wrote:
>
>  Thanks Chad.
>
>
>
> I would prefer to have my services entirely contained in the aar file.
>
> The problem is that my service Impl is in jar A and uses jar B.
>
> The code in jar B knows nothing about MessageContext or the Web Service
> for that matter.
>
> So if I load the top level class from jar B using
> MessageContext.getCurrentMessageContext
> ().getAxisService().getClassLoader();
>
> Will all the subsequently loaded classes be able to grab everything they
> need form the aar file ?
>
>
>
> Sorry I am so dense, but these issues are new to me.
>
>
>
> Thanks;
>
> Jay
>
>
>  ------------------------------
>
> *From:* Chad DeBauch [mailto:[EMAIL PROTECTED]
> *Sent:* Monday, October 15, 2007 9:48 PM
> *To:* Kahler, Jason J (US SSA); [email protected]
> *Subject:* Re: axis question revisited
>
>
>
> The easiest way I have found to get past this issue temporarily, or if you
> don't care about having your web services be modular, you can dump your jars
> in the WEB-INF/lib directory.  This way you don't have to worry about the
> ClassLoader.  If you don't want to take that approach here is how you get
> the ClassLoader from the aar:
>
> MessageContext.getCurrentMessageContext
> ().getAxisService().getClassLoader();
>
> Depending on what application server you are deploying your app to, the
> app server may load jars before they load the ones in your app, causing
> ClassNotFound or MethodNotFound Excpetions.
>
> Chad
>
> On 10/15/07, *Kahler, Jason J (US SSA)* <[EMAIL PROTECTED]>
> wrote:
>
> Can you give an example ?
>
>
>
>
>
> The jars in your lib aar directory will be loaded in a separate
> classloader.  So you must reference those classes using that classloader.
> You can do this by getting the MessageContext.
>
> Chad
>
> On 10/12/07, *Kahler, Jason J (US SSA)* <[EMAIL PROTECTED]>
> wrote:
>
> I am building my aar using the maven2 pluggin. Everything builds but when
> I deploy I get NoClassDefFound
> ERRORS all over. This was working as a war in tomcat using axis 1. All the
> required jars are in
>
>
>
> myArr.arr/lib what could be wrong ?
>
>
>
> Jay
>
>
>
>
>

Reply via email to