[Spring Integration] - Re: Unabled to return specified bean factory in web applicat
by ivanyuan
Marius,
Yes, it is the class-loader version problem. I put all spring jars into default/lib, but still run into exceptions. Here are what I did.
The spring deployer contained the following jars:
| jboss-spring-jdk5.jar
| spring-aop.jar
| spring-beans.jar
| spring-context.jar
| spring-core.jar
|
And I moved spring-*.jar files (except jboss-spring-jdk5.jar) to default/lib, and also removed all spring jar files away from my web application archive test-spring-web-service.war. I got the following exception during deploying my test web application:
| [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/test-spring-web-service]] Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
|
| java.lang.NoSuchMethodError: org.springframework.core.CollectionFactory.createConcurrentMapIfPossible(I)Ljava/util/Map;
|
| at org.springframework.web.context.ContextLoader.<clinit>(ContextLoader.java:153)
|
| at org.springframework.web.context.ContextLoaderListener.createContextLoader(ContextLoaderListener.java:53)
|
| at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:44)
|
| at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3856)
|
| at org.apache.catalina.core.StandardContext.start(StandardContext.java:4361)
|
I am using CXF in my web service, and thought it might be spring version was too lower, then I replaced the spring jars in default/lib with spring 2.5.5 version. Then I got the following exception during deploying my spring archive:
| META-INF/jboss-spring.xml]; nested exception is java.lang.NoSuchMethodError: org.jboss.spring.factory.NamedXmlBeanDefinitionReader.createReaderContext(Lorg/springframework/core/io/Resource;)Lorg/springframework/beans/factory/support/ReaderContext;; - nested throwable: (org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from URL [jar:file:/C:/jboss-4.2.2.GA/server/default/tmp/deploy/tmp5661233983148309170MySpringBean.spring!/META-INF/jboss-spring.xml]; nested exception is java.lang.NoSuchMethodError: org.jboss.spring.factory.NamedXmlBeanDefinitionReader.createReaderContext(Lorg/springframework/core/io/Resource;)Lorg/springframework/beans/factory/support/ReaderContext;)
|
| at org.jboss.spring.deployment.SpringDeployer.create(SpringDeployer.java:120)
|
| at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
|
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
|
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
|
| at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
|
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
|
| at java.lang.reflect.Method.invoke(Method.java:585)
|
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
|
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
|
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
|
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
|
Based on my tests, it seems that the spring deployer (2.x) only work with certain versions (older versions) of spring. I need to use spring 2.5.5. How can I solve the exceptions? Which version of spring deployer should I use?
Thanks a lot!
Ivan Yuan
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4266802#4266802
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4266802
14 years, 11 months