axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anthony Bull <anthony.b...@bcsoft.co.nz>
Subject Re: lib in .aar ignored?
Date Thu, 05 Jun 2008 22:19:41 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
What this generally means is that something in your service is loading
a class from a jar in axis2/WEB-INF/lib, and then looking for the jars
that are inside your AAR which it can't find because it loaded in the
axis2 classloader not your web service classloader.<br>
<br>
I've successfully got around this in my setup by making sure there are
no spring, jdbc drivers or other such jars in axis2/WEB-INF/lib, and I
don't follow the Spring examples on the Axis 2 site, as it doesn't work
with the relational mapping library I'm using (iBatis sqlmaps).<br>
<br>
The only time you will run in to problems with the WEB-INF/lib approach
is if you want to have multiple web services that use different
versions of jar files (as I need to) - in this case you need to have
everything encapsulated in the AAR file.&nbsp; I also found it difficult to
get multiple web services logging independently of each other when
having everything in the WEB-INF/lib folder too.<br>
<br>
David Ojeda wrote:
<blockquote cite="mid:200806041633.56318.dojeda@integra.la" type="cite">
  <pre wrap="">Hello,

I had the same problem, and eventually found the same solution as well.
The only jars that I am including within the aar are the ones that contain my 
xmlbeans files (*.xsb). Also, if I drop these xsb-jars in WEB-INF/lib I get 
some exceptions. Sorry, but I don't remember exactly which exceptions.

On Wednesday 04 June 2008 04:30:12 pm Stephen Kilburn wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">In my testing of Spring, I added to the WeatherSpringService.aar the
three
spring jars used by the service (spring-beans.jar, spring-context.jar,
spring-core.jar) in a /lib directory.  However, I get a NoClassDefFound
error using this approach.  It goes away if I drop the files into
axis2/WEB-INF/lib.

Does anyone have any advice?
_____________________________________________________________
Stephen Kilburn
GeoPraxis Inc.

Error: org.apache.axis2.deployment.DeploymentException: Error loading class
[org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder] for
bean with name 'applicationContext' defined in class path resource
[applicationContext.xml]: problem with class file or dependent class;
nested exception is java.lang.NoClassDefFoundError:
org/springframework/context/ApplicationContextAware at
org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGro
u p(ArchiveReader.java:151) at
org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.java:81)
at
org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(Deplo
y mentFileData.java:136) at
org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java
: 597) at
org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.ja
v a:144) at
org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.ja
v a:330) at
org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryList
e ner.java:227) at
org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.
j ava:131) at
org.apache.axis2.deployment.WarBasedAxisConfigurator.loadServices(WarBasedA
x isConfigurator.java:284) at
org.apache.axis2.context.ConfigurationContextFactory.createConfigurationCon
t ext(ConfigurationContextFactory.java:82) at
org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.j
a va:511) at
org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:431) at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1
1 39) at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966) at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java
: 3956) at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:
7 60) at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740) at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544) at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:831) at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:720) at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490) at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149) at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppo
r t.java:120) at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022) at
org.apache.catalina.core.StandardHost.start(StandardHost.java:736) at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014) at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at
org.apache.catalina.core.StandardService.start(StandardService.java:448) at
org.apache.catalina.core.StandardServer.start(StandardServer.java:700) at
org.apache.catalina.startup.Catalina.start(Catalina.java:552) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at
java.lang.reflect.Method.invoke(Unknown Source) at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295) at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433) Caused by:
org.apache.axis2.deployment.DeploymentException: Error loading class
[org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder] for
bean with name 'applicationContext' defined in class path resource
[applicationContext.xml]: problem with class file or dependent class;
nested exception is java.lang.NoClassDefFoundError:
org/springframework/context/ApplicationContextAware at
org.apache.axis2.deployment.ServiceGroupBuilder.populateServiceGroup(Servic
e GroupBuilder.java:106) at
org.apache.axis2.deployment.repository.util.ArchiveReader.buildServiceGroup
( ArchiveReader.java:110) at
org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGro
u p(ArchiveReader.java:144) ... 37 more Caused by:
org.apache.axis2.deployment.DeploymentException: Error loading class
[org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder] for
bean with name 'applicationContext' defined in class path resource
[applicationContext.xml]: problem with class file or dependent class;
nested exception is java.lang.NoClassDefFoundError:
org/springframework/context/ApplicationContextAware at
org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.j
a va:431) at
org.apache.axis2.deployment.ServiceGroupBuilder.populateServiceGroup(Servic
e GroupBuilder.java:101) ... 39 more Caused by:
org.apache.axis2.deployment.DeploymentException: Error loading class
[org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder] for
bean with name 'applicationContext' defined in class path resource
[applicationContext.xml]: problem with class file or dependent class;
nested exception is java.lang.NoClassDefFoundError:
org/springframework/context/ApplicationContextAware at
org.apache.axis2.deployment.ServiceBuilder.loadServiceLifeCycleClass(Servic
e Builder.java:521) at
org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.j
a va:205) ... 40 more Caused by:
org.springframework.beans.factory.CannotLoadBeanClassException: Error
loading class
[org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder] for
bean with name 'applicationContext' defined in class path resource
[applicationContext.xml]: problem with class file or dependent class;
nested exception is java.lang.NoClassDefFoundError:
org/springframework/context/ApplicationContextAware at
org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanCl
a ss(AbstractBeanFactory.java:1141) at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactor
y .predictBeanType(AbstractAutowireCapableBeanFactory.java:522) at
org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean
( AbstractBeanFactory.java:1174) at
org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean
( AbstractBeanFactory.java:754) at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preIns
t antiateSingletons(DefaultListableBeanFactory.java:422) at
org.springframework.context.support.AbstractApplicationContext.finishBeanFa
c toryInitialization(AbstractApplicationContext.java:729) at
org.springframework.context.support.AbstractApplicationContext.refresh(Abst
r actApplicationContext.java:381) at
sample.spring.service.SpringInit.startUp(SpringInit.java:64) at
org.apache.axis2.deployment.ServiceBuilder.loadServiceLifeCycleClass(Servic
e Builder.java:518) ... 41 more Caused by: java.lang.NoClassDefFoundError:
org/springframework/context/ApplicationContextAware at
java.lang.ClassLoader.defineClass1(Native Method) at
java.lang.ClassLoader.defineClass(Unknown Source) at
java.security.SecureClassLoader.defineClass(Unknown Source) at
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassL
o ader.java:1853) at
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.ja
v a:875) at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.ja
v a:1330) at java.lang.ClassLoader.loadClass(Unknown Source) at
java.lang.ClassLoader.loadClass(Unknown Source) at
java.lang.ClassLoader.loadClass(Unknown Source) at
java.lang.ClassLoader.loadClass(Unknown Source) at
org.springframework.util.ClassUtils.forName(ClassUtils.java:249) at
org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBea
n Class(AbstractBeanDefinition.java:381) at
org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanCl
a ss(AbstractBeanFactory.java:1135) ... 49 more Caused by:
java.lang.ClassNotFoundException:
org.springframework.context.ApplicationContextAware at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.ja
v a:1363) at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.ja
v a:1209) at java.lang.ClassLoader.loadClassInternal(Unknown Source) ... 62
more




---------------------------------------------------------------------
To unsubscribe, e-mail: <a class="moz-txt-link-abbreviated" href="mailto:axis-user-unsubscribe@ws.apache.org">axis-user-unsubscribe@ws.apache.org</a>
For additional commands, e-mail: <a class="moz-txt-link-abbreviated" href="mailto:axis-user-help@ws.apache.org">axis-user-help@ws.apache.org</a>
    </pre>
  </blockquote>
  <pre wrap=""><!---->


  </pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">-- 

Anthony
------------------------------------- 
Anthony Bull
Senior Developer
Black Coffee Software Ltd
PO Box 10-192 The Terrace
Wellington, New Zealand
 
<a class="moz-txt-link-abbreviated" href="mailto:anthony.bull@bcsoft.co.nz">anthony.bull@bcsoft.co.nz</a>
Ph  +64 4 472 8818
Fax +64 4 472 8811
------------------------------------- 
<a class="moz-txt-link-abbreviated" href="http://www.bcsoft.co.nz">www.bcsoft.co.nz</a>
--------------------------------------------------------------- 
This email may contain confidential or privileged information, 
and is intended for use only by the addressee, or addressees. 
If you are not the intended recipient please advise the sender 
immediately and do not copy, use or disclose the contents to 
any other person or organisation.
Black Coffee Software Ltd accepts no responsibility for viruses 
received with this email, or to any changes made to the original 
content. Any views or opinions expressed in this email may be
personal to the sender and are not necessarily those of Black 
Coffee Software Ltd.
--------------------------------------------------------------- </pre>
</body>
</html>


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


Mime
View raw message