spring - cvc-complex-type.2.4.c : The matching wildcard is strict, 但找不到元素 'jms:listener-container' 的声明

标签 spring

将我的应用程序部署到 glassfish 3.1 服务器时出现以下错误,

加载应用程序时出现异常:

java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 20 in XML document from ServletContext resource [/WEB-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'jms:listener-container'..
Please see server.log for more details.

最佳答案

  • 你的问题读起来很痛苦。当您想获得帮助时,请努力让自己理解。
  • 您的 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 , 等等。

    关于spring - cvc-complex-type.2.4.c : The matching wildcard is strict, 但找不到元素 'jms:listener-container' 的声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17487770/

    相关文章:

    java - 尝试连接到 https Web 服务时出现 "Received fatal alert: handshake_failure"

    java - 将 GAE 可扩展性移植到开源框架的最简单方法

    java - Spring @Inject 不工作

    java - 为什么 Hibernate 在使用 IDENTITY 标识符生成器时禁用 INSERT 批处理

    java - 寻求意见 : architectural blueprints for instance level security

    java - Spring/JPA 中的实体更新选项

    java - 将 Gradle 属性添加到 application.properties 资源

    java - 编码问题 - 我认为 UTF-8 被视为 ISO-8859-1

    java - 双代理接口(interface) : Could not generate CGLIB subclass of class 时 Spring AspectJ 失败

    java - 为什么我注入(inject)相同的bean,但实际上注入(inject)了不同的类?