• 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

Calling EJB3.0 from EJB2.0 on a WAS7 cluster

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Folks,

Hoping you can help - I'm totally stuck.

I have been trying to call an EJB3 on a WAS7 cluster from RAD6 (WAS5).

Calling the EJB from RAD7.5 works fine. The issue lies in obtaning the initial context for the WAS7 cluster from the RAD6 (WAS5) development environment.

Here is a sample of the code I'm using.

try{

Properties properties = new Properties();

properties.put(Context.INITIAL_CONTEXT_FACTORY , "com.ibm.websphere.naming.WsnInitialContextFactory" );
properties.put(Context.PROVIDER_URL , "corbaloc::server1:9811/NameServiceServerRoot");

Context context = new InitialContext(properties);

Object result = context.lookup(MyBean.class.getName()) ;
MyBean myBean = (MyBean)PortableRemoteObject.narrow(result, MyBean.class) ;
System.out.println(myBean.myMethod("test"));

}catch(Exception ex){
ex.printStackTrace() ;

}


Here is the stacktrace:

[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R javax.naming.ServiceUnavailableException: A communication failure occurred while attempting to obtain an initial context with the provider URL: "corbaloc::server1:9811/NameServiceServerRoot". Make sure that any bootstrap address information in the URL is correct and that the target name server is running. A bootstrap address with no port specification defaults to port 2809. Possible causes other than an incorrect bootstrap address or unavailable name server include the network environment and workstation network configuration. Root exception is org.omg.CORBA.INTERNAL: Unable to create ClientSubcontract for scid:18 vmcid: IBM minor code: 59D completed: No
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.rmi.SubcontractRegistry.getClientSubcontract(SubcontractRegistry.java(Compiled Code))
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.rmi.iiop.CDRInputStream.newObjRef(CDRInputStream.java:1115)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.rmi.iiop.CDRInputStream.read_Object(CDRInputStream.java:1078)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.rmi.iiop.CDRInputStream.read_Object(CDRInputStream.java:1013)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.rmi.corba.IorURL.iorbytesToObjref(IorURL.java:106)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.rmi.corba.IorURL.resolve(IorURL.java:94)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.rmi.corba.ORB.objectURLToObject(ORB.java:3436)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.CORBA.iiop.ORB.objectURLToObject(ORB.java:3374)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.rmi.corba.ORB.string_to_object(ORB.java:3325)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.ws.naming.util.WsnInitCtxFactory.stringToObject(WsnInitCtxFactory.java:1256)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.ws.naming.util.WsnInitCtxFactory.getCosRootContext(WsnInitCtxFactory.java:774)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootContextFromServer(WsnInitCtxFactory.java:689)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.ws.naming.util.WsnInitCtxFactory.getRootJndiContext(WsnInitCtxFactory.java:607)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java(Compiled Code))
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java(Compiled Code))
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java(Inlined Compiled Code))
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java(Compiled Code))
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at javax.naming.InitialContext.lookup(InitialContext.java(Compiled Code))
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.local.testwebclient.ClientServlet.performTask(ClientServlet.java:114)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.local.testwebclient.ClientServlet.doGet(ClientServlet.java:35)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java:110)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java:174)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java:313)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java:116)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java:283)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java:42)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java:40)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:1019)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:592)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:204)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:125)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:286)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:615)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
[7/18/11 16:32:32:973 EDT] 6af57da7 SystemErr R at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
 
Ranch Hand
Posts: 312
MS IE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe, EJB2 and EJB3 are completely different specifications and may not be compatible with each other.
 
Greenhorn
Posts: 20
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My first suggestion is that you have different classes version on your RAD from v6.
So, try to replace .jar files that are used by RAD to lookup stuff from contexts.

If that doesn't help you out, try using SOAP API instead of RMI which you are trying to use at the moment.

Regards, Askar.
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
try to search on the developerWork site, I have a feeling that the big blue has published a way to work. The trick was that even for ejb3 you can specify a home interface (with @Home). Ejb2 context expects the home interface under the lookup jndi.
Unfortunately I have only an older version here, so I cannot test it by myself.
Good luck.
G.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic