MDB test client failing

Experts,
   I have one mdb up and running in WSAD test environment server 5.1. To test it I have also created one test client given below. When I run the client I am getting some exception, which I have enclosed it at the last. Please let me know the potential bug causing the client to fail. Thanks in Advance.

import java.util.Hashtable;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jms.TextMessage;
import javax.naming.Context;
import javax.naming.InitialContext;

public class TestClient
{
      public static void main(String[] args) throws Exception
    {
          QueueConnection cnn = null;
          QueueSender  sender = null;
          QueueSession session = null;
                  String icf = "com.ibm.websphere.naming.WsnInitialContextFactory";  
                  String url="iiop://localhost:2809";
                      
            Hashtable env = new Hashtable();
            env.put( Context.INITIAL_CONTEXT_FACTORY, icf );
            env.put( Context.PROVIDER_URL, url );

          InitialContext ctx = new InitialContext();
              Queue queue = null;
          try
          {
                queue = (Queue) ctx.lookup("jms/TestMDBQueue");
          }
          catch(Exception e)
          {
                e.printStackTrace();
          }
         
          QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup("jms/TestConnectionFactory");
          cnn = factory.createQueueConnection();
          session = cnn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
   
          TextMessage msg = session.createTextMessage("Testing...");
   
          sender = session.createSender(queue);
          sender.send(msg);
          System.out.println("Done...");
    }
}

Exception:
javax.naming.NamingException: The JNDI operation "lookup"on the context "localhost/nodes/localhost/servers/server1" with the name "jms/TestMDBQueue" failed.  Please get the root cause Throwable contained in this NamingException for more information.  Root exception is java.lang.NoClassDefFoundError: com/ibm/ejs/jts/jts/CurrentFactory
      at com.ibm.ws.naming.jndicos.CNContextImpl.suspendTransaction(CNContextImpl.java:4064)
      at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:3521)
      at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1565)
      at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1525)
      at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1225)
      at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:132)
      at javax.naming.InitialContext.lookup(InitialContext.java:360)
      at com.accenture.TestClient.main(TestClient.java:46)
Exception in thread "P=536011:O=0:CT" javax.naming.NamingException: The JNDI operation "lookup"on the context "localhost/nodes/localhost/servers/server1" with the name "jms/TestConnectionFactory" failed.  Please get the root cause Throwable contained in this NamingException for more information.  Root exception is java.lang.NoClassDefFoundError: com/ibm/ejs/jts/jts/CurrentFactory
      at com.ibm.ws.naming.jndicos.CNContextImpl.suspendTransaction(CNContextImpl.java:4064)
      at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:3521)
      at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1565)
      at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1525)
      at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1225)
      at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:132)
      at javax.naming.InitialContext.lookup(InitialContext.java:360)
      at com.accenture.TestClient.main(TestClient.java:53)
Regards,
Ganesh CN
ganesh_cnAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

avinthmCommented:
Its not able to find com.ibm.ejs.jts.jts.CurrentFactory
This class is in "tx.jar".
So, include "tx.jar" in your runtime classpath.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rama_krishna580Commented:
Hi,

WebSphere JNDI Standalone client will only work with the IBM JRE.

And IBM does not ship their JRE standalone. (atleast their 1.4 JRE)

R.K
ganesh_cnAuthor Commented:
Thanks for your comments.
Avinthm
tx.jar has different CurrentFactory class and not com.ibm.ejs.jts.jts.CurrentFactory.

R.k
I dont have permission to install other JRE. Is there any alternative solution for this?

Cheers,
Ganesh CN
avinthmCommented:
> tx.jar has different CurrentFactory class and not com.ibm.ejs.jts.jts.CurrentFactory
which version of WAS do u have ?
I have WAS 5.0 installed and i can see com.ibm.ejs.jts.jts.CurrentFactory in tx.jar

When you are running your test client make sure that the selected JRE for your test client is WAS.
You can do this by
Run -> Run -> JRE (tab)

There select the WAS JRE. If its not displayed in the dropdown list of "Alternate JRE" then click on "Installed JREs..."
Now u can select the path of WAS jre.

you dont have to installed other JRE.
ganesh_cnAuthor Commented:
I have tried many options in WSAD to no avail. Atlast I resolved it by creating test webapp application and ran it same JVM of MDB.
Anyways thanks for all your informations. I would split up point and give it you both after this..
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java App Servers

From novice to tech pro — start learning today.