cancel
Showing results for 
Search instead for 
Did you mean: 

Hosts not set in QueueConnectionFactory

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi pawan,

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

Thanks

Dushy

Former Member
0 Kudos

Yea ... call addDispatcher on the QueueConnection...

this seems to be a deviation from the JMS spec., which i am not getting anymore !!

I dont know how and why.

Former Member
0 Kudos

Sorry mate, not sure what you meant. I am not sure how to addDispatcher to the QueueConnection, i cannot even get to the point of creating a queue connection at the moment.

would highly appreciate if you could give me an example of the code snippet. I get the JMS Exception when i try to do a QueuecConnectionFactory.getConnection()

Thanks

Dushy

Former Member
0 Kudos

In com.sap.jms.client.connection.QueueConnectionFactory you can find the method addDispatcher(String, int) to add the dispatcher, before creating the connection.

But where can I find more about this method and required parameter values? And where can I find the complete javadoc API from the Netweaver application server? I didn't find it in the installation directory, nor in the help from the IDE.

Does someone has a pointer to an example dispatcher? And any reference why this deviates from standard J2EE?

Former Member
0 Kudos

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