This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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?
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
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."
Joined: Nov 26, 2007
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