Davanum, I've created https://issues.apache.org/jira/browse/AXIS2-400 and attached a test AAR that reproduces the problem to it.

Ruchith, that's the structure I'm using. Accessing the contents of the AAR via a simple lookup from within a service works (I was wrong when I thought it didn't before - probably because I was doing it via a remote debug session). But, having the Spring library look up the contents of the AAR doesn't work.

The behaviour is as-if the Spring library was being added to the shared Axis classpath, rather than to the .AAR's classpath, but I've checked my Axis classpath and can't see Spring in it.

iksrazal, thanks for the suggestion. Another solution might be to explode the Spring jar, and put its contents as classes within the .AAR - I haven't tried that yet, though.

Cheers

Inigo

From: Ruchith Fernando <[EMAIL PROTECTED]>
Reply-To: [email protected]
To: [email protected]
Subject: Re: [Axis2-0.94] Classpath for Axis code running inside an .aar?
Date: Wed, 18 Jan 2006 22:03:30 +0600
MIME-Version: 1.0
Received: from mail.apache.org ([209.237.227.199]) by bay0-mc6-f18.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Wed, 18 Jan 2006 08:03:53 -0800
Received: (qmail 87128 invoked by uid 500); 18 Jan 2006 16:03:51 -0000
Received: (qmail 87117 invoked by uid 99); 18 Jan 2006 16:03:51 -0000
Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Jan 2006 08:03:51 -0800 Received: pass (asf.osuosl.org: domain of [EMAIL PROTECTED] designates 64.233.162.207 as permitted sender) Received: from [64.233.162.207] (HELO zproxy.gmail.com) (64.233.162.207) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Jan 2006 08:03:51 -0800 Received: by zproxy.gmail.com with SMTP id 34so1556321nzf for <[email protected]>; Wed, 18 Jan 2006 08:03:30 -0800 (PST) Received: by 10.65.253.11 with SMTP id f11mr4226486qbs; Wed, 18 Jan 2006 08:03:30 -0800 (PST)
Received: by 10.64.199.16 with HTTP; Wed, 18 Jan 2006 08:03:30 -0800 (PST)
X-Message-Info: JGTYoYF78jEHjJx36Oi8+Z3TmmkSEdPtfpLB7P/ybN8=
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Precedence: bulk
list-help: <mailto:[EMAIL PROTECTED]>
list-unsubscribe: <mailto:[EMAIL PROTECTED]>
List-Post: <mailto:[email protected]>
List-Id: <axis-user.ws.apache.org>
Delivered-To: mailing list [email protected]
X-ASF-Spam-Status: No, hits=-0.0 required=10.0tests=SPF_PASS
X-Spam-Check-By: apache.org
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Mgh9w1oFmKWVYyDnMQ5t++492x/Jc2MUYePoCWN+TxClIQp/09VJyaJnYmzDdV8bLQq1wJDF+yRZQvJxeSwBStcEKMD8gVUHUCTKEI9Qnw5XVLSHMiIs7HZK73LfGp/YXdrtN3e4o3svSVnteGlV8k8tcXB026V1zfuUlbRM8wg=
References: <[EMAIL PROTECTED]>
X-Virus-Checked: Checked by ClamAV on apache.org
Return-Path: [EMAIL PROTECTED]
X-OriginalArrivalTime: 18 Jan 2006 16:03:53.0050 (UTC) FILETIME=[C71E1BA0:01C61C48]

Hi Inigo,

Can you please try including all the libraries used by your
application in a 'lib' directory in the .aar file. (Example: spring
jars). And then all the resource files can be included in the .aar
file itself.

foo.aar
  |
 +->lib/
  |       |
  |      +->spring.jar
  |      +->xyz.jar
  |
 +->META-INF/services.xml
  |
 +->bar-config.properties
 +->bar-config1.xml
  |
 +->... **/*.class files of foo service

This is the way we support packaging a web service and its related
resources and libraries in a .aar. Please try it out and let us know
if there's a problem :-)

Thanks,
Ruchith

On 1/18/06, Inigo Surguy <[EMAIL PROTECTED]> wrote:
> 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
>
>
>


--
Ruchith


Reply via email to