在Java应用程序中集成Spring(Rabbit)?

在Java应用程序中集成Spring(Rabbit)?,java,spring,spring-rabbit,hivemq,Java,Spring,Spring Rabbit,Hivemq,我正在尝试将Spring集成到HiveMQ(MQTT代理)插件中。我已经设法加载了spring上下文,实际上扫描了bean,可以使用@Inject而不是@Autowire自动连接 当我试图在这个插件中使用SpringRabbit时,Spring框架抱怨它无法正确处理我的Spring-context.xml中的xml 原因:org.xml.sax.saxpasseeption:cvc复杂类型。2.4.c: 匹配通配符是严格的,但找不到的声明 元素“兔子:连接工厂” spring上下文如下所示: &

我正在尝试将Spring集成到HiveMQ(MQTT代理)插件中。我已经设法加载了spring上下文,实际上扫描了bean,可以使用@Inject而不是@Autowire自动连接

当我试图在这个插件中使用SpringRabbit时,Spring框架抱怨它无法正确处理我的Spring-context.xml中的xml

原因:org.xml.sax.saxpasseeption:cvc复杂类型。2.4.c: 匹配通配符是严格的,但找不到的声明 元素“兔子:连接工厂”

spring上下文如下所示:

<?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:context="http://www.springframework.org/schema/context"
       xmlns:rabbit="http://www.springframework.org/schema/rabbit"
       xsi:schemaLocation = 'http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-4.0.xsd
        http://www.springframework.org/schema/rabbit
        http://www.springframework.org/schema/rabbit/spring-rabbit.xsd'>

    <context:component-scan base-package="com.acme"/>

    <rabbit:connection-factory id="connectionFactory"
                               addresses='localhost'
                               username='username'
                               password='password'
                               virtual-host='vhost'/>

</beans>
ClassLoader classLoader = this.getClass().getClassLoader();
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext();
ctx.setClassLoader(classLoader);
ctx.setConfigLocation("spring-context.xml");
ctx.refresh();
当我在没有HiveMQ插件上下文的情况下正常启动应用程序时,它可以找到所需的一切


在何处查找的任何提示?

的可能重复项不会重复,因为提供了上下文的架构位置;尝试使用
-verbose
运行JVM,看看它是否能给您提供任何线索。也许它有帮助可能的重复是不重复的,因为提供了上下文的模式位置;尝试使用
-verbose
运行JVM,看看它是否能给您提供任何线索。也许会有帮助