1 2 Previous Next 18 Replies Latest reply on Jul 5, 2008 1:59 AM by dilipreddy

    problem with IPC

    sbiwal

      Hi,

      I am trying to use the simple Inter portlet communication provided in the JBoss2.6 core-samples. I add PortletA and portletB to a page and then select a color in PortletA and clicked on SubmitQuery. But I get the following exception -

      17:51:04,296 ERROR [org_jboss_portal_core_samples_basic_event_PortletA] The portlet threw an exception
      javax.portlet.PortletException: processAction method not implemented
       at javax.portlet.GenericPortlet.processAction(GenericPortlet.java:120)
       at org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl.invokeAction(PortletContainerImpl.java:458)
       at org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl.dispatch(PortletContainerImpl.java:401)
       at org.jboss.portal.portlet.container.PortletContainerInvoker$1.invoke(PortletContainerInvoker.java:86)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:131)
       at org.jboss.portal.core.aspects.portlet.TransactionInterceptor.org$jboss$portal$core$aspects$portlet$TransactionInterceptor$invokeNotSupported$aop(TransactionInterceptor.java:86)
       at org.jboss.portal.core.aspects.portlet.TransactionInterceptor$invokeNotSupported_N4547270787964792031.invokeNext(TransactionInterceptor$invokeNotSupported_N4547270787964792031.java)
       at org.jboss.aspects.tx.TxPolicy.invokeInNoTx(TxPolicy.java:66)
       at org.jboss.aspects.tx.TxInterceptor$NotSupported.invoke(TxInterceptor.java:112)
       at org.jboss.portal.core.aspects.portlet.TransactionInterceptor$invokeNotSupported_N4547270787964792031.invokeNext(TransactionInterceptor$invokeNotSupported_N4547270787964792031.java)
       at org.jboss.aspects.tx.TxPolicy.invokeInNoTx(TxPolicy.java:66)
       at org.jboss.aspects.tx.TxInterceptor$NotSupported.invoke(TxInterceptor.java:102)
       at org.jboss.portal.core.aspects.portlet.TransactionInterceptor$invokeNotSupported_N4547270787964792031.invokeNext(TransactionInterceptor$invokeNotSupported_N4547270787964792031.java)
       at org.jboss.portal.core.aspects.portlet.TransactionInterceptor.invokeNotSupported(TransactionInterceptor.java)
       at org.jboss.portal.core.aspects.portlet.TransactionInterceptor.invoke(TransactionInterceptor.java:56)
       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.portlet.HeaderInterceptor.invoke(HeaderInterceptor.java:50)
       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.portlet.aspects.portlet.ProducerCacheInterceptor.invoke(ProducerCacheInterceptor.java:53)
       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.portlet.AjaxInterceptor.invoke(AjaxInterceptor.java:51)
       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.portlet.aspects.portlet.ModesInterceptor.invoke(ModesInterceptor.java:62)
       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.portlet.bridge.BridgeInterceptor.invoke(BridgeInterceptor.java:47)
       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.portlet.aspects.portlet.WindowStatesInterceptor.invoke(WindowStatesInterceptor.java:55)
       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.portlet.aspects.portlet.PortletSessionSynchronizationInterceptor.invoke(PortletSessionSynchronizationInterceptor.java:80)
       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.portlet.aspects.portlet.ContextTrackerInterceptor.invoke(ContextTrackerInterceptor.java:46)
       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor$1.doCallback(ContextDispatcherInterceptor.java:104)
       at org.jboss.portal.web.command.CommandDispatcher$CallbackCommand.execute(CommandDispatcher.java:74)
       at sun.reflect.GeneratedMethodAccessor387.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
       at java.lang.reflect.Method.invoke(Unknown Source)
       at org.jboss.portal.web.command.CommandServlet.doGet(CommandServlet.java:131)
       at org.jboss.portal.web.command.CommandServlet.doPost(CommandServlet.java:162)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
       at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:557)
       at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:481)
       at org.jboss.portal.web.command.CommandServlet.include(CommandServlet.java:80)
       at org.jboss.portal.web.command.CommandDispatcher.include(CommandDispatcher.java:50)
       at org.jboss.portal.web.jboss.JBossWebContext.include(JBossWebContext.java:66)
       at org.jboss.portal.web.ServletContainer.include(ServletContainer.java:182)
       at org.jboss.portal.portlet.impl.spi.AbstractRequestContext.dispatch(AbstractRequestContext.java:81)
       at org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor.invoke(ContextDispatcherInterceptor.java:76)
       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.portlet.aspects.portlet.SecureTransportInterceptor.invoke(SecureTransportInterceptor.java:68)
       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.portlet.aspects.portlet.ValveInterceptor.invoke(ValveInterceptor.java:60)
       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:157)
       at org.jboss.portal.portlet.container.PortletContainerInvoker.invoke(PortletContainerInvoker.java:198)
       at org.jboss.portal.portlet.state.producer.ProducerPortletInvoker.invoke(ProducerPortletInvoker.java:233)
       at org.jboss.portal.core.impl.portlet.state.ProducerPortletInvoker.org$jboss$portal$core$impl$portlet$state$ProducerPortletInvoker$invoke$aop(ProducerPortletInvoker.java:53)
       at org.jboss.portal.core.impl.portlet.state.ProducerPortletInvoker$invoke_N8654503705355129869.invokeNext(ProducerPortletInvoker$invoke_N8654503705355129869.java)
       at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
       at org.jboss.portal.core.impl.portlet.state.ProducerPortletInvoker$invoke_N8654503705355129869.invokeNext(ProducerPortletInvoker$invoke_N8654503705355129869.java)
       at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
       at org.jboss.portal.core.impl.portlet.state.ProducerPortletInvoker$invoke_N8654503705355129869.invokeNext(ProducerPortletInvoker$invoke_N8654503705355129869.java)
       at org.jboss.portal.core.impl.portlet.state.ProducerPortletInvoker.invoke(ProducerPortletInvoker.java)
       at org.jboss.portal.portlet.federation.impl.FederatedPortletInvokerService.invoke(FederatedPortletInvokerService.java:147)
       at org.jboss.portal.portlet.federation.impl.FederatingPortletInvokerService.invoke(FederatingPortletInvokerService.java:150)
       at org.jboss.portal.core.impl.model.instance.InstanceContainerImpl$1.invoke(InstanceContainerImpl.java:99)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:131)
       at org.jboss.portal.portlet.management.PortletContainerManagementInterceptorImpl.invoke(PortletContainerManagementInterceptorImpl.java:58)
       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.portlet.aspects.portlet.PortalSessionSynchronizationInterceptor.invoke(PortalSessionSynchronizationInterceptor.java:116)
       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.model.instance.InstanceSecurityInterceptor.invoke(InstanceSecurityInterceptor.java:91)
       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.portlet.aspects.portlet.ConsumerCacheInterceptor.invoke(ConsumerCacheInterceptor.java:175)
       at org.jboss.portal.portlet.invocation.PortletInterceptor.invoke(PortletInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:157)
       at org.jboss.portal.core.impl.model.instance.InstanceContainerImpl.org$jboss$portal$core$impl$model$instance$InstanceContainerImpl$invoke$aop(InstanceContainerImpl.java:427)
       at org.jboss.portal.core.impl.model.instance.InstanceContainerImpl$invoke_N8654503705355129869.invokeNext(InstanceContainerImpl$invoke_N8654503705355129869.java)
       at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
       at org.jboss.portal.core.impl.model.instance.InstanceContainerImpl$invoke_N8654503705355129869.invokeNext(InstanceContainerImpl$invoke_N8654503705355129869.java)
       at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
       at org.jboss.portal.core.impl.model.instance.InstanceContainerImpl$invoke_N8654503705355129869.invokeNext(InstanceContainerImpl$invoke_N8654503705355129869.java)
       at org.jboss.portal.core.impl.model.instance.InstanceContainerImpl.invoke(InstanceContainerImpl.java)
       at org.jboss.portal.core.impl.model.instance.AbstractInstance.invoke(AbstractInstance.java:231)
       at org.jboss.portal.core.model.portal.command.action.InvokePortletWindowActionCommand.execute(InvokePortletWindowActionCommand.java:174)
       at org.jboss.portal.core.controller.ControllerCommand$1.invoke(ControllerCommand.java:68)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:131)
       at org.jboss.portal.core.aspects.controller.node.EventBroadcasterInterceptor.invoke(EventBroadcasterInterceptor.java:123)
       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.controller.ControlInterceptor.invoke(ControlInterceptor.java:56)
       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.controller.PageCustomizerInterceptor.invoke(PageCustomizerInterceptor.java:133)
       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.controller.PolicyEnforcementInterceptor.invoke(PolicyEnforcementInterceptor.java:78)
       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.controller.node.PortalNodeInterceptor.invoke(PortalNodeInterceptor.java:81)
       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.controller.NavigationalStateInterceptor.invoke(NavigationalStateInterceptor.java:42)
       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.controller.ajax.AjaxInterceptor.invoke(AjaxInterceptor.java:56)
       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.controller.ResourceAcquisitionInterceptor.invoke(ResourceAcquisitionInterceptor.java:50)
       at org.jboss.portal.core.controller.ControllerInterceptor.invoke(ControllerInterceptor.java:40)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:157)
       at org.jboss.portal.core.controller.ControllerContext.execute(ControllerContext.java:134)
       at org.jboss.portal.core.controller.Controller.processCommand(Controller.java:235)
       at org.jboss.portal.core.controller.Controller.handle(Controller.java:217)
       at org.jboss.portal.server.RequestControllerDispatcher.invoke(RequestControllerDispatcher.java:51)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:131)
       at org.jboss.portal.core.cms.aspect.IdentityBindingInterceptor.invoke(IdentityBindingInterceptor.java:47)
       at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.server.aspects.server.ContentTypeInterceptor.invoke(ContentTypeInterceptor.java:68)
       at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.server.PortalContextPathInterceptor.invoke(PortalContextPathInterceptor.java:45)
       at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.server.LocaleInterceptor.invoke(LocaleInterceptor.java:96)
       at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.server.UserInterceptor.invoke(UserInterceptor.java:317)
       at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.server.aspects.server.SignOutInterceptor.invoke(SignOutInterceptor.java:98)
       at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.impl.api.user.UserEventBridgeTriggerInterceptor.invoke(UserEventBridgeTriggerInterceptor.java:65)
       at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.core.aspects.server.TransactionInterceptor.org$jboss$portal$core$aspects$server$TransactionInterceptor$invoke$aop(TransactionInterceptor.java:49)
       at org.jboss.portal.core.aspects.server.TransactionInterceptor$invoke_N5143606530999904530.invokeNext(TransactionInterceptor$invoke_N5143606530999904530.java)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
       at org.jboss.aspects.tx.TxInterceptor$RequiresNew.invoke(TxInterceptor.java:253)
       at org.jboss.portal.core.aspects.server.TransactionInterceptor$invoke_N5143606530999904530.invokeNext(TransactionInterceptor$invoke_N5143606530999904530.java)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
       at org.jboss.aspects.tx.TxInterceptor$RequiresNew.invoke(TxInterceptor.java:262)
       at org.jboss.portal.core.aspects.server.TransactionInterceptor$invoke_N5143606530999904530.invokeNext(TransactionInterceptor$invoke_N5143606530999904530.java)
       at org.jboss.portal.core.aspects.server.TransactionInterceptor.invoke(TransactionInterceptor.java)
       at org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.server.aspects.LockInterceptor$InternalLock.invoke(LockInterceptor.java:69)
       at org.jboss.portal.server.aspects.LockInterceptor.invoke(LockInterceptor.java:130)
       at org.jboss.portal.common.invocation.Invocation.invokeNext(Invocation.java:115)
       at org.jboss.portal.common.invocation.Invocation.invoke(Invocation.java:157)
       at org.jboss.portal.server.servlet.PortalServlet.service(PortalServlet.java:250)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
       at java.lang.Thread.run(Unknown Source)


      If I implement a basic processAction method for PortletA (with just a println stmt), it does not throw this exception anymore, but I also do not get any events in PortletB.

      Can someone please help me. This is very crucial for my project.

      Thanks in advance.
      S

        • 1. Re: problem with IPC
          sbiwal

          Also posting code for PortletA and PortletB

          PortletA.java

          package org.jboss.portal.core.samples.basic.event;
          
          import javax.portlet.ActionRequest;
          import javax.portlet.ActionResponse;
          import javax.portlet.GenericPortlet;
          import javax.portlet.PortletException;
          import javax.portlet.PortletSecurityException;
          import javax.portlet.RenderRequest;
          import javax.portlet.RenderResponse;
          import java.io.IOException;
          import java.io.PrintWriter;
          
          /**
           * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
           * @version $Revision: 5448 $
           */
          public class PortletA extends GenericPortlet
          {
           protected void doView(RenderRequest request, RenderResponse response) throws PortletException, PortletSecurityException, IOException
           {
           response.setContentType("text/html");
           PrintWriter writer = response.getWriter();
           writer.println("<form action=\"" + response.createActionURL() + "\" method=\"post\">");
           writer.println("<select name=\"color\">");
           writer.println("<option>blue</option>");
           writer.println("<option>red</option>");
           writer.println("<option>black</option>");
           writer.println("</select>");
           writer.println("<input type=\"submit\"/>");
           writer.println("</form>");
           writer.close();
           }
          }
          


          PortletB.java
          package org.jboss.portal.core.samples.basic.event;
          
          import org.jboss.portal.WindowState;
          import org.jboss.portal.api.node.PortalNode;
          import org.jboss.portal.api.node.event.PortalNodeEvent;
          import org.jboss.portal.api.node.event.PortalNodeEventContext;
          import org.jboss.portal.api.node.event.PortalNodeEventListener;
          import org.jboss.portal.api.node.event.WindowActionEvent;
          
          import javax.portlet.ActionRequest;
          import javax.portlet.ActionResponse;
          import javax.portlet.GenericPortlet;
          import javax.portlet.PortletException;
          import javax.portlet.PortletSecurityException;
          import javax.portlet.RenderRequest;
          import javax.portlet.RenderResponse;
          import java.io.IOException;
          import java.io.PrintWriter;
          
          /**
           * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
           * @version $Revision: 8785 $
           */
          public class PortletB extends GenericPortlet
          {
          
           public void processAction(ActionRequest request, ActionResponse response) throws PortletException, PortletSecurityException, IOException
           {
           String color = request.getParameter("color");
           if (color != null)
           {
           response.setRenderParameter("color", color);
           }
           }
          
           protected void doView(RenderRequest request, RenderResponse response) throws PortletException, PortletSecurityException, IOException
           {
           String color = request.getParameter("color");
           response.setContentType("text/html");
           PrintWriter writer = response.getWriter();
           writer.println("<div" +
           (color == null ? "" : " style=\"color:" + color + ";\"") +
           ">some text in color</div>");
           writer.close();
           }
          
           public static class Listener implements PortalNodeEventListener
           {
           public PortalNodeEvent onEvent(PortalNodeEventContext context, PortalNodeEvent event)
           {
           PortalNode node = event.getNode();
          
           // Get node name
           String nodeName = node.getName();
          
           // See if we need to create a new event or not
           WindowActionEvent newEvent = null;
           if (nodeName.equals("PortletAWindow") && event instanceof WindowActionEvent)
           {
           // Find window B
           WindowActionEvent wae = (WindowActionEvent)event;
           PortalNode windowB = node.resolve("../PortletBWindow");
           if (windowB != null)
           {
           // We can redirect
           newEvent = new WindowActionEvent(windowB);
           newEvent.setWindowState(WindowState.MAXIMIZED);
           newEvent.setParameters(wae.getParameters());
           }
           }
          
           //
           if (newEvent != null)
           {
           // If we have a new event redirect to it
           return newEvent;
           }
           else
           {
           // Otherwise bubble up
           return context.dispatch();
           }
           }
           }
          }
          


          • 2. Re: problem with IPC

            Your ipc setting are for portlet a, and ipc implementation is in portlet b

            • 3. Re: problem with IPC
              sbiwal

              Hi,

              Thanks for your reply. My ipc listener is declared in portletB and even the settings are for portletB. I am attaching my jboss-service.xml here -

              <?xml version="1.0" encoding="UTF-8"?>
              
              <server>
              
               <!-- A sample listener -->
               <mbean
               code="org.jboss.portal.core.event.PortalEventListenerServiceImpl"
               name="portal:service=ListenerService,type=ipc_listener_hw"
               xmbean-dd=""
               xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
               <xmbean/>
               <depends
               optional-attribute-name="Registry"
               proxy-type="attribute">portal:service=ListenerRegistry</depends>
               <attribute name="RegistryId">ipc_listener_hw</attribute>
               <attribute name="ListenerClassName">org.jboss.portlet.hello.HelloWorldPortletB$Listener</attribute>
               </mbean>
              </server>
              


              This is my helloworld-object.xml file

              <?xml version="1.0" encoding="UTF-8"?>
              <deployments>
               <deployment>
               <parent-ref>default</parent-ref>
               <if-exists>overwrite</if-exists>
               <page>
               <page-name>IPC</page-name>
               <listener>ipc_listener_hw</listener>
               <properties/>
               <window>
               <window-name>HelloWorldPortletAWindow</window-name>
               <instance-ref>HelloWorldPortletAInstance</instance-ref>
               <region>left</region>
               <height>0</height>
               </window>
               <window>
               <window-name>HelloWorldPortletBWindow</window-name>
               <instance-ref>HelloWorldPortletBInstance</instance-ref>
               <region>center</region>
               <height>0</height>
               </window>
               </page>
               </deployment>
              </deployments>
              
              


              Please let me know if these settings are wrong. Your help will be highly appreciated

              • 4. Re: problem with IPC

                I am also facing same problem. Are you able to solve this issue?

                Regards,
                Ruchika

                • 5. Re: problem with IPC
                  sbiwal

                  Hi Ruchika,

                  Yes I was able to solve this problem. Firstly you must create a processAction method for your portletA (or the calling portlet). This is because we are generating an action event from the submit form of portletA.

                  Secondly listeners are registered for a portlet "window" and not the portlet instance. So listeners must be specified during the window deployment ie during the deployment of the -object.xml file.

                  Please let me know the exact problem you are facing and I will try to help you through it. IPC is working as intended for me.

                  • 6. Re: problem with IPC

                    Hello,

                    Thanks for your reply.
                    I am not able to follow your second step:

                    "Secondly listeners are registered for a portlet "window" and not the portlet instance. So listeners must be specified during the window deployment ie during the deployment of the -object.xml file."

                    How to specify listeners during window deployment?
                    I am very new to JBoss portal.

                    Regards,
                    Ruchika

                    • 7. Re: problem with IPC
                      sbiwal

                      Hi Ruchika,

                      There are three things important deployment descriptors for a portlet in JBoss -
                      1) portlet.xml - this file relates a portlet name to a portlet class
                      2) portlet-instances.xml - this file relates the portlet name defined above to a portlet instance. Now the same portlet can have more than one instances.
                      3) -object.xml - usually replace the part with the name of your portlet. This file defines a window (which is the actual view that you see in your portal) to a portlet instance. Once again the same portlet instance can be rendered using multiple windows eg you have your portlet instance in 2 or pages. The event listeners are bound to these windows. So when you declare this window (in your *-object.xml file), you should list the listener with it. Only this window of the portlet will listen to events (with the listener id specified by you) and not the other windows for the same portlet.

                      I am pasting an example of the *-object.xml file here -

                      <?xml version="1.0" encoding="UTF-8"?>
                      <deployments>
                       <deployment>
                       <parent-ref>myPortal</parent-ref>
                       <if-exists>overwrite</if-exists>
                       <page>
                       <page-name>MyPage</page-name>
                       <window>
                       <window-name>
                       MyPortletWindow1
                       </window-name>
                       <instance-ref>
                       MyPortletInstance
                       </instance-ref>
                       <listener>ipc_listener</listener>
                       <region>center</region>
                       <height>1</height>
                       </window>
                       <window>
                       <window-name>
                       MyPortletWindow2
                       </window-name>
                       <instance-ref>
                       MyPortletInstance
                       </instance-ref>
                       <region>left</region>
                       <height>1</height>
                       </window>
                       </page>
                       </deployment>
                      </deployments>


                      In the above file, note the following things -
                      1) You should have a portal with the name MyPortal.
                      2) Now a new page will be created in this portal - MyPage
                      3) The first window in this page - MyPortletWindow1 uses the instance MyPortletInstance and throws events with listener id ipc_listener. Whatever is your listener class associated with this listener id, will honor such events.
                      4) The second window in this page - MyPortletWindow2 uses the same portlet instance MyPortletInstance but does not throw events with the listener id ipc_listener
                      5) Now just specify your listener class in the jboss-service.xml descriptor (as specified in the reference guide) and you'll be done.

                      Please do not hesitate to ask me any more doubts. I struggled with this for a long time myself and would like it if my digging could help anyone.

                      • 8. Re: problem with IPC

                        Thanks for your help. This is working for me also :-)

                        Regards,
                        Ruchika

                        • 9. Re: problem with IPC
                          senthilkumar.devan

                          hey biwal/Ruchika,

                          Can u please help me in this.. i followed all your instructions but still its not working. I am request from protlet A but it doest not come to Portlet B process action and also no exceptions.. can u please tell me what should i do

                          • 10. Re: problem with IPC
                            sbiwal

                            Hi,

                            There is one more way to check that your portlets events are bound to any listeners.

                            Login as admin to your portal. Go to the admin link
                            Browse through your portal/pages to get to the portletA and portletB.
                            Now on the portlet window go to the "Properties" link. You should have the event listening binding mentioned on this page. Check if this is as your required.

                            My guess is that your portlet events are not bound to any listeners.

                            You can set your listeners from this admin link and also from the portlet descriptors.

                            • 11. Re: problem with IPC
                              senthilkumar.devan

                              Hi Biwal,

                              Thanks very much. Its working for me.
                              Once again thanx lot for ur help which really helped me lot in developing IPC.

                              Thanks & Regards,
                              Senthil Kumar Devan.

                              • 12. Re: problem with IPC
                                dilipreddy

                                HI sbiwal, senthilkumar,Ruchika,

                                please help me regarding this ipc issue....
                                I am explaning my problem here,


                                Can anyone help me in IPC problem. I have portlet A and portlet B. I am trying to trigger from portlet A The problem is request havent went for processaction method in porltet B.

                                Steps i have followed is...
                                1. I have created a war file
                                war files contains web-inf and meta-inf.

                                in meta-inf i have jboss-service.xml
                                Inside this xml i have following code

                                <?xml version="1.0" encoding="UTF-8"?>
                                server>

                                <!-- A sample listener -->
                                <mbean
                                code="org.jboss.portal.core.event.PortalEventListenerServiceImpl"
                                name="portal:service=ListenerService,type=test_listener"
                                xmbean-dd=""
                                xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">

                                <depends
                                optional-attribute-name="Registry"
                                proxy-type="attribute">portal:service=ListenerRegistry
                                test_listener
                                <!-- org.jboss.portal.core.samples.basic.event.PortletB$Listener-->
                                layout.test.PortletB1$Listener



                                I created PortletB1.java class in layout.test. package

                                and *-object.xml file is as follows:



                                <if-exists>overwrite</if-exists>
                                <parent-ref>Lay</parent-ref>

                                <page-name>event test</page-name>


                                <window-name>CatalogPortletWindow</window-name>
                                <instance-ref>CatalogPortletInstance</instance-ref>

                                left
                                0


                                <window-name>PortletA1Window</window-name>
                                <instance-ref>PortletA1Instance</instance-ref>
                                test_listener
                                center
                                0


                                <window-name>PortletB1Window</window-name>
                                <instance-ref>PortletB1Instance</instance-ref>
                                center
                                1






                                I am creating war file ant deploying it, when ever I am trying to submit it is displaying error msg?
                                on which format I want to deploy as .sar or .war file format.
                                plz help me regarding this issue..

                                or give me suggestions (you may mail to dileep4u.mca@gmail.com)

                                waiting for your reply..sbiwal,senthil,ruchika


                                Thanks & Regards,
                                Dileep




                                • 13. Re: problem with IPC
                                  sbiwal

                                  Hi Dileep,

                                  You said when you're trying to submit, you get an error message -

                                  1) What are you trying to submit ?
                                  2) What is the error message ?


                                  sbiwal

                                  • 14. Re: problem with IPC
                                    dilipreddy

                                    Hi Sbiwal,
                                    Thanks for your kind reply,
                                    In portlet A I am submiting color, when ever entering submiting button than porlet B`s text must convert to the submiting color.
                                    First it was giving error msg, it was solved.
                                    now it was not listening, after submiting color , the doView method is caling ....not executing listener class.

                                    Let me know, in which way the application has to deploy either in .sar or .war format
                                    I am trying as war file deployment. I am placing jboss-service.xml
                                    in META-INF.
                                    Here I am giving my console displaying information:

                                    .A in processAction..
                                    .A in doView..
                                    .A..URL../portal/Lay/event+test/PortletA1Window?action=1
                                    .B.in doView

                                    I try to print those statement in portlet A and porletB

                                    Please give me information regarding this issue.

                                    If you have the sample application than send me, this will useful for me

                                    waiting for your valuable reply.....

                                    Thanks & Regards,
                                    Dilip
                                    dileep4u.mca@gmail.com(if possible you can to this also)
                                    .B in doview..

                                    1 2 Previous Next