Skip to Content
avatar image
Former Member

Hosts not set in QueueConnectionFactory

Hello all,

I am trying to access a queue with QueueConnectionFactory. When I am doing the factory.createConnection(), I am getting the Exception Stack as :

javax.jms.JMSException: The following hosts (hostname:port) cannot be accessed: . Check host names and ports.

at com.sap.jms.client.connection.ConnectionFactory.getSocket(ConnectionFactory.java:447)

at com.sap.jms.client.connection.ConnectionFactory.createConnection(ConnectionFactory.java:300)

at com.sap.jms.client.connection.ConnectionFactory.createConnection(ConnectionFactory.java:244)

at com.sap.jms.client.connection.ConnectionFactory.createConnection(ConnectionFactory.java:212)

at com.fwk.jms.MessageBroker.init(MessageBroker.java:128)

at com.fwk.jms.MessageBroker.<init>(MessageBroker.java:82)

at com.fwk.jms.MessageBroker.<init>(MessageBroker.java:76)

at com.fwk.jms.test.FwkTest.main(FwkTest.java:25)

When I debug the application using SAP NetWeaver, I find that the size of LinkedList for Hosts and ports in QueueConnectionFactory is 0 (zero)(i.e. there are no elements in them).

Why is this happening ? How to set the host names and ports manually?

The settings of the environment go like this:

INITIAL_CONTEXT_FACTORY=com.sap.engine.services.jndi.InitialContextFactoryImpl

PROVIDER_URL=localhost:50004

CONNECTION_FACTORY=jmsfactory/default/QueueConnectionFactory

INPUT_QUEUE=jmsqueues/default/IN

Please note that the look up is happening perfectly. The casting from com.sap.jms.client.connection.QueueConnectionFactory to the javax.jms.ConnectionFactory is also happening fine.

Any ideas ?

Thanks,

Pawan

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Oct 27, 2005 at 03:36 AM

    Hi pawan,

    I am getting the same error - were you able to resolve this?

    Thanks

    Dushy

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Wing,

      Not sure whether this will help you or not but when i was getting this problem i was running SAP Netweaver Slim Preview Edition. As soon as i ugraded to the Java Edition, it just started working for me. Ideally there shouldn;t be any need to deviate from standard J2EE.

      Regards

      Dushy