JmsMessagingTemplate问题(Spring boot 1.2.5发布)

时间:2015-11-11 03:39:48

标签: java spring maven spring-boot

当我在调试或运行模式下使用 IntelliJ IDEA 启动Spring启动时,运行正常,但是当我在cmd中输入以下命令时:

  

C:\用户\管理员> gradle build

然后我得到一个可运行的jar,例如: abc.jar ,然后我用以下命令运行jar:

  

java -jar abc.jar

我遇到了这些问题

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginController': Injection of autowired dependencies failed;    nested exception is org.springframework.beans.factory.BeanCreationException:   Could not autowire field: private cn.vamos.reg.service.PushService cn.vamos.reg.controller.LoginController.pushService;   nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pushService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.jms.core.JmsMessagingTemplate cn.vamos.reg.service.PushServiceImpl.jmsMessagingTemplate;nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.jms.core.JmsMessagingTemplate] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1210)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)

这是Pom文件

 <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.2.5.RELEASE</version>
</parent>
<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <start-class>cn.vamos.VmsApplication</start-class>
    <tomcat.version>8.0.23</tomcat.version>
    <blazeds.version>4.7.0</blazeds.version>
    <activemq.version>5.11.1</activemq.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>
    <dependency>
        <groupId>com.oracle.weblogic</groupId>
        <artifactId>ojdbc7</artifactId>
        <version>12.1.0.2.0</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-thymeleaf</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <!-- spring-flex -->
    <dependency>
        <groupId>org.springframework.flex</groupId>
        <artifactId>spring-flex-core</artifactId>
        <version>1.6.0.RC1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.flex.blazeds</groupId>
        <artifactId>flex-messaging-core</artifactId>
        <version>${blazeds.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.flex.blazeds</groupId>
        <artifactId>flex-messaging-common</artifactId>
        <version>${blazeds.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.flex.blazeds</groupId>
        <artifactId>flex-messaging-proxy</artifactId>
        <version>${blazeds.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.flex.blazeds</groupId>
        <artifactId>flex-messaging-remoting</artifactId>
        <version>${blazeds.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jms</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.activemq</groupId>
        <artifactId>activemq-broker</artifactId>
        <version>${activemq.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.activemq</groupId>
        <artifactId>activemq-mqtt</artifactId>
        <version>${activemq.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.activemq</groupId>
        <artifactId>activemq-amqp</artifactId>
        <version>${activemq.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.activemq</groupId>
        <artifactId>activemq-stomp</artifactId>
        <version>${activemq.version}</version>
    </dependency>


</dependencies>

0 个答案:

没有答案