We have setup a two node cluster WebSphere 6.0 JMS Server.
Using Spring-JMS, I am able to send and receive (point-to-point) messages to this cluster from a standalone java application. This is running on Sun JDK 1.4.x.
The settings we use are:
<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
<property name="environment">
<props>
<prop key="java.naming.factory.initial">
com.ibm.websphere.naming.WsnInitialContextFactory
</prop>
<prop key="java.naming.provider.url">
corbaloc:iiop:ghlx052ptlge.penske.com:20810,:ghlx0 54ptlge.penske.com:20810
</prop>
<prop key="com.ibm.CORBA.ORBInit">
com.ibm.ws.sib.client.ORB
</prop>
</props>
</property>
</bean>
Please not the provider url: corbaloc:iiop:.....
However, if I run the same exact code and settings within a web application running on Web Sphere 6.0 (IBM JDK 1.4.x), I receive the following error:
Exception stack trace:
javax.naming.NamingException: Error during resolve. Root exception is org.omg.CORBA.NO_IMPLEMENT: No available target vmcid: 0x49421000 minor code: 40 completed: No
Here is the really baffling thing, sometimes, despite the error message it works. However, when it does not work, I get the same error above for each call to send or receive a message.
If I change the provider url to: iiop://ghlx052ptlge.penske.com:20810, it initializes correctly and I am able to send and receive messages.
So I wrote some manual jms code with in the WAS6.0 web application.
Properties env = new Properties();
env.put(Context.PROVIDER_URL, "corbaloc:iiop:ghlx052ptlge.penske.com:20810,:ghlx 054ptlge.penske.com:20810");
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory ");
env.put("com.ibm.CORBA.ORBInit", "com.ibm.ws.sib.client.ORB");
InitialContext ctx = new InitialContext(env);
Queue queue = (Queue) ctx.lookup("jms/test_queue");
QueueConnectionFactory factory = (QueueConnectionFactory)ctx.lookup("jms/test_factory");
QueueConnection conn = factory.createQueueConnection();
QueueSession session = conn.createQueueSession(false, 0);
QueueSender sender = session.createSender(queue);
sender.send(session.createTextMessage("QUIT"));
This above code, using the same provider url that failed using Spring-JMS, works.
Any idea what might be causing my issue?
Thanks,