• 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

access remote session ejb on remote server

 
Ranch Hand
Posts: 270
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have one session ejb deployed on serverA with jndi name: ejb/MySLSBRemoteHome

I have one web client deployed on serverB with the following DD segment:

web.xml

<ejb-ref>
<ejb-ref-name>test/myejb</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>test.MySLSBHome</home>
<remote>test.MySLSBRemote</remote>
</ejb-ref>



weblogic.xml

<reference-descriptor>
<ejb-reference-description>
<ejb-ref-name>test/myejb</ejb-ref-name>
<jndi-name>ejb/MySLSBRemoteHome</jndi-name>
</ejb-reference-description>
</reference-descriptor>



index.jsp

Properties prop = new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
prop.put(Context.PROVIDER_URL,"t3://severA:7001");

Context initial = new InitialContext(prop);
Object objref = initial.lookup("java:comp/env/test/myejb");

MySLSBHome home =
(MySLSBHome)PortableRemoteObject.narrow(objref,
MySLSBHome.class);

MySLSBRemote bean = home.create();



Now the problem is that i get an exception:

javax.naming.LinkException: . Root exception is javax.naming.NameNotFoundExcept
ion: Unable to resolve 'ejb/MySLSBRemoteHome' Resolved ejb; remaining name 'MySLSBRemoteHome'

But when i change the lookup to initial.lookup("ejb/MySLSBRemoteHome"); it will work. But i am supposed to use "java:comp/env/test/myejb", right?

Can anyone of you help me out? Thanks in advance
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd try to change change test/myejb to ejb/myejb.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic