aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes remote ejb client with websphere Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "remote ejb client with websphere" Watch "remote ejb client with websphere" New topic
Author

remote ejb client with websphere

AdamK Price
Greenhorn

Joined: Mar 09, 2007
Posts: 2
Hi

I am having reall issues with unit tests that call my EJB's from outside of websphere. I have used the 'universal test page' in wasad to check the jndi set up is ok and it all seems fine. I then run my app and I get this exception:


javax.naming.NamingException: The JNDI operation "lookup"on the context "localhost/nodes/localhost/servers/server1" with the name "ejb/AuthenticationManager" 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.ibm.ivj.ejb.runtime.AbstractAccessBean.lookupAndCacheHome(AbstractAccessBean.java:203)
at com.ibm.ivj.ejb.runtime.AbstractAccessBean.getGlobalHome(AbstractAccessBean.java:195)
at com.ibm.ivj.ejb.runtime.AbstractAccessBean.getHome(AbstractAccessBean.java:229)


I have also tried using the eclipse plugin for jndi explorer and I get the same.

Ive looked around on line and can see nothing that I havent already tried.

A
Kris Ten
Greenhorn

Joined: Feb 28, 2007
Posts: 11
When you set up your EJB Deployment Descriptor, did you add the bean and its EJB reference? That could cause JNDI issues. Also, make sure that you've got the ejb reference in your test application's deployment descriptor as well. When you look up the EJB to create the remote & home interfaces, you'll probably need to use "java:comp/env/ejb/YourEJBBean"

Hope that helps!

Cheers,
Kristen
AdamK Price
Greenhorn

Joined: Mar 09, 2007
Posts: 2
Yeah the deployment descriptor is fine. the app runs fine with clients that are within the container, so I dont see how its going to be a jndi issue, and as I said I have used the jndi explorer in the container test page and everything is there. Its only when trying to access the bean from outside of the container thats the problem.

It seems its connecting to the iiop port ok and then failing when its trying to get to the next step. But i dont think its got as far as the actual bean itself.
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

What type of application is your client? Is it Servlets and JSPs, EJBs, or a standalone app?

If it's a standalone app,made sure you are running it from a WebSphere, J2EE client container.

Good luck!

-Cameron McKenzie
rashi khanna
Greenhorn

Joined: Mar 12, 2007
Posts: 2
I am trying running a basic ejb application on RAD and am encountering the following similar error :
The JNDI operation "lookup"on the context "wi1254SRJ91SNode01Cell/nodes/wi1254SRJ91SNode01/servers/server1" with the name "ejb/ejbs/AdviceHome" 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 even adding of the naming.jar,namingclient.jar to the class path din't help...
Kris Ten
Greenhorn

Joined: Feb 28, 2007
Posts: 11
Okay, so it seems strange to me that you'd have "jts" in the JNDI name twice... Is that a correct reference? If so, when you're creating the interfaces (home & remote component), make sure to use "java:comp/env/" prior to the name of your EJB reference (e.g. ejb/Advice) if you're writing your own code. If, on the other hand, you're using the ServiceLocatorManager that comes with WebSphere, you'll need code to locate the home interface using the service locator manager. For example:

AdviceHome adviceHome = (AdviceHome) ServiceLocatorManager.getRemoteHome("ejb/Advice", AdviceHome.class, "iiop://localhost:2809/", "com.ibm.websphere.naming.WsnInitialContextFactory");

//note: params are Reference Name (in your deployment descriptor), Class, Provider URL, and Service Type

Then try to create:
try {
if (adviceHome != null) {
advice = adviceHome.create();
}
}

You'll have to catch a create exception and a remote exception.

Good luck!
Kristen
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: remote ejb client with websphere