Hello, Alex,
I have a problem as seen in the subject. I viewed the log file and get the error message below: +----------------------------------------------------------------------------------------------------------------------+ |An Error has Occurred | |----------------------------------------------------------------------------------------------------------------------| |xf:submission for submission id: logout, error code received when submitting instance: 401 | |----------------------------------------------------------------------------------------------------------------------| |Application Call Stack | |----------------------------------------------------------------------------------------------------------------------| |----------------------------------------------------------------------------------------------------------------------| |Exception: org.orbeon.oxf.xforms.submission.XFormsSubmissionException | Here is the source code about logout function: top-menu.xhtml Henry |
Administrator
|
Hi Henry,
I can't see the source of your xf:submission in top-menu.xhtml, but suspect that if it runs some code that invalidates the session, which is usually what is involved with logging the user out, then the XForms engine won't be happy not to have a valid session. Instead, I'd recommend you send the user to another page that doesn't use XForms (e.g. in XPL or JSP) and does the logout. Also, see this discussion with Florian from earlier this year, which is related: http://discuss.orbeon.com/Migration-3-9-gt-4-9-Session-invalidation-and-redirect-td4660181.html Alex
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Hello, Alex,
I have seen your solution, however, we are using a trigger/load method.The submission is just for a database update. Here is the source code: <xf:submission id="logout" method="post" replace="none" validate="false" f:url-norewrite="true" resource="{instance('queries-url')/auth}/users/login.xq?action=logout&ip={instance('user')/ip}&station={if (instance('user')/submapping != '') then instance('user')/submapping/@label else instance('user')/mapping/@label}"/> <xf:action ev:event="xforms-submit-done" ev:observer="logout"> <xf:insert context="." origin="xxforms:set-session-attribute('account', ())"/> <xf:insert context="." origin="xxforms:set-session-attribute('pass', ())"/> <xf:insert context="." origin="xxforms:set-session-attribute('search-query', ())"/> <xf:load resource="/login/"/> </xf:action> Henry |
Administrator
|
Henry,
What does the login.xq do? Does it invalidate the session? This would explain the problem. Instead, I think you need to send the user to a page that invalidates the session, and this without using XForms. Alex
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Hi, Alex,
login.xq just updates timestamps in XML database, the only way we "invalidate" the session is via those <xf:insert context="." origin="xxforms:set-session-attribute('account', ())"/> statements, followed by a "xf:load" of the login page. It cannot resolve oxf:/login/ so even if I try to change xf:load to oxf:/logout/ , it cannot resolve it , and therefore its not tranfering to a xforms page... Henry |
Administrator
|
Hi Henry,
Got it: login.xq isn't invalidating the session, as I thought. So this might be another issue. The error you got, per your first message in this thread, was: "xf:submission for submission id: logout, error code received when submitting instance: 401". Why would the service return that error? Maybe that would be something to look into? Alex
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Hi Alex,
Sorry, I think Henry provided an incorrect error log.. there is in fact no error, but browser does get "page not found" on "oxf:/logout" ... ie. it tries a literal oxf:/logout url Here are the debug logs for the logout submission, in case it sheds any light. -Bob 2015-11-26 16:46:37,743 DEBUG XFormsServer - start submission {id: "logout"} 2015-11-26 16:46:37,745 DEBUG XFormsServer - optimized dispatching {name: "xforms-submit-serialize", target: "logout", native handlers called: "0"} 2015-11-26 16:46:37,746 DEBUG XFormsServer - checking whether local portlet submission is allowed {resource: "http://blabj:xxxxxxxx@...:8008/users/login.xq?action=logout&ip=192.168.202.9&station=", container type: "servlet", deployment type: "standalone"} 2015-11-26 16:46:37,746 DEBUG XFormsServer - skipping local portlet submission {reason: "resource URL has protocol", resource: "http://blabj:xxxxxxxxx@...:8008/users/login.xq?action=logout&ip=192.168.202.9&station="} 2015-11-26 16:46:37,746 DEBUG XFormsServer - checking whether request dispatcher submission is allowed {resource: "http://blabj:xxxxxxxx@...:8008/users/login.xq?action=logout&ip=192.168.202.9&station=", noscript: "false", is asynchronous: "false", container type: "servlet", norewrite: "true", local-submission-forward: "false", local-submission-include: "false"} 2015-11-26 16:46:37,746 DEBUG XFormsServer - skipping request dispatcher servlet submission {reason: "deployment type is not separate"} 2015-11-26 16:46:37,746 DEBUG XFormsServer - start connecting {type: "regular"} 2015-11-26 16:46:37,746 DEBUG XFormsServer - loaded HTTP state {scope: "session"} 2015-11-26 16:46:37,746 DEBUG XFormsServer - start opening connection 2015-11-26 16:46:37,833 DEBUG XFormsServer - opening URL connection {method: "POST", URL: "http://blabj:xxxxxxxx@...:8008/users/login.xq?action=logout&ip=192.168.202.9&station=", Content-Type: "application/xml", Orbeon-Token: "87a9f38023e629d726a0335d8e6273edb0c01f43"} 2015-11-26 16:46:37,834 DEBUG XFormsServer - response {status code: "200"} 2015-11-26 16:46:37,834 DEBUG XFormsServer - response headers {Server: "MarkLogic", Keep-Alive: "timeout=5", Connection: "Keep-Alive", Content-Length: "32", Content-Type: "text/xml; charset=UTF-8"} 2015-11-26 16:46:37,834 DEBUG XFormsServer - response has content 2015-11-26 16:46:37,834 DEBUG XFormsServer - saved HTTP state {scope: "session"} 2015-11-26 16:46:37,834 DEBUG XFormsServer - end opening connection {time (ms): "88"} 2015-11-26 16:46:37,834 DEBUG XFormsServer - end connecting {time (ms): "88"} 2015-11-26 16:46:37,834 DEBUG XFormsServer - start handling result 2015-11-26 16:46:37,834 DEBUG XFormsServer - end handling result {time (ms): "0"} 2015-11-26 16:46:37,834 DEBUG XFormsServer - end submission {time (ms): "91"} 2015-11-26 16:46:37,834 DEBUG XFormsServer - start dispatching {name: "xforms-submit-done", target: "logout"} 2015-11-26 16:46:37,834 DEBUG XFormsServer - start handler {name: "xforms-submit-done", phase: "target", observer: "logout"} 2015-11-26 16:46:37,834 DEBUG XFormsServer - interpreter - start executing {action name: "xf:action"} 2015-11-26 16:46:37,834 DEBUG XFormsServer - interpreter - start executing {action name: "xf:insert"} 2015-11-26 16:46:37,835 DEBUG XFormsServer - xf:insert - origin node-set is empty, terminating 2015-11-26 16:46:37,835 DEBUG XFormsServer - interpreter - end executing {time (ms): "1", action name: "xf:insert"} 2015-11-26 16:46:37,835 DEBUG XFormsServer - interpreter - start executing {action name: "xf:insert"} 2015-11-26 16:46:37,835 DEBUG XFormsServer - xf:insert - origin node-set is empty, terminating 2015-11-26 16:46:37,835 DEBUG XFormsServer - interpreter - end executing {time (ms): "0", action name: "xf:insert"} 2015-11-26 16:46:37,835 DEBUG XFormsServer - interpreter - start executing {action name: "xf:insert"} 2015-11-26 16:46:37,835 DEBUG XFormsServer - xf:insert - origin node-set is empty, terminating 2015-11-26 16:46:37,835 DEBUG XFormsServer - interpreter - end executing {time (ms): "0", action name: "xf:insert"} 2015-11-26 16:46:37,835 DEBUG XFormsServer - interpreter - start executing {action name: "xf:load"} 2015-11-26 16:46:37,835 DEBUG XFormsServer - interpreter - end executing {time (ms): "0", action name: "xf:load"} 2015-11-26 16:46:37,835 DEBUG XFormsServer - interpreter - end executing {time (ms): "1", action name: "xf:action"} 2015-11-26 16:46:37,835 DEBUG XFormsServer - end handler {time (ms): "1"} 2015-11-26 16:46:37,836 DEBUG XFormsServer - end dispatching {time (ms): "1", regular handlers called: "1", native handlers called: "0"} 2015-11-26 16:46:37,836 DEBUG XFormsServer - optimized dispatching {name: "xforms-submit", target: "logout", native handlers called: "0"} 2015-11-26 16:46:37,836 DEBUG XFormsServer - interpreter - end executing {time (ms): "94", action name: "xf:send"} 2015-11-26 16:46:37,836 DEBUG XFormsServer - end handler {time (ms): "94"} 2015-11-26 16:46:37,836 DEBUG XFormsServer - end dispatching {time (ms): "94", regular handlers called: "1", native handlers called: "0"} 2015-11-26 16:46:37,836 DEBUG XFormsServer - end handling external event {time (ms): "94"} 2015-11-26 16:46:37,836 DEBUG XFormsServer - end handling external events and/or uploaded files {time (ms): "95"} 2015-11-26 16:46:37,836 DEBUG XFormsServer - response - start handling regular Ajax response 2015-11-26 16:46:37,836 DEBUG XFormsServer - response - end handling regular Ajax response {time (ms): "0", ajax response: " <xxf:event-response xmlns:xxf="http://orbeon.org/oxf/xml/xforms"> <xxf:action> <xxf:control-values/> <xxf:load resource="oxf:/logout/" show="replace"/> </xxf:action> </xxf:event-response>"} On 11/26/2015 03:10 PM, Alessandro Vernet wrote: > Hi Henry, > > Got it: login.xq isn't invalidating the session, as I thought. So this might > be another issue. The error you got, per your first message in this thread, > was: "xf:submission for submission id: logout, error code received when > submitting instance: 401". > > Why would the service return that error? Maybe that would be something to > look into? > > Alex > > ----- -- You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. |
Ok, I've reduced it to a simple test case, files below. It seems the
issue is with the xf:load from an included file.. If I put the model.xhtml directly into the controller.xhtml, then in loads "/logout/" properly. But from an include, the result is "oxf:/logout", which browser does not understand. -Bob testlogout/controller.xhtml: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xxi="http://orbeon.org/oxf/xml/xinclude" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xmlns:f="http://orbeon.org/oxf/xml/formatting"> <head> <title>Test Logout Button</title> <xf:model> <xi:include href="oxf:/apps/model.xhtml" xpointer="xpath(/*/*)"/> </xf:model> </head> <body class="orbeon"> <!-- Logout Button --> <xf:trigger xxforms:modal="true"> <xf:label>Logout</xf:label> <xf:send submission="logout" ev:event="DOMActivate"/> </xf:trigger> </body> </html> /apps/model.xhtml: <include xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xxi="http://orbeon.org/oxf/xml/xinclude" xmlns:xf="http://www.w3.org/2002/xforms" xmlns:xxf="http://orbeon.org/oxf/xml/xforms" xmlns:fr="http://orbeon.org/oxf/xml/form-runner" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xh="http://www.w3.org/1999/xhtml" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xf:instance id="someid"> <data/> </xf:instance> <!-- Logout --> <xf:submission id="logout" ref="instance('someid')" method="post" action="echo:" replace="instance" instance="someid"/> <xf:action ev:event="xforms-submit-done" ev:observer="logout"> <xf:load resource="/logout/"/> </xf:action> </include> -- You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. |
Administrator
|
Hi Henry,
Sorry for the late response, and in case this is still helpful, to solve this you need to add xxi:omit-xml-base="true" on the <xi:include>, that is: <xi:include href="oxf:/apps/model.xhtml" xpointer="xpath(/*/*)" xxi:omit-xml-base="true"/> Relative paths are resolved related to a base path. When the controller.xhtml is loaded by the page flow, the base path is set to the URL used by the user to access that page. However by default xf:include sets the base path to the location of the file being loaded. In some cases, this is what you want. In others, you'd rather like the base path to be inherited from the document doing the inclusion, and adding xxi:omit-xml-base="true" trigger this latter behavior. I hope this helps, Alex
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Free forum by Nabble | Edit this page |