[jira] Commented: (OFBIZ-3988) Redirect from Http to Https causes double service call

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (OFBIZ-3988) Redirect from Http to Https causes double service call

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-3988?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12934296#action_12934296 ]

Jacques Le Roux commented on OFBIZ-3988:
----------------------------------------

Sorry Sascha,

I still don't get your point. Because if I apply your patch I still get 2 calls to the event

For instance here are the 2 tasks (1st call, 2d call from the same request) shown above but this time with the patch applied

Daemon Thread [http-0.0.0.0-28443-6] (Suspended (breakpoint at line 106 in org.ofbiz.ecommerce.misc.ThirdPartyEvents))
        org.ofbiz.ecommerce.misc.ThirdPartyEvents.updateAssociatedDistributor(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 106
        org.ofbiz.ecommerce.misc.ThirdPartyEvents.setAssociationId(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 90
        sun.reflect.NativeMethodAccessorImpl.invoke0(java.lang.reflect.Method, java.lang.Object, java.lang.Object[]) line: not available [native method]
        sun.reflect.NativeMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: not available
        sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: not available
        java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object...) line: not available
        org.ofbiz.webapp.event.JavaEventHandler.invoke(java.lang.String, java.lang.String, java.lang.Class<?>, java.lang.Class<?>[], java.lang.Object[]) line: 92
        org.ofbiz.webapp.event.JavaEventHandler.invoke(org.ofbiz.webapp.control.ConfigXMLReader$Event, org.ofbiz.webapp.control.ConfigXMLReader$RequestMap, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 78
        org.ofbiz.webapp.control.RequestHandler.runEvent(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.ofbiz.webapp.control.ConfigXMLReader$Event, org.ofbiz.webapp.control.ConfigXMLReader$RequestMap, java.lang.String) line: 635
        org.ofbiz.webapp.control.RequestHandler.doRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String, org.ofbiz.entity.GenericValue, org.ofbiz.entity.Delegator) line: 299
        org.ofbiz.webapp.control.ControlServlet.doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 230
        org.ofbiz.webapp.control.ControlServlet(javax.servlet.http.HttpServlet).service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 617
        org.ofbiz.webapp.control.ControlServlet(javax.servlet.http.HttpServlet).service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 717
        org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 290
        org.apache.catalina.core.ApplicationFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 206
        org.ofbiz.webapp.control.ContextFilter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) line: 332
        org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 235
        org.apache.catalina.core.ApplicationFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 206
        org.apache.catalina.core.StandardWrapperValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 233
        org.apache.catalina.core.StandardContextValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 191
        org.apache.catalina.core.StandardHostValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 127
        org.apache.catalina.valves.ErrorReportValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 102
        org.apache.catalina.core.StandardEngineValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 109
        org.apache.catalina.valves.AccessLogValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 555
        org.apache.catalina.connector.CoyoteAdapter.service(org.apache.coyote.Request, org.apache.coyote.Response) line: 298
        org.apache.coyote.http11.Http11Processor.process(java.net.Socket) line: 857
        org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(java.net.Socket) line: 588
        org.apache.tomcat.util.net.JIoEndpoint$Worker.run() line: 489
        java.lang.Thread.run() line: not available


Daemon Thread [http-0.0.0.0-28443-6] (Suspended (breakpoint at line 106 in org.ofbiz.ecommerce.misc.ThirdPartyEvents))
        org.ofbiz.ecommerce.misc.ThirdPartyEvents.updateAssociatedDistributor(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 106
        org.ofbiz.ecommerce.misc.ThirdPartyEvents.setAssociationId(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 90
        sun.reflect.NativeMethodAccessorImpl.invoke0(java.lang.reflect.Method, java.lang.Object, java.lang.Object[]) line: not available [native method]
        sun.reflect.NativeMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: not available
        sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: not available
        java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object...) line: not available
        org.ofbiz.webapp.event.JavaEventHandler.invoke(java.lang.String, java.lang.String, java.lang.Class<?>, java.lang.Class<?>[], java.lang.Object[]) line: 92
        org.ofbiz.webapp.event.JavaEventHandler.invoke(org.ofbiz.webapp.control.ConfigXMLReader$Event, org.ofbiz.webapp.control.ConfigXMLReader$RequestMap, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 78
        org.ofbiz.webapp.control.RequestHandler.runEvent(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.ofbiz.webapp.control.ConfigXMLReader$Event, org.ofbiz.webapp.control.ConfigXMLReader$RequestMap, java.lang.String) line: 635
        org.ofbiz.webapp.control.RequestHandler.doRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String, org.ofbiz.entity.GenericValue, org.ofbiz.entity.Delegator) line: 381
        org.ofbiz.webapp.control.ControlServlet.doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 230
        org.ofbiz.webapp.control.ControlServlet(javax.servlet.http.HttpServlet).service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 617
        org.ofbiz.webapp.control.ControlServlet(javax.servlet.http.HttpServlet).service(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 717
        org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 290
        org.apache.catalina.core.ApplicationFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 206
        org.ofbiz.webapp.control.ContextFilter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) line: 332
        org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 235
        org.apache.catalina.core.ApplicationFilterChain.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse) line: 206
        org.apache.catalina.core.StandardWrapperValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 233
        org.apache.catalina.core.StandardContextValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 191
        org.apache.catalina.core.StandardHostValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 127
        org.apache.catalina.valves.ErrorReportValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 102
        org.apache.catalina.core.StandardEngineValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 109
        org.apache.catalina.valves.AccessLogValve.invoke(org.apache.catalina.connector.Request, org.apache.catalina.connector.Response) line: 555
        org.apache.catalina.connector.CoyoteAdapter.service(org.apache.coyote.Request, org.apache.coyote.Response) line: 298
        org.apache.coyote.http11.Http11Processor.process(java.net.Socket) line: 857
        org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(java.net.Socket) line: 588
        org.apache.tomcat.util.net.JIoEndpoint$Worker.run() line: 489
        java.lang.Thread.run() line: not available


As you can see the only difference are these lines
org.ofbiz.webapp.control.RequestHandler.doRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String, org.ofbiz.entity.GenericValue, org.ofbiz.entity.Delegator) line: 299
org.ofbiz.webapp.control.RequestHandler.doRequest(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String, org.ofbiz.entity.GenericValue, org.ofbiz.entity.Delegator) line: 381

But still 2 calls to the event. I did not digg further

> Redirect from Http to Https causes double service call
> ------------------------------------------------------
>
>                 Key: OFBIZ-3988
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-3988
>             Project: OFBiz
>          Issue Type: Bug
>          Components: ALL COMPONENTS
>    Affects Versions: SVN trunk
>            Reporter: Sascha Rodekamp
>             Fix For: SVN trunk
>
>         Attachments: OFBIZ-3988_RequestHandler.java.patch
>
>
> Hi guys,
> little patch a big effect :)
> The problem is, when you call a request over http, but the controller wants an https request, the RequestHandler make an redirect to https (which is indeed pretty cool). But this redirect causes that Events/ Services will be called twice.
> This can be avoided when we return from the Service/ Event directly after doing the redirect.
> Have a good day
> Sascha

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.