在linux环境里用resin部署spring项目配置文件加载报错,搞了一天没搞定,请高人指点
项目比较乱,有spring2,也有spring3的jar包,在web.xml文件里加载了spring相关配置文件,但用resin跑死活就是报初始化异常,web.xml代码如下:
HTML code
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring-servlet.xml,classpath*:cfg/*.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
报的异常信息如下:
Initializing Spring root WebApplicationContext
2011-09-01 18:20:38,805 [http--9800-0$9889177] [com.pica.common.helper.SpringHelper] [INFO] - holded applicationContext,displayName:Root WebApplicationContext
[18:20:39.159] {http--9800-0$9889177} WebApp[http://localhost:9800] Initializing Spring FrameworkServlet 'spring'
2011-09-01 18:20:39,234 [http--9800-0$9889177] [org.springframework.web.servlet.DispatcherServlet] [ERROR] - Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/spring-servlet.xml];
nested exception is java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.getBeanDefinitionDefaults()Lorg/springframework/beans/factory/support/BeanDefinitionDefaults;
Caused by: java.lang.
NoSuchMethodError: org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.getBeanDefinitionDefaults()Lorg/springframework/beans/factory/support/BeanDefinitionDefaults;
at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.configureScanner(ComponentScanBeanDefinitionParser.java:101)
at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:83)
at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1114)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1104)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:133)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:90)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:458)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:353)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefiniti