jQuery in Action, 2nd edition*
The moose likes Portals and Portlets and the fly likes IPC with pluto Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "IPC with pluto" Watch "IPC with pluto" New topic
Author

IPC with pluto

Puneet Satija
Greenhorn

Joined: Nov 04, 2007
Posts: 1
Dear All
I want to know whether there is a mechanism using which i can make two portlets in the pluto -1.1.4 Container communicate ? Will the Sun IPC Api work
I am trying to use it as given below

public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException
{

System.out.println("inside processAction");
try{

String eventData = "";

PortletEventBroker peb = new PortletEventBroker(request);
System.out.println("about to throw evetn");
PortletEvent pe = peb.createEvent("event1");

pe.setEventData(eventData);

pe.fire();
System.out.println("event fired");
}
catch(EventNotRegisteredException e) {

e.printStackTrace();
}


my portlet.xml is



<?xml version="1.0" encoding="UTF-8"?>
<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
version="1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">


<portlet>
<portlet-name>HelloWorldPortlet</portlet-name>
<display-name>Newgen Portlet</display-name>
<display-name xml:lang="en"> </display-name>
<portlet-class>
com.examscam.portlet.HelloWorldPortlet
</portlet-class>
<init-param>
<name>wps.markup</name>
<value>html</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
</supports>
<supported-locale>en</supported-locale>
<resource-bundle>
com.examscam.portlet.nl.HelloWorldPortletResource
</resource-bundle>
<portlet-info>
<title>Newgen Portlet</title>
</portlet-info>
<events>
<generates-event>event1</generates-event>
</events>

</portlet>
</portlet-app>


every time the method processAction is executed a nullPointerException is thrown
The stacktrace is


java.lang.NullPointerException
com.sun.portal.portletappengine.ipc.PortletEventBroker.createEvent(PortletEventBroker.java:66)
com.examscam.portlet.HelloWorldPortlet.processAction(HelloWorldPortlet.java:41)
org.apache.pluto.core.PortletServlet.dispatch(PortletServlet.java:218)
org.apache.pluto.core.PortletServlet.doPost(PortletServlet.java:145)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.pluto.core.DefaultPortletInvokerService.invoke(DefaultPortletInvokerService.java:167)
org.apache.pluto.core.DefaultPortletInvokerService.action(DefaultPortletInvokerService.java:85)
org.apache.pluto.core.PortletContainerImpl.doAction(PortletContainerImpl.java:219)
org.apache.pluto.driver.PortalDriverServlet.doGet(PortalDriverServlet.java:112)
org.apache.pluto.driver.PortalDriverServlet.doPost(PortalDriverServlet.java:158)
javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

Thanks
Puneet Satija
 
GeeCON Prague 2014
 
subject: IPC with pluto