permaculture playing cards
The moose likes Portals and Portlets and the fly likes EJB lookup from WPS Portal Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "EJB lookup from WPS Portal" Watch "EJB lookup from WPS Portal" New topic

EJB lookup from WPS Portal

Dorothy Taylor
Ranch Hand

Joined: Nov 26, 2007
Posts: 104

I am developing JSR-168 portlets on WPS 5.1. I need to interact with some EJB's deployed in Weblogic server. How can I make the portal server communicate with the Application server. I know we set up a provider url in the properties file. But how should the lookup be done?

Dharmesh Chheda
Ranch Hand

Joined: May 08, 2001
Posts: 204
There is nothing special that you need to do in JSR 168 / portlet applications to invoke EJB calls. Its the same way you invoke in a J2EE application.

Make sure you have the client jar in classpath (either in <portal installation directory>/shared/app folder or the portlet application WEB-INF/lib folder or any folder thats in the classpath for portal)..

Then all you do is use proper URL and JNDI lookup to get the reference of the home and then onwards it regular EJB calling mechanism...

do you have specific problems related to the calls?....I hope this helps


regards,<br />Dharmesh Chheda
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

Originally posted by Dorothy Taylor:
I am developing JSR-168 portlets on WPS 5.1.... But how should the lookup be done?

There's not problem looking up an EJB from the portal. Just think of your portlets as though there were any other Servlet/JSP type of application in this regards.

As far as looking up your EJB, you really should go through a service locator. The Service Locator pattern is well established, and there's lots of documentation on how to implement it. Plus, you'll impress everyone on your team by using a "Design Pattern."

Good luck!

-Cameron McKenzie
Dorothy Taylor
Ranch Hand

Joined: Nov 26, 2007
Posts: 104
So, is this architecture correct then:

Portal creates a business delegate. The business delegate uses the Service Locatorto do a lookup on the Service(session bean). Also, it obtains the service id for the first time that can be used in subsequent calls so that teh lookup can be obviated.
Also is there any need of Portlet Service? In the above approach we are not creating any Portlet Service.

Please confirm if this design approach is appropriate

I agree. Here's the link:
subject: EJB lookup from WPS Portal
It's not a secret anymore!