Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

EJB Call to different server

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i have a problem calling an EJB from within Websphere AppServer (inside an EJB) running on a different Instance (also different AdminServer)
When creating the JNDI Context a specify the provider url of the remote server, but it seems the lookup still occurs on the local server and the EJB is not found.
Is there something else i have to specify, so that the remote server will be used ?
Regards,
Andi
 
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, you should have
iiop://server-name and port
for example:
iiop://localhost:900
When you want to change the server that it's on, simply change the server-name. Also, make sure the jndi lookup name is the same.
[ February 10, 2003: Message edited by: William Duncan ]
[ February 10, 2003: Message edited by: William Duncan ]
[ February 10, 2003: Message edited by: William Duncan ]
 
Andreas Kuhn
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi William,
unfortunately it doesn't work
I have to Websphere 4.0.4 instances (2 AdminServer with each having one AppServer instance).
I deploy EJB A on first and EJB B on second server. Using wscp i see with C init/list that the EJB are bind in the JNDI ( EJB A on server A and EJB B on server B).
Now i try to call EJB B from EJB A, using Provider URL with the Port of server B, but it cannot find the reference in the JNDI
I always get:
[2/11/03 14:36:12:536 CET] 14a306 Helpers W NMSV0610I: A NamingException is being thrown from a javax.naming.Context implementation. Details follow:
Context implementation: com.ibm.ejs.ns.jndi.CNContextImpl
Context method: list
Context name: domainRoots/UnspecifiedDomainName/legacyRoot
Target name: ejb
Other data:
Exception stack trace: javax.naming.PartialResultException: org.omg.CORBA.OBJECT_NOT_EXIST: minor code: 0 completed: No. Root exception is org.omg.CORBA.OBJECT_NOT_EXIST: minor code: 0 completed: No
at com.ibm.CORBA.iiop.ExtendedServerDelegate.getServant(ExtendedServerDelegate.java:121)
at com.ibm.rmi.iiop.CDRInputStream.newObjRef(CDRInputStream.java:921)
at com.ibm.rmi.iiop.CDRInputStream.read_Object(CDRInputStream.java:881)
at com.ibm.rmi.iiop.CDRInputStream.read_Object(CDRInputStream.java:823)
at org.omg.CORBA.ObjectHelper.read(ObjectHelper.java:50)
at com.ibm.WsnOptimizedNaming.BindingDataHelper.read(BindingDataHelper.java:117)
at com.ibm.WsnOptimizedNaming.BindingDataListHelper.read(BindingDataListHelper.java:51)
at com.ibm.WsnOptimizedNaming._NamingContextStub.list_complete_info(_NamingContextStub.java:295)
at com.ibm.ejs.ns.jndi.CNNameEnumeration.initOpt(CNNameEnumeration.java:143)
at com.ibm.ejs.ns.jndi.CNNameEnumeration.doInit(CNNameEnumeration.java:96)
at com.ibm.ws.naming.util.WsnNamingEnumeration.init(WsnNamingEnumeration.java:125)
at com.ibm.ejs.ns.jndi.CNNameEnumeration.<init>(CNNameEnumeration.java:77)
at com.ibm.ejs.ns.jndi.CNContextImpl.doList(CNContextImpl.java:2272)
at com.ibm.ejs.ns.jndi.CNContextImpl.list(CNContextImpl.java:982)
at com.ibm.ws.naming.util.WsnInitCtx.list(WsnInitCtx.java:268)
at javax.naming.InitialContext.list(InitialContext.java:385)
at com.mlp.bpi.common.plugin.AccessCheckPlugin.execute(AccessCheckPlugin.java:92)
at com.syngenio.fwimpl.common.plugin.PluginHandler.callPlugins(PluginHandler.java:84)
at com.syngenio.fwimpl.common.plugin.PluginHandler.callPlugins(PluginHandler.java:69)
at com.syngenio.fwimpl.application.MessageDispatcher.internalDispatch(MessageDispatcher.java;com/syngenio/fwimpl/common/util/perf/PerformanceAspect.java(1k):158)
at com.syngenio.fwimpl.application.MessageDispatcher.dispatch(MessageDispatcher.java;com/syngenio/fwimpl/common/util/perf/PerformanceAspect.java(1k):110)
at com.syngenio.fwimpl.application.ClientDispatcherBean.process(ClientDispatcherBean.java:64)
at com.syngenio.fwimpl.application.EJSRemoteStatefulClientDispatcher.process(EJSRemoteStatefulClientDispatcher.java:25)
at com.syngenio.fwimpl.application._EJSRemoteStatefulClientDispatcher_Tie._invoke(_EJSRemoteStatefulClientDispatcher_Tie.java:122)
at com.ibm.CORBA.iiop.ExtendedServerDelegate.dispatch(ExtendedServerDelegate.java:515)
at com.ibm.CORBA.iiop.ORB.process(ORB.java:2377)
at com.ibm.CORBA.iiop.OrbWorker.run(OrbWorker.java:186)
at com.ibm.ejs.oa.pool.ThreadPool$PooledWorker.run(ThreadPool.java:104)
at com.ibm.ws.util.CachedThread.run(ThreadPool.java:137)

Any ideas ??
Thanks,
Andi
 
Scott Duncan
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you post the code where EJB A calls EJB B?
 
Andreas Kuhn
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
9037 Is BootStrapPort of Server B (same machine).

String url = "iiop://10.162.166.144:9037";
Properties env = new Properties();
env.put( Context.PROVIDER_URL, url );
env.put( Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");

Context clInitContext = new InitialContext(env);
Hashtable ht1 = clInitContext.getEnvironment();
System.out.println( "new: " + ht1 );
NamingEnumeration nenu = clInitContext.list("ejb");
while( nenu.hasMoreElements() )
System.out.println( nenu.nextElement() );
Object objref = clInitContext.lookup("ejb/auth/AuthService");

Using it from within a standalone Java program works fine, but not from within an EJB
Andi

Originally posted by William Duncan:
Could you post the code where EJB A calls EJB B?

 
Andreas Kuhn
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi again,
i just tried to call the EJB on a server on a different machine -> works without any problem.
So it seems that the problem occurs only when calling an EJB on a server on the same machine. Probably the multiple instance installation has some problems but i have no idea what exactly.
Regards,
Andi
 
Scott Duncan
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps they are using the same ejb container or the containers are sharing one or all virtual machines (as I understand it, most EJB containers use multiple VMs). Probably a question for Kyle. Wish I could have been of more help.
 
Ranch Hand
Posts: 179
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try running two appservers(JVMs) under the same WebSphere instance. I assume that the production environment will not have dual instances of WebSphere.
 
It is an experimental device that will make my mind that most powerful force on earth! More powerful than this tiny ad!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic