-
Jan 22nd, 2013, 02:43 AM
#1
Spring-WS on Websphere 8.5 NoSuchMethodError
Hello guys i hope somebody could help me with the following problem.
I have a Spring Struts2 web application, that i deploy on a websphere 8.5. i recently updated the Spring-WS libraries to version 2.1.1 and unfortunately after that the application couldnt start on websphere.
I get the following exception:
Caused by: org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [org.springframework.ws.transport.http.HttpComponen tsMessageSender]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.<init>()V
at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:162)
at org.springframework.beans.factory.support.SimpleIn stantiationStrategy.instantiate(SimpleInstantiatio nStrategy.java:87)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.instantiateBean(Abstrac tAutowireCapableBeanFactory.java:990)
... 171 more
Caused by: java.lang.NoSuchMethodError: org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.<init>()V
at org.springframework.ws.transport.http.HttpComponen tsMessageSender.<init>(HttpComponentsMessageSender .java:80)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:56)
at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:39)
at java.lang.reflect.Constructor.newInstance(Construc tor.java:527)
at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:147)
... 173 more
After a little bit of research i found out that spring-ws 2.1.1 uses a new version of the httpclient libraries and that websphere was using and old version that is packed with websphere 8.5. because of this i decided to change the classloader settings and the application is now using the libraries that are packed witht the web application but now i get a different error at start
Caused by: org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [org.springframework.ws.soap.addressing.server.Anno tationActionEndpointMapping]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: javax/xml/namespace/QName.getPrefix()Ljava/lang/String;
at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:162)
at org.springframework.beans.factory.support.SimpleIn stantiationStrategy.instantiate(SimpleInstantiatio nStrategy.java:87)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.instantiateBean(Abstrac tAutowireCapableBeanFactory.java:990)
... 112 more
Caused by: java.lang.NoSuchMethodError: javax/xml/namespace/QName.getPrefix()Ljava/lang/String;
at org.springframework.ws.soap.addressing.version.Abs tractAddressingVersion.createNormalizedExpression( AbstractAddressingVersion.java:114)
at org.springframework.ws.soap.addressing.version.Abs tractAddressingVersion.<init>(AbstractAddressingVe rsion.java:87)
at org.springframework.ws.soap.addressing.server.Abst ractAddressingEndpointMapping.initDefaultStrategie s(AbstractAddressingEndpointMapping.java:97)
at org.springframework.ws.soap.addressing.server.Abst ractAddressingEndpointMapping.<init>(AbstractAddre ssingEndpointMapping.java:88)
at org.springframework.ws.soap.addressing.server.Abst ractActionEndpointMapping.<init>(AbstractActionEnd pointMapping.java:40)
at org.springframework.ws.soap.addressing.server.Anno tationActionEndpointMapping.<init>(AnnotationActio nEndpointMapping.java:60)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:56)
at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:39)
at java.lang.reflect.Constructor.newInstance(Construc tor.java:527)
at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:147)
... 114 more
Can somebody give me a hint how to fix this?
Best Regards
Pucheteca
-
Jan 22nd, 2013, 04:36 AM
#2
Hello
Generally it's not a good idea to have JARs in your WEB-INF/lib which contain javax.xml.namespace.QName class inside. It is a real problem because many JARs contain this class - it is bad legacy from the time when QName was not a part of JRE.
I won't be amazed if some broken QName class is a part of WebSphere 8.5 - try finding a JAR with QName class both in your app and in WebSphere.
For example in WebSphere 7, QName class is in (I show only "interesting" JARS):
- dev/JavaEE/1.4/j2ee.jar
- java/jre/lib/xml.jar
- plugins/com.ibm.ws.dpmanager.jar
- profiles/<profilename>/configuration/org.eclipse.osgi/bundles/181/1/.cp/lib/xbean.jar
Probably the most problematic JAR is xml.jar... Please check your WAR also.
regards
Grzegorz Grzybek
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules