I have been given a factory to connect to a Solace queue.
I am using this dependency, within a spring-boot 2.7.7 application :
<dependency>
<groupId>com.solace.spring.boot</groupId>
<artifactId>solace-jms-spring-boot-starter</artifactId>
<version>4.3.0</version>
</dependency>
And so, I create this bean:
@Bean
public JndiObjectFactoryBean connectionFactory(JndiTemplate jndiTemplate) {
JndiObjectFactoryBean connectionFactory = new JndiObjectFactoryBean();
connectionFactory.setJndiTemplate(jndiTemplate);
connectionFactory.setJndiName(jndiName);
return connectionFactory;
}
But I get:
ClassNotFoundException : JMSContext
The reason is, solace-jms-spring-boot-starter:4.3.0 includes geronimo-jms_1.1_spec and JMSContext was added in JMS 2.0.
If add javax.jms.javax.jms-api, then it starts up, sometimes, as there are two versions of JMS in the same scope.
How should I create a JndiObjectFactoryBean with a jndiName? (without having repeated classes with different versions)