This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Access EJB from different app server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Access EJB from different app server" Watch "Access EJB from different app server" New topic
Author

Access EJB from different app server

brijesh chavda
Greenhorn

Joined: Jan 01, 2011
Posts: 18
Hi,

I have a JSF web application which is deployed on Glassfish server and i have EJB 3 components deployed on weblogic 10 server. How can i call those EJBs from the JSF managed beans.
I tried to use InitialContext by setting context factory to weblogic context factory and putting wlclient.jar in the classpath of JSF web app. It doesnt work. JSF application is failed to deploy.

Is there something i am missing.

Any quick help is really really appreciable.

Thanks,
Brijesh
K Kiran Kumar
Ranch Hand

Joined: Jan 04, 2006
Posts: 109
Hi Brijesh,

I hope you are trying to call the Bean that implemented the Remote interface. I have done using WebSphere. I guess the logic should be the same. Can you please use the below code and try to call the EJB method.
brijesh chavda
Greenhorn

Joined: Jan 01, 2011
Posts: 18
Hi Kiran,

Yes thats what i tried. I put the weblogic context factory in the properties and put wlclient.jar in classpath of glassfish (I tried putting it in lib folder of my WEB-INF too.) . It looks like weblogic client jar is creating some conflicts with glassfish. My application failed to deploy.
If i remove wlclient.jar, Application deploys fine without error.

Thanks,
Brijesh
Claude Moore
Ranch Hand

Joined: Jun 24, 2005
Posts: 475
    
    1

It looks like weblogic client jar is creating some conflicts with glassfish. My application failed to deploy.


It doesn't sound new to me. Years ago, I tried a similar approach (let two different appserver talk each to other using EJBs) and after a while I gave up. Since my application servers were in LAN, and I did not need a lot of different services to be used by each other, I used webservices instead, and that approach worked.

It's a pity. EJBs are powerful and I like them a lot, but in my humble opinion when you're using them outside the appserver there are always troubles (lot of jars on the client side to be deployed, jar conflicts and others).

I'm sorry to not be able to advice you better, but I think you'd better try webservices to avoid such issues. No headaches :-)
 
 
subject: Access EJB from different app server