Magic Code in Portlet - MyPortlet could not findproperty broker service

Hi Write the following code in IPCAction class if yopu dont switch your portlet and there is no Error in the Log...


public void init() throws PortletException {
super.init();
try {
Context ctx = new InitialContext();
PortletServiceHome serviceHome = (PortletServiceHome)
ctx.lookup("portletservice/com.ibm.portal.propertybroker.service.PropertyBrokerService");
PropertyBrokerService pbService =(PropertyBrokerService)serviceHome.getPortletService(com.ibm.portal.propertybroker.service.PropertyBrokerService.class);
boolean pbServiceAvailable = true;
}catch(Throwable t) {
getPortletContext().log("MyPortlet could not findproperty broker service!");
}
}

0 comments: