SolConnectionFactory stuck on javax

rothek Member Posts: 7
edited March 2023 in Connectors & Integrations #1


I'm trying to migrate my project from Java 11 to Java 17 while also updating to Spring Boot 3.

The depencies I use for this solace-jms-spring-boot starter and autoconfigure, both on v 4.3.0. My problem is that the DefaultJmsListenerContainerFactory requires a ConnectionFactory that extends Jakarta ConnectionFactory, but the SolConnectionFactory is javax. I get the SolConnectionFactory from the dependency "com.solacesystems:sol-jms:10.18.0" which seems to be the latest but still uses javax.

public class JmsConfiguration {
    public DefaultJmsListenerContainerFactory jmsConnectionFactory(
        boolean autoStart,
        SolConnectionFactory connectionFactory) {


        var factory = new DefaultJmsListenerContainerFactory();
        factory.setConnectionFactory(connectionFactory);//<-- Problem is here

        return factory;

Is there a new version for SolConnectionFactory that uses jakarta or any workaround to get this working?


  • marc
    marc Member, Administrator, Moderator, Employee Posts: 923 admin
    edited March 2023 #2

    Hi @rothek,

    We are working on a permanent solution, but you can find our temporary work around here: Please read the disclaimer.

    Hope that helps!

  • dud
    dud Member Posts: 2
    Hi @marc ,

    Any progress since your last comment?
    Is there any concrete plan for a permanent solution for SolConnectionFactory that uses jakarta?
  • dud
    dud Member Posts: 2
    ok, i already saw this is available via
    thanks :smile:
  • naguedara
    naguedara Member Posts: 1
    edited August 2023 #5

    Hi Team,

    i am new to solace system, as part of project requirement i want to migrate from javax.jms.ConnectionFactory to jakarta.jms.ConnectionFactory it means Springboot 2 to Springboot3. while searching in community forums found this url suits to me.

    could anyone please help me how to run the above git project to test locally.

    Here i require two things help.

    1. while running application getting below error

    Parameter 0 of method cFactory in com.example.demo.ConsumerConfiguration required a bean of type 'jakarta.jms.ConnectionFactory' that could not be found.

    package com.example.demo;

    import java.util.Iterator;
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.beans.factory.annotation.Value;
    import org.springframework.boot.CommandLineRunner;
    import org.springframework.boot.SpringApplication;
    import org.springframework.boot.autoconfigure.SpringBootApplication;
    import org.springframework.jms.annotation.JmsListener;
    import org.springframework.jms.core.JmsTemplate;
    import org.springframework.messaging.Message;
    import org.springframework.messaging.MessageHeaders;
    import org.springframework.stereotype.Component;
    import org.springframework.stereotype.Service;

    public class DemoApplication {

    public static void main(String[] args) {, args);

    static class MessageProducer implements CommandLineRunner {

    private static final Logger logger = LoggerFactory.getLogger(MessageProducer.class);

    private JmsTemplate jmsTemplate;

    // Examples of other options to get JmsTemplate in a cloud environment with possibly multiple providers available:
    // Use this to access JmsTemplate of the first service found or look up a specific one by
    // SolaceServiceCredentials
    // @Autowired private SpringSolJmsConnectionFactoryCloudFactory springSolJmsConnectionFactoryCloudFactory;
    // @Autowired private SolaceServiceCredentials solaceServiceCredentials;
    // For backwards compatibility:
    // @Autowired(required=false) private SolaceMessagingInfo solaceMessagingInfo;

    private String queueName;

    public void run(String... strings) throws Exception {
    String msg = "Hello World";"============= Sending " + msg);
    this.jmsTemplate.convertAndSend(queueName, msg);"Producer produces the message");

    static class MessageHandler {

    private static final Logger logger = LoggerFactory.getLogger(MessageHandler.class);

    // Retrieve the name of the queue from the file
    @JmsListener(destination = "${solace.jms.demoQueueName}", containerFactory = "cFactory", concurrency = "2")
    public void processMsg(Message<?> msg) {
    StringBuffer msgAsStr = new StringBuffer("============= Received \nHeaders:");
    MessageHeaders hdrs = msg.getHeaders();
    msgAsStr.append("\nUUID: "+hdrs.getId());
    msgAsStr.append("\nTimestamp: "+hdrs.getTimestamp());
    Iterator<String> keyIter = hdrs.keySet().iterator();
    while (keyIter.hasNext()) {
    String key =;
    msgAsStr.append("\n"+key+": "+hdrs.get(key));
    msgAsStr.append("\nPayload: "+msg.getPayload());;


    package com.example.demo;


    import jakarta.jms.ConnectionFactory;

    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.context.annotation.Bean;
    import org.springframework.context.annotation.Configuration;
    import org.springframework.jms.annotation.EnableJms;
    import org.springframework.jms.config.DefaultJmsListenerContainerFactory;
    import org.springframework.stereotype.Service;
    import org.springframework.util.ErrorHandler;

    public class ConsumerConfiguration {

    private static final Logger logger = LoggerFactory.getLogger(ConsumerConfiguration.class);

    // Example configuration of the ConnectionFactory: we instantiate it here ourselves and set an error handler
    public DefaultJmsListenerContainerFactory cFactory(ConnectionFactory connectionFactory, DemoErrorHandler errorHandler) {
    DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory();
    return factory;

    public class DemoErrorHandler implements ErrorHandler{

    public void handleError(Throwable t) {
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    PrintStream ps = new PrintStream(os);
    try {
    String output = os.toString("UTF8");
    logger.error("============= Error processing message: " + t.getMessage()+"\n"+output);
    } catch (UnsupportedEncodingException e) {
    // TODO Auto-generated catch block



    2. Using this below properties in but i could not able to test publisher and consumer messages.



  • alexivan
    alexivan Member Posts: 1
    Hello everyone. Any update on the SolConnectionFactory migration to jakarta.jms?