0

I am migrating my jboss from 4.0.5 to Wildfly9,

Technology : Wildfly 9 My application is deployed on localhost

But when I try to create connection using following code,

import java.util.Map;

import org.hornetq.api.core.TransportConfiguration;
import org.hornetq.api.jms.HornetQJMSClient;
import org.hornetq.api.jms.JMSFactoryType;
import org.hornetq.core.remoting.impl.netty.NettyConnectorFactory;
import org.hornetq.jms.client.HornetQConnectionFactory;


Map<String, Object> connectionParams = new HashMap<String, Object>();
        connectionParams.put("port", "5445");
        connectionParams.put("host", "localhost");

        TransportConfiguration transportConfiguration = new TransportConfiguration(NettyConnectorFactory.class.getName(), connectionParams);
        //
        HornetQConnectionFactory connectionFactory = HornetQJMSClient.createConnectionFactoryWithoutHA(JMSFactoryType.CF, transportConfiguration);
        try {
            connectionFactory.createConnection();
        } catch (JMSException e) {
            e.printStackTrace();
        }

I am getting following exceptions.

javax.jms.JMSException: Failed to create session factory
    at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:673)
    at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:112)
    at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:107)
    at Demo.main(Demo.java:176)
Caused by: HornetQNotConnectedException[errorType=NOT_CONNECTED message=HQ119007: Cannot connect to server(s). Tried with all available servers.]
    at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:905)
    at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:669)
    ... 3 more

I am not sure Why this is happening

I also read the document

Let me know if anyone face this issue earlier.

Thanks in advance.

Sevan
  • 669
  • 1
  • 5
  • 18
Alpesh Jikadra
  • 1,692
  • 3
  • 18
  • 38

0 Answers0