Search code examples
spring-bootdependenciesspring-jms

JmsTemplate bean missing in springboot 3


After changing my springboot version from 2.7.5 to 3.0.6 I am getting this error

Description:

Parameter 0 of constructor in com....JmsNotifier required a bean of type 'org.springframework.jms.core.JmsTemplate' that could not be found.

The injection point has the following annotations:
  - @org.springframework.beans.factory.annotation.Autowired(required=true)


Action:

Consider defining a bean of type 'org.springframework.jms.core.JmsTemplate' in your configuration.

I am getting this error from this service class which works properly in springboot version 2.7.5

@Service
public class JmsNotifier {

    @Autowired
    private JmsTemplate jmsTemplate;
    
   //

}

Here is the dependency

    implementation 'org.springframework.boot:spring-boot-starter-activemq:3.1.0'

Am I missing any additional dependencies?


Solution

  • Apache ActiveMQ "Classic" support is removed from Spring Boot 3.0.0. So we need to use this dependency instead:

        implementation 'org.springframework.boot:spring-boot-starter-artemis'