• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need Help - How to access JMS Administered objects created in WAS 6.1 from Servlet ?

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have WAS 6.1 installed on my machine. My workspace is in Eclipse. I have not integrated Eclipse with WAS 6.1. I want to create and EAR file and deploy on WAS 6.1. Currently I am deploying on Tomcat 6.0 server.
I have created JMS Administered objects such as ConnectionFactory, Queue etc. in WAS 6.1. Now in my servlet code I want to access these object through JNDI lookup. My lookup code is:

Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
env.put(Context.PROVIDER_URL,"iiop://localhost:2809");
Context jndiContext = null;
try {
jndiContext = new InitialContext(env);
} catch (NamingException e) {
System.out.println("Could not create JNDI API context: " + e.toString());
}


But I keep on getting the exception:

java.lang.NoClassDefFoundError: com/ibm/ws/bootstrap/RASWsLoggerFactory
com.ibm.websphere.naming.WsnInitialContextFactory.<clinit>(WsnInitialContextFactory.java:70)
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Unknown Source)
com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)
javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
javax.naming.InitialContext.init(Unknown Source)
javax.naming.InitialContext.<init>(Unknown Source)
com.bnymellon.jms.MyJMSServlet.doGet(MyJMSServlet.java:39)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause

java.lang.ClassNotFoundException: com.ibm.ws.bootstrap.RASWsLoggerFactory
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)
java.lang.ClassLoader.loadClassInternal(Unknown Source)
com.ibm.websphere.naming.WsnInitialContextFactory.<clinit>(WsnInitialContextFactory.java:70)
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Unknown Source)
com.sun.naming.internal.VersionHelper12.loadClass(Unknown Source)
javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
javax.naming.InitialContext.init(Unknown Source)
javax.naming.InitialContext.<init>(Unknown Source)
com.bnymellon.jms.MyJMSServlet.doGet(MyJMSServlet.java:39)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)



I have following jars in my WEB-INF/lib

1) com.ibm.mq.jar
2) com.ibm.mqjms.jar
3) com.ibm.ws.admin.client_6.1.0.jar
4) com.ibm.ws.runtime_6.1.0.jar
5) com.ibm.ws.webservices.thinclient_6.1.0.jar
6) dhbcore.jar
7) ibmorb.jar
8) jms.jar
9) ws_runtime.jar
10) servlet-api.jar
 
There will be plenty of time to discuss your objections when and if you return. The cargo is this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic