Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-6708

Missing userLogin error on party profile screen when 1st content is non public

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: Trunk
    • Fix Version/s: 14.12.01, 13.07.03, 16.11.01
    • Component/s: party
    • Labels:
      None

      Description

      When a party has a 1st non public content the serveObjectData event is called in party profile screen and it misses the userLogin in session.

      This was implemented with r1199681 (see this) which is a bad hack. I guess the idea was if a "Logo Image URL" was assigned to a party like "Company" it should be displayed in the profile screen, that works w/o error in the log. But when you have a party 1st non public content of other type for other parties (like admin for instance) it does not make sense, and show an error in log.

           [java] 2015-11-03 12:05:12,856 |ttp-bio-8443-exec-11 |DataEvents                    |E| null
           [java] org.ofbiz.service.ServiceAuthException: User authorization is required for this service: genericContentPermission
           [java]     at org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:356) ~[ofbiz-service.jar:?]
           [java]     at org.ofbiz.service.ServiceDispatcher.runSync(ServiceDispatcher.java:227) ~[ofbiz-service.jar:?]
           [java]     at org.ofbiz.service.GenericDispatcherFactory$GenericDispatcher.runSync(GenericDispatcherFactory.java:88) ~[ofbiz-service.jar:?]
           [java]     at org.ofbiz.content.data.DataEvents.serveObjectData(DataEvents.java:139) [ofbiz-content.jar:?]
           [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51]
           [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51]
           [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51]
           [java]     at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51]
           [java]     at org.ofbiz.webapp.event.JavaEventHandler.invoke(JavaEventHandler.java:92) [ofbiz-webapp.jar:?]
           [java]     at org.ofbiz.webapp.event.JavaEventHandler.invoke(JavaEventHandler.java:78) [ofbiz-webapp.jar:?]
           [java]     at org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java:759) [ofbiz-webapp.jar:?]
           [java]     at org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.java:476) [ofbiz-webapp.jar:?]
           [java]     at org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:213) [ofbiz-webapp.jar:?]
           [java]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:620) [servlet-api-3.0.jar:?]
           [java]     at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) [servlet-api-3.0.jar:?]
           [java]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) [tomcat-7.0.64-catalina.jar:7.0.64]
           [java]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [tomcat-7.0.64-catalina.jar:7.0.64]
           [java]     at org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:324) [ofbiz-webapp.jar:?]
           [java]     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [tomcat-7.0.64-catalina.jar:7.0.64]
           [java]     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [tomcat-7.0.64-catalina.jar:7.0.64]
           [java]     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) [tomcat-7.0.64-catalina.jar:7.0.64]
           [java]     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) [tomcat-7.0.64-catalina.jar:7.0.64]
           [java]     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) [tomcat-7.0.64-catalina.jar:7.0.64]
           [java]     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) [tomcat-7.0.64-catalina.jar:7.0.64]
           [java]     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) [tomcat-7.0.64-catalina.jar:7.0.64]
           [java]     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) [tomcat-7.0.64-catalina.jar:7.0.64]
           [java]     at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956) [tomcat-7.0.64-catalina.jar:7.0.64]
           [java]     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423) [tomcat-7.0.64-catalina.jar:7.0.64]
           [java]     at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079) [tomcat-7.0.64-tomcat-coyote.jar:7.0.64]
           [java]     at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625) [tomcat-7.0.64-tomcat-coyote.jar:7.0.64]
           [java]     at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318) [tomcat-7.0.64-tomcat-coyote.jar:7.0.64]
           [java]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_51]
           [java]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_51]
           [java]     at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-7.0.64-tomcat-coyote.jar:7.0.64]
           [java]     at java.lang.Thread.run(Thread.java:745) [?:1.8.0_51]
           [java] 2015-11-03 12:05:12,857 |ttp-bio-8443-exec-11 |RequestHandler                |I| Ran Event [java:org.ofbiz.content.data.DataEvents#serveObjectData] from [request], result is [error]
           [java] 2015-11-03 12:05:12,857 |ttp-bio-8443-exec-11 |RequestHandler                |E| Request stream caused an error with the following message: User authorization is required for this service: generic

      I thought that passing the userLogin in session as in

                      <set field="setUserLogin" value="${groovy:session.setAttribute('userLogin', userLogin)}"/> <!-- needed by serveObjectData  -->
                      <set field="partyContentId" from-field="partyContentList[0].contentId"/>
                      <set field="partyContent" value="${groovy: partyContentId!=null?'/content/control/stream?contentId=' + partyContentId : ''}"/>
      

      would work, but for a reason it does not (still no userLogin in session, I must do something wrong), and I have no longer time to investigate today...

        Attachments

        1. OFBIZ-6708.patch
          2 kB
          Vishal Chhabria

          Issue Links

            Activity

              People

              • Assignee:
                deepak.dixit Deepak Dixit
                Reporter:
                jacques.le.roux Jacques Le Roux
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: