[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=12930643#action_12930643 ]

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

Sascha,

Not quite sure, here are the two stacks I got:

Daemon Thread [http-0.0.0.0-38443-5] (Suspended (breakpoint at line 175 in org.ofbiz.ecommerce.misc.ThirdPartyEvents))
        org.ofbiz.ecommerce.misc.ThirdPartyEvents.updateAssociatedDistributor(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 175
        org.ofbiz.ecommerce.misc.ThirdPartyEvents.setAssociationId(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 90
        sun.reflect.GeneratedMethodAccessor148.invoke(java.lang.Object, java.lang.Object[]) line: not available
        sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: 25
        java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object...) line: 597
        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: 633
        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: 297
        org.ofbiz.webapp.control.ControlServlet.doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 224
        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: 271
        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: 662


Daemon Thread [http-0.0.0.0-38443-5] (Suspended (breakpoint at line 175 in org.ofbiz.ecommerce.misc.ThirdPartyEvents))
        org.ofbiz.ecommerce.misc.ThirdPartyEvents.updateAssociatedDistributor(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 175
        org.ofbiz.ecommerce.misc.ThirdPartyEvents.setAssociationId(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 90
        sun.reflect.GeneratedMethodAccessor148.invoke(java.lang.Object, java.lang.Object[]) line: not available
        sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: 25
        java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object...) line: 597
        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: 633
        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: 379
        org.ofbiz.webapp.control.ControlServlet.doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) line: 224
        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: 271
        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: 662

As you can see they are the same but the call from lines 297 and 379 in RequestHandler.doRequest. There are no calls from RequestHandler.java:694 in these stacks. So I think I still miss a piece in the puzzle (I use http://localhost:8080/ecommerce/control/main and then the URL you provided)

Thanks

> 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.