• 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

remote ejb client with websphere

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic