• 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

Using EJB deployed in WebLogic in a servlet which runs in Tomcat

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an EJB deployed in the WebLogic server.
Now I want to use that EJB in a web-application which is supposed to use Tomcat as the Web-container.
How can I use the JNDI service of WebLogic in Tomcat?
Thanks in advance...
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, since Tomcat doesn't support EJBs...
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It should be possible to connect to WebLogic's JNDI and get a reference to the EJB provided you have the EJB client classes in your classpath. You'd need to create a Hashmap containing information on how to connect to the WebLogic JNDI with such entries as 'java.naming.factory.initial' identifying the factory class WebLogic needs to use (which would also have to be in your classpath), one for the URI to connect to, etc. You would then pass this Hashmap as a parameter to the constructor for javax.naming.InitialContext. Once you have this context, you should be able to use it to find your EJB's home class and from there get an instance of the EJB itself.
 
Pranav Pal
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, Merrill
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic