小编Anu*_*mka的帖子

无法找到XML架构命名空间(JMS)的Spring命名空间处理程序

我正在尝试构建一个可执行jar并在运行时遇到以下错误:

信息:从类路径资源加载XML bean定义[spring-app.xml]线程"main"中的异常org.springframework.beans.factory.parsing.BeanDefinitionParsingException:配置问题:无法找到XML架构命名空间的Spring NamespaceHandler [ http: //www.springframework.org/schema/jms] 违规资源:类路径资源[spring-app.xml]

我的spring-app.xml如下:

<?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"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans      
                http://www.springframework.org/schema/beans/spring-beans.xsd
                http://www.springframework.org/schema/tx 
                http://www.springframework.org/schema/tx/spring-tx.xsd
                http://www.springframework.org/schema/context
                http://www.springframework.org/schema/context/spring-context.xsd
                http://www.springframework.org/schema/jms
                http://www.springframework.org/schema/jms/spring-jms.xsd">
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> 
    <property name="locations">
        <list>
            <value>/etc/vtb/jndi.properties</value>
        </list>
    </property>
</bean>

<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
    <property name="environment">
        <props>
            <!-- prop key="java.naming.provider.url">jnp://ossprovesbjms01.gmtl.viasat.com:1099</prop-->
            <prop key="java.naming.provider.url">${java.naming.provider.url}</prop>
            <prop key="java.naming.factory.initial">${java.naming.factory.initial}</prop>
            <prop key="java.naming.factory.url.pkgs">${java.naming.factory.url.pkgs}</prop>
        </props>
    </property>
</bean>

<bean id="connectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiTemplate" ref ="jndiTemplate"/>
    <property name="jndiName" value="ConnectionFactory"/>
</bean>

<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
    <property name="connectionFactory" ref="connectionFactory"/>
    <property name="pubSubDomain" value="true"/>
    <property name="deliveryPersistent" value="true"/>
    <property name="deliveryMode" value="2"/>
</bean>
<!-- …
Run Code Online (Sandbox Code Playgroud)

java spring jms spring-jms

5
推荐指数
1
解决办法
2万
查看次数

标签 统计

java ×1

jms ×1

spring ×1

spring-jms ×1