Hi Robert,

Thanks for your response. I have made sure there is no other
axis2-spring*jar anywhere in the container. BTW, there is no WEB-INF
directory for me as I'm not running this within a Servlet Container (I'm
directly deploying the aar into axis2 itself). I'm directly dropping
these jars in the lib directory at the root level of the aar as shown
below.

Cheers,
        Sunesh

-----Original Message-----
From: robert lazarski [mailto:[EMAIL PROTECTED] 
Sent: 31 October 2007 18:54
To: axis-user@ws.apache.org
Subject: Re: Spring inside an AAR (Without a ServletContext)

Spring in the aar is an advanced use case, but many people have had
success by following the tutorial. Have you made sure that there are no
other spring or axis2-spring jars anywhere else in the container, ie,
you have removed the axis2-spring* jars in WEB-INF/lib?

HTH,
Robert

On 10/31/07, Sunesh Kumra <[EMAIL PROTECTED]> wrote:
>
>
> Hello,
>
> I have been struggling to get my Axis2 service (not deployed in any 
> Servlet
> Container) to work with Spring. I followed the example in 
> http://ws.apache.org/axis2/1_1/spring.html, but not much luck. Did 
> anyone get that example to work ? I had to place the spring.jar and 
> axis2-jar in the root level for the Spring initialization to even 
> proceed anywhere. After that it got stuck with the following 
> exceptions. The thing that puzzles me is that the classes that it 
> complains about are in the same jar as the classes that invoke them !!
>
> ./springExample.aar
> ./META-INF
> ./META-INF/MANIFEST.MF
> ./META-INF/services.xml
> ./applicationContext.xml
> ./lib
> ./lib/axis2-spring-SNAPSHOT.jar
> ./lib/spring.jar
> ./spring
> ./spring/MyBean.class
> ./spring/MyBeanImpl.class
> ./spring/SpringAwareService.class
> ./spring/SpringInit.class
>
>
> Cheers,
>     Sunesh
>
> The stack trace of the error is:
>
> Starting spring init
> [INFO] Refreshing
> org.springframework.context.support.ClassPathXmlApplicationCon
> [EMAIL PROTECTED]: display name
> [org.springframework.context.support.ClassPathXmlAppl
> [EMAIL PROTECTED]; startup date [Wed Oct 31 18:11:09 GMT 2007]; 
> root of co ntext hierarchy [INFO] Loading XML bean definitions from 
> class path resource [applicationContext .xml] [INFO] Bean factory for 
> application context [org.springframework.context.support
> [EMAIL PROTECTED]:
> org.springframework.beans.factory.supp
> [EMAIL PROTECTED]
> [INFO] Pre-instantiating singletons in 
> org.springframework.beans.factory.support
> [EMAIL PROTECTED]: defining beans 
> [applicationContext,reserveAm ountChargingService,myBean]; root of 
> factory hierarchy [INFO] Destroying singletons in 
> org.springframework.beans.factory.support.Defaul
> [EMAIL PROTECTED]: defining beans 
> [applicationContext,reserveAmountCha
> rgingService,myBean]; root of factory hierarchy
> org.springframework.beans.factory.CannotLoadBeanClassException:
> Error loading cl
> ass
> [org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder
> ]
> for
> bean with name 'applicationContext' defined in class path resource 
> [applicationC
> ontext.xml]: problem with class file or dependent class; nested 
> exception is jav
> a.lang.NoClassDefFoundError:
> org/springframework/context/ApplicationContextAware
>
> Caused by: java.lang.NoClassDefFoundError:
> org/springframework/context/Applicati
> onContextAware
>         at java.lang.ClassLoader.defineClass1(Native
> Method)
>         at
> java.lang.ClassLoader.defineClass(ClassLoader.java:620)
>         at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
> 4)
>         at
> java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
>         at
> java.net.URLClassLoader.access$000(URLClassLoader.java:56)
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
>         at
> java.security.AccessController.doPrivileged(Native Method)
>         at
> java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>         at
> sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>         at
> org.springframework.util.ClassUtils.forName(ClassUtils.java:201)
>         at
> org.springframework.beans.factory.support.AbstractBeanDefinition.reso
> lveBeanClass(AbstractBeanDefinition.java:327)
>         at
> org.springframework.beans.factory.support.AbstractBeanFactory.resolve
> BeanClass(AbstractBeanFactory.java:1075)
>         at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.
>
> Ericsson Services Limited
>
> Registered Office: Unit 4, Midleton Gate, Guildford Business Park, 
> Guildford, Surrey, GU2 8SG
>
> Registered Number in England and Wales: 3709800
>
> This communication is confidential and intended solely for the
addressee(s).
> Any unauthorised review, use, disclosure or distribution is 
> prohibited. If you believe this message has been sent to you in error,

> please notify the sender by replying to this transmission and delete 
> the message without disclosing it. Thank you.
>  Ericsson Services Limited does not enter into contracts or 
> contractual obligations via electronic mail, unless otherwise agreed 
> in writing between the parties concerned.
>  E-mail including attachments is susceptible to data corruption, 
> interruption, unauthorised amendment, tampering and viruses, and we 
> only send and receive e-mails on the basis that we are not liable for 
> any such corruption, interception, amendment, tampering or viruses or 
> any consequences thereof.
>
>
> ______________________________________________________________________
>  This email has been scanned by the MessageLabs Email Security System.
>  For more information please visit
> http://www.messagelabs.com/email
> ______________________________________________________________________
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to