This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Using EJB deployed in WebLogic in a servlet which runs in Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Using EJB deployed in WebLogic in a servlet which runs in Tomcat" Watch "Using EJB deployed in WebLogic in a servlet which runs in Tomcat" New topic
Author

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

Pranav Pal
Ranch Hand

Joined: Nov 04, 2007
Posts: 74
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...


Hakuna Matata!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60071
    
  65

Well, since Tomcat doesn't support EJBs...


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
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.


Merrill
Consultant, Sima Solutions
Pranav Pal
Ranch Hand

Joined: Nov 04, 2007
Posts: 74
Thanks, Merrill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using EJB deployed in WebLogic in a servlet which runs in Tomcat
 
Similar Threads
Accessing an ejb in weblogic from tomcat
EJB and logging
Tomcat JNDI lookup on Weblogic
How separate application server and web server?
Axis and Tomcat Versus WebLogic 8.1