Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB lookup from WPS Portal

 
Dorothy Taylor
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

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?

Thanks
 
Dharmesh Chheda
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
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,
Dharmesh
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dorothy Taylor:
Hi
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
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

Thanks
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic