cvc-complex-type.2.4.c:匹配通配符是严格的,但是对元素'jms:listener-container'没有声明。
问题描述:
我在将应用程序部署到glassfish 3.1服务器时出现以下错误,cvc-complex-type.2.4.c:匹配通配符是严格的,但是对元素'jms:listener-container'没有声明。
异常而加载的应用程序:
java.lang.IllegalStateException:ContainerBase.addChild:启动:org.apache.catalina.LifecycleException:org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:20号线在来自ServletContext资源的XML文档中[/WEB-INF/applicationContext.xml]无效;嵌套异常是org.xml.sax.SAXParseException:cvc-complex-type.2.4.c:匹配的通配符是严格的,但是对于元素'jms:listener-container'没有声明。
请参阅服务器。记录更多细节。
答
你的问题是一个痛苦的阅读。当你想获得帮助时,尽量让自己明白。
您的
applicationContexnt.xml
文件可能未命中JMS名称空间声明(请参阅Spring JMS documentation)。
从Spring文档,XML文件头必须至少(注意JMS部分):
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jms="http://www.springframework.org/schema/jms"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-2.5.xsd">
<!-- <bean/> definitions here -->
</beans>
你可能有其他的命名空间声明,例如aop
,util
,context
等
非常感谢Guillaume。 – user2094445
不客气。不要忘记将答案标记为已接受:) –