我正在尝试将 Spring 3.0.6 库设置为 JBoss 7 中的模块。
我有 modules/org/springframework/main 中的所有 jar 以及以下 module.xml
<module xmlns:"urn:jboss:module:1.0" name="org.springframework">
<resources>
<resource-root path="org.springframework.beans-3.0.6.RELEASE.jar"/>
...
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.servlet.api"/>
<module name="org.apache.commons.logging"/>
</dependencies>
</module>
我添加org.springframework
到 MANIFEST.MF 的 Dependencies 行
当我部署应用程序时,在解析我的文件时引发以下异常spring-servlet.xml
(对不起,这是来自未联网的系统)
SAXParseException: ... Cannot find the declaration of element 'beans'
我的第一个想法是该模块没有被使用,但是如果我org.springframework
从我的 Dependencies 行中删除它就找不到org.springframework.web.context.ContextLoaderListener
如果我将罐子放在 WEB-INF/lib 中而不是使用模块,一切都会正常工作。
spring-servlet.xml
包含以下架构参考
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
所以我放在spring-beans-3.0.xsd
同一个目录中spring-servlet.xml
并将xml修改为
http://www.springframework.org/schema/beans spring-beans-3.0.xsd
但仍然没有运气。
有人知道为什么找到类文件但找不到xsd文件吗?