无法找到XML架构命名空间的Spring NamespaceHandler [http://camel.apache.org/schema/spring]

时间:2013-09-23 06:53:38

标签: java xml spring spring-mvc

当我尝试在命令提示符中执行代码java -cp testThermalMap.jar ActivemqPackage.ActiveMqConsumer时,我不断收到此错误

  

org.springframework.beans.factory.parsing.BeanDefinitionParsingException:配置问题:无法找到XML模式名称的Spring NamespaceHandler [http://camel.apache.org/schema/spring]

正如this link说我检查了我的jar文件,但我看到camel-spring-2.10.3.jar就在那里。任何人都可以告诉我这个错误的其他可能方法是什么?

注意:相同的代码在eclipse中工作正常。

编辑: mytest.xml的内容是

<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="
      http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
      http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
      http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core-5.5.0.xsd
      http://camel.apache.org/schema/spring"
    >
<!-- setup JMS connection factory -->
<bean id="poolConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory" init-method="start" destroy-method="stop">
    <property name="maxConnections" value="8"/>
    <property name="connectionFactory" ref="jmsConnectionFactory"/>
</bean>

<bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="tcp://localhost:61616?jms.prefetchPolicy.queuePrefetch=1" />
</bean>

<!-- setup spring jms TX manager -->
<bean id="jmsTransactionManager" class="org.springframework.jms.connection.JmsTransactionManager">
        <property name="connectionFactory" ref="poolConnectionFactory"/>
</bean>

<camelContext id="activeContext" xmlns="http://camel.apache.org/schema/spring">
    <routeBuilder ref="activeMQRouter" />
</camelContext>

<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
    <property name="connectionFactory" ref="poolConnectionFactory"/>
    <property name="transacted" value="true"/>
    <property name="transactionManager" ref="jmsTransactionManager"/>
</bean>

<bean id="activeMQRouter" class="ActivemqPackage.ActiveMQRouterBuilder"/>

<bean id="activemqProcessor" class="ActivemqPackage.ActiveMQProcessor"/>

0 个答案:

没有答案