Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem while accessing JMS topic of WAS5.1  RSS feed

 
Java Buzz
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I wrote the following test client that runs as standalong program to post a message into the topic. This topic is hosted in the server instance running inside WSAD and I am using the default JMS service.

=======================
Exception
=======================

com.ibm.websphere.naming.CannotInstantiateObjectException: Exception occurred while the JNDI NamingManager was processing a javax.naming.Reference object. Root exception is java.lang.Exception: De-reference of JMS provider's Reference failed - check provider is on classpath
at com.ibm.ejs.jms.JMSConnectionFactoryFactory.getObjectInstance(JMSConnectionFactoryFactory.java:89)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:313)
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup(Helpers.java:884)
at com.ibm.ws.naming.jndicos.CNContextImpl.processResolveResults(CNContextImpl.java:1674)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1537)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1457)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1167)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:132)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
at TopicClient.main(TopicClient.java:44)







================
Client Code
================

try {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.websphere.naming.WsnInitialContextFactory");
env.put(Context.PROVIDER_URL, "iiop://localhost:2809");

ctx = new InitialContext(env);

//System.out.println( ctx.

TopicConnectionFactory tcf = (TopicConnectionFactory) ctx.lookup("WASTopicConnectionFactory");
TopicConnection connection = tcf.createTopicConnection();

connection.start();
boolean transacted = false;
TopicSession session =
connection.createTopicSession( transacted, Session.AUTO_ACKNOWLEDGE);

TopicPublisher pub = session.createPublisher(topic);
TextMessage outMessage = session.createTextMessage("Heloooooo");
pub.publish(outMessage);

System.out.println("Message placed");
 
Java Buzz
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the answer:

http://wsdj.sys-con.com/read/45011.htm
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!