Reputation: 1545
I am new to java.I am working on spring boot samples example
I am trying to do spring-boot-sample-activemq. My pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<!-- <groupId>org.springframework.boot</groupId> -->
<!-- <artifactId>spring-boot-samples</artifactId> -->
<!-- <version>2.0.0.BUILD-SNAPSHOT</version> -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.6.RELEASE</version>
</parent>
<groupId>sample.activemq</groupId>
<artifactId>spring-boot-sample-activemq</artifactId>
<!-- <version>0.0.1-SNAPSHOT</version> -->
<name>Spring Boot ActiveMQ Sample</name>
<dependencies>
<!-- Compile -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-activemq</artifactId>
</dependency>
<!-- Test -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
I am getting an error in the below java class(ActiveMQQueue cannot be resolved to a type)
src/main/java/sample/activemq/SampleActiveMQApplication.java
package sample.activemq;
import java.util.Queue;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.jms.annotation.EnableJms;
@SpringBootApplication
@EnableJms
public class SampleActiveMQApplication {
@Bean
public Queue queue() {
return new ActiveMQQueue("sample.queue");
}
public static void main(String[] args) {
SpringApplication.run(SampleActiveMQApplication.class, args);
}
}
Two more classes are there which is exactly same as in Consumer and Producer classes
Upvotes: 0
Views: 1275
Reputation: 1
Or you can use this in your pom.xml
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>5.1.3.RELEASE</version>
</dependency>
Upvotes: 0
Reputation: 1545
Finally I resolved my issue
Run mvn dependency:purge-local-repository to remove all dependencies and force a re-download.
Upvotes: 1