Orbeon separate deployment - 404 error

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Orbeon separate deployment - 404 error

Finian O'Boyle
Hi,

I'm trying to setup Orbeon 2017.2.201712300816-CE as a separate deployment
with eXist 3.6.0 sending XForms to it via
org.orbeon.oxf.servlet.OrbeonXFormsFilter. This all takes place within
Tomcat 9.0.8 with a default port of 8787 running on Ubuntu 18.04. This is as
part of a conversion from betterFORM, for which support within eXist is
being downgraded.

I can get XForms pages to display as expected, with a single exception. When
an instance refers to a resource within eXist, say ...

    <xf:instance id="locations-instance" src="/restxq/locations"/>

... Orbeon raises an error

    Got invalid return code while loading URI:
http://192.168.1.100:8787/exist/restxq/locations, 404

This is raised by org.orbeon.oxf.processor.URIProcessorOutputImpl.java at
line 402.

If I use ...

    <xf:instance id="locations-instance"
src="http://192.168.1.100:8787/exist/restxq/locations"/>

... I get the same Orbeon error, despite the fact that when I enter the URL
in a browser it returns the XML.

 However if I set up a second connector on Tomcat at port 9595 and use ...

    <xf:instance id="locations-instance"
src="http://192.168.1.100:9595/exist/restxq/locations"/>

... the instance is initialized as expected.

Obviously, I can prefix all the relative URLs within XHTML/XForms pages with
the absolute address, pointing to port 9595, but this seems inelegant, and
I'd like to know what I'm doing wrong or what is going wrong.

I have been puzzling over this for days, reviewing Orbeon Community
Mailings, Tomcat security configurations and web.xml settings to no avail. I
would appreciate any help.

Finian

--
Sent from: http://discuss.orbeon.com/

--
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].
Reply | Threaded
Open this post in threaded view
|

Re: Orbeon separate deployment - 404 error

Finian O'Boyle
I think I understand a little better why I'm getting a 404, having done more
testing and reading the log. Orbeon is not telling me that it can't find my
resource within eXist. It's saying that it can't find a page-flow.xml -
here's the relevant log line:

    INFO  PageFlowControllerProcessor  - not found {controller:
"oxf:/ops/xforms/xforms-renderer-page-flow.xml", method: "GET", path:
"/restxq/locations"}

Is there any syntax I can use on <xf:instance> that will tell Orbeon to
resolve the relative URL without referring to a page-flow.xml? I've also
identified the same issue on <xf:submission/>, where I get a similar
message:

    INFO  PageFlowControllerProcessor  - not found {controller:
"oxf:/page-flow.xml", method: "POST", path: "/orbeonxq/pictures/search",
resource: "/apps/orbeonxq/page-flow.xml"}

Any pointers, even to say "No, this can't be done" would be helpful.


Finian

--
Sent from: http://discuss.orbeon.com/

--
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].
Reply | Threaded
Open this post in threaded view
|

Re: Orbeon separate deployment - 404 error

Alessandro  Vernet
Administrator
Hi Finian,

I find it strange that it doesn't work when using the full path (and not a
different port). Could you set logging per the "Development configuration"
(see 1st link below), reproduce the problem when using
`src="http://192.168.1.100:8787/exist/restxq/locations"`, and attach the
`orbeon.log` to your response?

https://doc.orbeon.com/configuration/advanced/xforms-logging#development-configuration

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
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].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Orbeon separate deployment - 404 error

Finian O'Boyle
Hi Alex,

I agree with you - that puzzled me too. Here's the log using the settings
you advised.

Finian

orbeon-log.txt <http://discuss.orbeon.com/file/t375652/orbeon-log.txt>  

--
Sent from: http://discuss.orbeon.com/

--
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].
Reply | Threaded
Open this post in threaded view
|

Re: Orbeon separate deployment - 404 error

Alessandro  Vernet
Administrator
Hi Finian,

It indeed looks as if the request for
http://192.168.1.100:8787/exist/restxq/locations is incorrectly routed to
Orbeon Forms, to the path /restxq/locations, as if Orbeon Forms believed it
was deployed on http://192.168.1.100:8787/exist. But in your case, it is
deployed on http://192.168.1.100:8787/orbeon, correct?

If this is the case, this looks like a bug to be. As a temporary workaround,
could you on the <xf:instance> add the following. You'll let me know if this
helps.

xmlns:f="http://orbeon.org/oxf/xml/formatting" f:url-norewrite="false"

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
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].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Orbeon separate deployment - 404 error

Finian O'Boyle
Hi Alex

You are right: Orbeon is deployed at http://192.168.1.100:8787/orbeon

Unfortunately, your suggestion of using
xmlns:f="http://orbeon.org/oxf/xml/formatting" f:url-norewrite="false"
doesn't change outputs. It returns the same 404 error, with what looks like
an identical stack trace:

orbeon-log-with-fix.txt
<http://discuss.orbeon.com/file/t375652/orbeon-log-with-fix.txt>  

If I use <xf:instance id="locations-instance"
src="http://192.168.1.100:9595/exist/restxq/locations"/> I get the expected
web page and the log looks like:

orbeon-ok-log.txt <http://discuss.orbeon.com/file/t375652/orbeon-ok-log.txt>  

In my own mind, comparing the two logs, it seems in the error that Orbeon
does some sort of check on the URL and as a result uses
oxf:/ops/xforms/xforms-renderer-page-flow.xml to search for an XForms page
within Orbeon rather than loading XML data.

It's also worth saying that HTML hrefs are resolved correctly from eXist, so
the following work as expected

    <link rel="stylesheet" type="text/css"
href="/apps/pictures/css/pictures.css"/>
    <link rel="icon" href="/apps/common/images/ballimore.ico"
type="image/vnd.microsoft.icon"/>

Finian

--
Sent from: http://discuss.orbeon.com/

--
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].
Reply | Threaded
Open this post in threaded view
|

Re: Orbeon separate deployment - 404 error

Alessandro  Vernet
Administrator
Hi Finian,

Thank you for the detailed report. I was hoping to find some time to look to
reproduce and debug the issue, but I was unable to do so. If you happen to
be using Orbeon Forms PE, I'd recommend you submit this issue on your
Basecamp project, and if not, I'm afraid that you will have to find a
workaround or debug the issue on your side.

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
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].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Orbeon separate deployment - 404 error

Finian O'Boyle
Hi Alex,

Thank you for the time you have already taken looking at this. I don't have
Orbeon Forms PE - I will continue to investigate using CE and if I come up
with anything that seems useful, I will add it to this thread.

Thanks,

Finian

--
Sent from: http://discuss.orbeon.com/

--
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].
Reply | Threaded
Open this post in threaded view
|

Re: Orbeon separate deployment - 404 error

Alessandro  Vernet
Administrator
Got it Finian, and thank you for your understanding. Of course, in the
process just let me know if you're stuck on anything and there are any quick
pointers that I could give you and that could help. You'll let me know how
it works out!

Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
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].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Orbeon separate deployment - 404 error

Finian O'Boyle
Hi Alex,

I've managed to resolve this after a little investigation:

When presented with the URL
"http://192.168.1.100:8787/exist/restxq/locations",
org.orbeon.oxf.util.Connection.scala, before it makes a connection, uses
isInternalPath() to determine whether this is an external call to an
internal Orbeon resource. This method accesses the property
oxf.http.internal-paths, which is located at /config/properties-internal.xml
in orbeon-code.jar, and which contains a regex for matching internal paths.

The default value is "(?!/exist/)/.*(?&lt;!\.jsp)" which matches the path
"/exist/restxq/locations". This match means Connection strips the leading
"http://192.168.1.100:8787" and treats "/exist/restxq/locations" as an
internal Orbeon resource. This causes a 404 HTTP return.

The answer is to specify <property as="xs:string"
name="oxf.http.internal-paths" value="xyz.*"/> in properties-local.xml. This
causes the check for internal resource to fail and the resource is retrieved
successfully from the full URL.

The comment attached to this property in properties-internal.xml says " ...
we don't support anymore those requests being made over the network, so this
property shouldn't be changed by users, and thus isn't listed in the
documentation." However this doesn't take account of a separate deployment
of Orbeon, where the XForms script being processed contains a legitimate
reference to a cross-context eXist servlet which happens to reside at
"/webapps/exist".

The separate deployment I've been testing of Orbeon 2018.2 alongside eXist
5.0.0-RC5 has been very successful and has demonstrated that Orbeon can
provide powerful and flexible XForms features on top of the latest version
of eXist. I don't know how many other users would want to do this, but
having the oxf.http.internal-paths property makes it much simpler to
configure and avoids clumsier workarounds.

Hope this helps, and thanks for your efforts.

Finian


--
Sent from: http://discuss.orbeon.com/

--
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].
Reply | Threaded
Open this post in threaded view
|

Re: Orbeon separate deployment - 404 error

Alessandro  Vernet
Administrator
Hi Finian,

Interesting, and thank you for sharing those results. So you're saying that
you have Orbeon Forms deployed on `/` and eXist as a separate web app
deployed on `/exist`?

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
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].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Orbeon separate deployment - 404 error

Finian O'Boyle
Hi Alex,

I have eXist deployed on /exist and Orbeon deployed as a separate app on
/orbeon both within Tomcat 9.0.16. In eXist's web.xml, I have

<filter>
    <filter-name>orbeon-xforms-filter</filter-name>
    <filter-class>org.orbeon.oxf.servlet.OrbeonXFormsFilter</filter-class>
    <init-param>
        <param-name>oxf.xforms.renderer.context</param-name>
        <param-value>/orbeon</param-value>
    </init-param>
    <init-param>
        <param-name>oxf.xforms.renderer.default-encoding</param-name>
        <param-value>UTF-8</param-value>
    </init-param>
</filter>

<filter-mapping>
    <filter-name>orbeon-xforms-filter</filter-name>
    <url-pattern>/orbeonxq/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
</filter-mapping>

<filter-mapping>
    <filter-name>orbeon-xforms-filter</filter-name>
    <url-pattern>/orbeon/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
</filter-mapping>

The /orbeonxq/* mapping allows Orbeon to render RestXQ XForms outputs.

The net effect is that I need make very few changes to Orbeon, apart from
those in properties-local.xml.

Finian

--
Sent from: http://discuss.orbeon.com/

--
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].
Reply | Threaded
Open this post in threaded view
|

Re: Orbeon separate deployment - 404 error

Alessandro  Vernet
Administrator
Hi Finian,

Understood; this looks very much like a corner case (at least relative to
how Orbeon Forms is being used most of the time), and in this case it indeed
makes sense to change `oxf.http.internal-paths`. And thank you for the
sharing this with us!

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
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].
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet