axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sunesh Kumra" <Sunesh.Ku...@ericssonservices.co.uk>
Subject Spring inside an AAR (Without a ServletContext)
Date Wed, 31 Oct 2007 18:44:39 GMT
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
text@17e4dee <mailto:text@17e4dee> : display name
[org.springframework.context.support.ClassPathXmlAppl
icationContext@17e4dee <mailto:icationContext@17e4dee> ]; 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
.ClassPathXmlApplicationContext@17e4dee
<mailto:.ClassPathXmlApplicationContext@17e4dee> ]:
org.springframework.beans.factory.supp
ort.DefaultListableBeanFactory@df83e5
<mailto:ort.DefaultListableBeanFactory@df83e5> 
[INFO] Pre-instantiating singletons in
org.springframework.beans.factory.support
.DefaultListableBeanFactory@df83e5
<mailto:.DefaultListableBeanFactory@df83e5> : defining beans
[applicationContext,reserveAm
ountChargingService,myBean]; root of factory hierarchy
[INFO] Destroying singletons in
org.springframework.beans.factory.support.Defaul
tListableBeanFactory@df83e5 <mailto:tListableBeanFactory@df83e5> :
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 
______________________________________________________________________
Mime
View raw message