cancel
Showing results for 
Search instead for 
Did you mean: 

JMSException: hosts (hostname:port) cannot be accessed

Former Member
0 Kudos

Hi,

I am trying to write a simple Java Standalone application that talks to a MessageDrivenBean sitting inside my J2EE application in SAP WAS. I have done all that is required in terms of the right descriptors, deploying my application ear etc.

<b>This is the code in my Standalone client;</b>

Properties m_JNDIProperties = new Properties();
 m_JNDIProperties.put(Context.INITIAL_CONTEXT_FACTORY,"com.sap.engine.services.jndi.InitialContextFactoryImpl");
            
 m_JNDIProperties.put (Context.PROVIDER_URL,"localhost:50004");
 m_JNDIProperties.put(Context.SECURITY_PRINCIPAL,"Administrator");
 m_JNDIProperties.put(Context.SECURITY_CREDENTIALS,"*****");
			
 /*    Create a JNDI API InitialContext object.    */
 m_Context = new InitialContext(m_JNDIProperties);	
		           
 queueConnectionFactory = (QueueConnectionFactory) m_Context.lookup("jmsfactory/default/QueueConnectionFactory");
queueConnection = queueConnectionFactory.createQueueConnection();

Everything works fine but the last line of code which throws the following exception:

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.QueueConnectionFactory.createQueueConnection(QueueConnectionFactory.java:70)
	at com.yambay.mach.gatewayjmsbridge.JMSTestClient.initialiseServer(JMSTestClient.java:98)
	at com.yambay.mach.gatewayjmsbridge.JMSTestClient.<init>(JMSTestClient.java:66)
	at com.yambay.mach.gatewayjmsbridge.JMSTestClient.main(JMSTestClient.java:75)

I have spent 5 hrs now trying different stuff but for the love of god just can;t get past that last line.

I would greatly appreciate any sugestions that might fix this problem.

Thanks

Dushy

Accepted Solutions (0)

Answers (2)

Answers (2)

madhusudana_reddy2
Contributor
0 Kudos

hi .............

We are also getting the same error please tell me how you resolved that problem we would be greatly appreciate you ..from last week we are facing this problem please tell me that solutions

with warm regards

syamprasad.p

agasthuri_doss
Active Contributor
0 Kudos

Hi,

May I know how did you resolved it,

Regards

Agasthuri Doss