Skip to Content
0
Former Member
Nov 17, 2009 at 08:55 PM

JMS Receiver Adapter - com.ibm.websphere.naming.WsnInitialContextFactory

163 Views

Hello experts,

I am trying to configure JMS Adapter to Access Websphere Application Server via JNDI. The configuration is as follow:

Initial Context Factory: com.ibm.websphere.naming.WsnInitialContextFactory

Connection Factory: jms/messageQueueCF

Server URL: iiop://ammtnode.iubs.intra:2809/

Queue Name: jms/EXT_INPUT_QUEUE

I deployed all required jar files but Iu2019m still unable to connect to WAS because adapter cannot initialize ORB:

javax.naming.NamingException: Failed to initialize the ORB

I wrote a small java class to check where the problem was:

============================================================================

Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
env.put(Context.PROVIDER_URL, "iiop://ammtnode.iubs.intra:2809/");
env.put("java.naming.corba.orb",org.omg.CORBA.ORB.init((String[])null,null));

Context jndiContext = null;
try {
	
jndiContext = new InitialContext(env);
ConnectionFactory connectionFactory = (ConnectionFactory) jndiContext.lookup("jms/messageQueueCF");
Connection qConn = connectionFactory.createConnection();
Session qSession = qConn.createSession(false,Session.AUTO_ACKNOWLEDGE);
Queue q = (Queue) jndiContext.lookup("jms/EXT_INPUT_QUEUE");
MessageProducer producer = qSession.createProducer(q);
TextMessage message = qSession.createTextMessage();
message.setText(text);
producer.send(message);

producer.close();
qSession.close();
qConn.close();
			
} catch (Exception e) {
	e.printStackTrace();
}

============================================================================

I got the same error until I wrote this line:

env.put("java.naming.corba.orb",org.omg.CORBA.ORB.init((String[])null,null));

And everything worked fine. Now I want to do the same in my JMS Receiver adapter but I donu2019t know how to introduce this line in the Initial Context Environment. I tried as JMS additional parameters and additional properties as well. However, nothing worked. Does anybody know what Iu2019m doing wrong?

Thank you in advance!