我正在开发一个 web 应用程序(Spring MVC 4.1.6),我想在 weblogic 中部署该应用程序(war 文件)并对其进行测试。我以前用过 Tomcat,它工作正常。但是当我尝试在 weblogic 中部署时,出现如下错误:
<Error> <org.springframework.web.servlet.DispatcherServlet> <BEA-000000> `<Context initialization failedorg.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/spring-dispatcher-servlet.xml]; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.MutablePropertyValues.add(Ljava/lang/String;Ljava/lang/Object;)Lorg/springframework/beans/MutablePropertyValues;`
我环顾四周,发现我需要在我的 weblogic.xml 中添加以下内容,但没有帮助。
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
我也尝试在 weblogic.xml 中添加它,这也没有帮助。
<container-descriptor>
<prefer-web-inf-classes>false</prefer-web-inf-classes>
</container-descriptor>
<container-descriptor>
<prefer-application-packages>
<package-name>org.springframework.*</package-name>
</prefer-application-packages>
</container-descriptor>
我是否可以强制 weblogic 使用我的 webapp 中的 Spring 库。我还查看了 weblogic 的 lib 文件夹(想删除 spring 库),但没有找到任何 Spring 库,可能是我没有看对地方。
谢谢。
最佳答案
感觉好难受。我的 weblogic.xml 的位置不正确。一旦我将文件放在 WEB-INF 中,它现在就可以工作了。再次感谢您的帮助。
关于spring - 在 weblogic 10.3.6 中部署 Spring 4.1.6 mvc webapp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30337841/