Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-49820

JSONObjectImpl not serializable, so sending a message with a json object fails

    Details

      Description

      discovered while testing LPS-49691

      LPS-49691 sends notification events across the cluster so that users on other nodes are notified when a new notification happens without having to sign out and sign back in again.

      1. set up a two node cluster
      2. deploy SO on both nodes
      3. log in as "test" and add another user "user"
      4. add "user" to SO through the SO Configuration
      5. log in as "user" in a different browser on the second node (e.g. "test" is on node1 and "user" is on node2)
      this is necessary because otherwise the JSONObjectImpl will not be un-serialized

      6. as "test" send a connection request to "user"

      actual result: a NotSerializableException is thrown because of JSONObjectImpl. No notification is sent across the cluster and "user" is not notified
      expected result: no exception occurs and when "user" refreshes the page, the notification appears in the dockbar

      java.io.NotSerializableException: com.liferay.portal.json.JSONObjectImpl
              at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1183)
              at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547)
              at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508)
              at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431)
              at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177)
              at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1377)
              at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1173)
              at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547)
              at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508)
              at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431)
              at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177)
              at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547)
              at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508)
              at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431)
              at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177)
              at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347)
              at org.jgroups.util.Util.objectToByteBuffer(Util.java:528)
              at org.jgroups.Message.setObject(Message.java:342)
              at org.jgroups.Message.<init>(Message.java:193)
              at org.jgroups.JChannel.send(JChannel.java:425)
              at com.liferay.portal.cluster.ClusterExecutorImpl.execute(ClusterExecutorImpl.java:157)
              at com.liferay.portal.kernel.cluster.ClusterExecutorUtil.execute(ClusterExecutorUtil.java:63)
              at com.liferay.portal.notifications.ChannelHubManagerImpl.sendClusterNotificationEvent(ChannelHubManagerImpl.java:330)
              at com.liferay.portal.kernel.notifications.ChannelHubManagerUtil.sendClusterNotificationEvent(ChannelHubManagerUtil.java:224)
              at com.liferay.contacts.contactscenter.portlet.ContactsCenterPortlet.sendNotificationEvent(ContactsCenterPortlet.java:1080)
              at com.liferay.contacts.contactscenter.portlet.ContactsCenterPortlet.requestSocialRelation(ContactsCenterPortlet.java:388)
              at com.liferay.contacts.contactscenter.portlet.ContactsCenterPortlet.processAction(ContactsCenterPortlet.java:322)
              at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:71)
              at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:48)
              at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:111)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:73)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:85)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
              at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
              at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:605)
              at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:544)
              at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:602)
              at com.liferay.portlet.InvokerPortletImpl.invokeAction(InvokerPortletImpl.java:647)
              at com.liferay.portlet.InvokerPortletImpl.processAction(InvokerPortletImpl.java:315)
              at com.liferay.portlet.MonitoringPortlet.processAction(MonitoringPortlet.java:184)
              at com.liferay.portal.action.LayoutAction.processPortletRequest(LayoutAction.java:989)
              at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:701)
              at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:261)
              at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
              at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
              at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:181)
              at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
              at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
              at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:567)
              at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:544)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:73)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:117)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:117)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:117)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:117)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
              at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:314)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:117)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
              at com.liferay.portal.servlet.filters.jsoncontenttype.JSONContentTypeFilter.processFilter(JSONContentTypeFilter.java:42)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:85)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
              at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
              at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
              at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
              at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
              at com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:139)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:73)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:117)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
              at com.liferay.portal.servlet.filters.strip.StripFilter.processFilter(StripFilter.java:358)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:117)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
              at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:123)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
              at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:314)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
              at com.liferay.portal.servlet.filters.i18n.I18nFilter.processFilter(I18nFilter.java:264)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:117)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:117)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
              at com.liferay.portal.servlet.filters.etag.ETagFilter.processFilter(ETagFilter.java:86)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
              at com.liferay.portal.servlet.filters.jsoncontenttype.JSONContentTypeFilter.processFilter(JSONContentTypeFilter.java:42)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
              at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:260)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
              at com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter.processFilter(NtlmPostFilter.java:83)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
              at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:88)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
              at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
              at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:191)
              at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:188)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:117)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:117)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:117)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:117)
              at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:168)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:117)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:168)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:117)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:188)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
              at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:85)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
              at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
              at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
              at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
              at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
              at java.lang.Thread.run(Thread.java:745)
      
      21:04:11,382 ERROR [http-bio-8080-exec-2][render_portlet_jsp:132]
      java.io.NotSerializableException: com.liferay.portal.json.JSONObjectImpl
              at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1183)
              at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547)
              at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508)
              at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431)
              at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177)
              at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1377)
              at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1173)
              at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547)
              at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508)
              at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431)
              at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177)
              at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1547)
              at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1508)
              at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1431)
              at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177)
              at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347)
              at org.jgroups.util.Util.objectToByteBuffer(Util.java:528)
              at org.jgroups.Message.setObject(Message.java:342)
              at org.jgroups.Message.<init>(Message.java:193)
              at org.jgroups.JChannel.send(JChannel.java:425)
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  4 years, 28 weeks ago