Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

JMS factory remote lookup problem with WAS 6

121 views
Skip to first unread message

jiv...@abv.bg

unread,
Nov 18, 2005, 4:10:30 AM11/18/05
to
Hi,
I have problem to send jms message from remote application to queue hosted in WAS 6.0. (only remote send is problem). The strange thing is the exception that occurs. But first I will start from the configurations ?
I am running WAS 6.0 on Windows XP +SP2. I have sample jms queue defined in the default jms provider for WebSphere Application Server 6.0.
I have Bus defined and Destination on this bus. And I send messages locally when I am on the server.

Here is my QueueConnectionFactory configuration:
Name: QueueConnFactory
JNDI name: jms/QueueConnFactory
Bus name: MyBus
Target inbound transport chain: InboundBasicMessaging
Provider endpoints: localhost:7276:BootstrapBasicMessaging
Connection procimity: Bus
XA recovery authentication alias: (none)

Here is my Queue configuration:
Name: TestMDBQueue
JNDI name: jms/MTestMDBQueue
BusName: MyBus
Delivery mode: Application
Read Ahead: Enabled

I have JMS activation specification which is set to the MDB that have to receive the messages. So when I send locally everything is ok. But when I send from application that is running outside of the WAS I have this exception:

2005-11-18 10:43:38 com.ibm.ws.naming.util.Helpers
WARNING: jndiNamingException
com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object. Root exception is java.lang.NoClassDefFoundError: Invalid Implementation Key, com.ibm.ws.transaction.NonRecovWSTxManager
at com.ibm.ws.Transaction.TransactionManagerFactory.getUOWCurrent(TransactionManagerFactory.java:109)
at com.ibm.ws.rsadapter.AdapterUtil.<clinit>(AdapterUtil.java:125)
at com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl.getObjectInstance(ConnectionFactoryBuilderImpl.java:225)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:314)
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookupExt(Helpers.java:874)
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup(Helpers.java:681)
at com.ibm.ws.naming.jndicos.CNContextImpl.processResolveResults(CNContextImpl.java:1969)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1824)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1737)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1444)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1324)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:144)
at javax.naming.InitialContext.lookup(InitialContext.java:361)
at com.seeburger.appservtest.test.SimpleTest.sendMessageToQueue(SimpleTest.java:96)
at com.seeburger.appservtest.test.SimpleTest.main(SimpleTest.java:66)


Here is the code responsible for the exception: I could not lookup the QueueConnectionFactory.

InitialContext context = new InitialContext();
ConnectionFactory connectionFactory =
(ConnectionFactory)ctxArg.lookup(connectionFactoryJNDI); //HERE IS THE PLACE

//find queue
Queue queue = (Queue)ctxArg.lookup(queueJNDI);

//create connection
Connection conn = connectionFactory.createConnection();
conn.start();

//crate session
Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);

//create message producer and message
MessageProducer messProducer = session.createProducer(queue);
TextMessage textMessage = session.createTextMessage();
textMessage.setText(messageArg);

//send message
textMessage.setJMSDestination(queue);
messProducer.send(textMessage);

conn.stop();

I have jndi.properties file in the classpath with this configuration:
java.naming.factory.initial=com.ibm.websphere.naming.WsnInitialContextFactory
java.naming.provider.url=iiop://localhost:2809

I am using the IBM JRE from the WAS. I tried to add the /properties folder from WAS instllation but this didn?t help. I also added naming*.jars and com.ibm.mq.jar and com.ibm.mqjms.jar. (The hole WAS/lib didn?t help too)

The strange is that when I put
Queue queue = (Queue)ctxArg.lookup(queueJNDI);
First before factory lookup it throws:

2005-11-18 10:57:41 com.ibm.ws.naming.util.Helpers
WARNING: jndiGetObjInstNoop
java.lang.ClassCastException: javax.naming.Reference
at com.seeburger.appservtest.test.SimpleTest.sendMessageToQueue(SimpleTest.java:100)
at com.seeburger.appservtest.test.SimpleTest.main(SimpleTest.java:66)

Which I suppose means that it can not find the implementation classes for the Queue after lookup, but what else should I add to the classpath? This is bugging me for a week and I really will appreciate if someone could help with advice.

Thanks in advanced, Jivko

David Currie

unread,
Nov 18, 2005, 7:40:17 AM11/18/05
to
All of your problems relate to missing classes/files. The use of the
default messaging provider is not currently supported from a standalone
client but, if you are going to do it, then please use the full
WebSphere thin client.

Regards,
David

vija...@gmail.com

unread,
Dec 13, 2005, 5:18:56 AM12/13/05
to
Hi,

I was facing the same problem and dont know whether you were able to solve it.
I inlcuded the messageClient.jar from the lib folder to external jars and it worked for me.

Thanks,
Vijaya

Zvika

unread,
Nov 4, 2009, 3:53:34 AM11/4/09
to
I'm facing the same problem with Websphere 7.
Getting the following after trying to narrow the object returned from JNDI lookup.

WARNING: jndiGetObjInstNoop
java.lang.ClassCastException: javax.naming.Reference cannot be cast to org.omg.CORBA.portable.ObjectImpl
at com.ibm.rmi.javax.rmi.PortableRemoteObject.getObjectImpl(PortableRemoteObject.java:620)
at com.ibm.rmi.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:341)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)

Any idea?

0 new messages