You should use one of oracle.jakarta.jms.AQjmsFactory.getConnectionFactory methods. It returns instance of jakarta.jms.ConnectionFactory