• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Bear Bibeault
  • paul wheaton
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Mikalai Zaikin
  • Piet Souris
Bartenders:

Problem while accessing JMS topic of WAS5.1

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is the answer:

http://wsdj.sys-con.com/read/45011.htm
 
I have a knack for fixing things like this ... um ... sorry ... here is a consilitory tiny ad:
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
reply
    Bookmark Topic Watch Topic
  • New Topic