Re: Resource not loading - 404 Error

This post has NOT been accepted by the mailing list yet.

Hi Alex,
Yes, it is our application specific xml and resides under /resources/ directory of the original application called FormsServer. Forms Server makes a servlet call to Orbeon Forms. It was working in 3.9 but does not load resource files of FormsServer.

Re: Resource not loading - 404 Error

Administrator

Hi Prashant,

Sorry for the delay: I didn't see your messages, as you were not subscribed to the list, and thus the messages you posted on discuss.orbeon.com didn't go through. I now subscribed you, and everyone should immediately get any subsequent message you post.

Are you saying that your file was in resources/auto_resources.xml? Or was it in WEB-INF/resources/auto_resources.xml? In the second case, I can't picture how it could have worked with 3.9. In the first case, it would mean that the file was served directly by the app server, not the Orbeon Forms servlet. Maybe you had a special config in your web.xml for that? Also, can I ask why you have an XML file that you want to load from the browser, as this is somewhat unusual?

Re: Resource not loading - 404 Error

Below is the application structure template which works with Orbeon 3.9.
Here “FormsServerRoot” is the root project for the application.

Please find details for every module
Orbeon: This module is responsible to create orbeon.war(3.9)
FormsServer: This module contains application specific .jsp(highlighted in red box) in xforms folder and its required resource(highlighted in blue color) are in resources folder. This module is responsible to create formsServer.war.
FormsServerEAR: This module is responsible to create application ear which contains both orbeon war and formsServer war.

Our target to delete above Orbeon module from this application and use updated orbeon.war as dependency in application ear.

Re: Resource not loading - 404 Error

This will load the file through the resource manager, instead of going through an HTTP request served by the page flow, and thus should avoid any issue with the page flow. You'll let me know if this helps.

Re: Resource not loading - 404 Error

Re: Resource not loading - 404 Error

I suspect that you're either not changing the correct file, or that there is another reference, because the oxf:/ scheme should not make an HTTP request capable of answering with a 404.

Could you change oxf:/auto_resources.xml → oxf:/gaga.xml. Now what error are you getting? If still an error for auto_resources.xml, then you have another reference to that file. If an error for gaga.xml, can you attach the orbeon.log you're getting right after the error happened?

Re: Resource not loading - 404 Error

\orbeon-2016.3.201612302139-CE.zip\orbeon-2016.3.201612302139-CE\orbeon.war
but not
\orbeon-2016.3.201612302139-CE.zip\orbeon-2016.3.201612302139-CE\orbeon-auth.war
\orbeon-2016.3.201612302139-CE.zip\orbeon-2016.3.201612302139-CE\orbeon-xforms-filter.war

Please find below pom configuration where we are using above orbeon.war in our application ear

Re: Resource not loading - 404 Error

Administrator

Hi Hasim,

Indeed, I see in the log the error for the page flow not finding NewAuto_resources.xml. But since you're using the `oxf:/` scheme, this should go directly to the resource manager, without hitting the page flow.

So let's try to reproduce this in case that is as simple as possible. I'm taking the Orbeon Forms 2016.3 war, uncompressing it, and:

With this, if I go to http://localhost:8080/orbeon/xforms-jsp/guess-the-number/, and click on "I'm a cheater", I see 42 as expected. Could you try this, and see if it works for you? If it does, but you're doing something slightly different, can you do a variation on what I did that shows the problem?

The above auto_resources.xml file is also present in "FormsServerEAR.ear\FormsServer.war\resources" folder but not in "FormsServerEAR.ear\FormsServer.war\WEB-INF\resources" folder.

Scenario 1:
We run the auto.jsp page without any change in codebase and we are getting below exception
2017-05-18 06:08:43,571 INFO PageFlowControllerProcessor - not found {controller: "oxf:/ops/xforms/xforms-renderer-page-flow.xml", method: "GET", path: "/xforms-renderer", resource: "/auto_resources.xml"}

Scenario 2:
We move auto_resources.xml file from "FormsServerEAR.ear\FormsServer.war\resources" to "FormsServerEAR.ear\FormsServer.war\WEB-INF\resources" and run the auto.jsp page. Still we are getting above exception

Scenario 3:
We move auto_resources.xml file from "FormsServerEAR.ear\FormsServer.war\resources" to "FormsServerEAR.ear\Orbeon.war\WEB-INF\resources" and run the auto.jsp page. Now the page are coming as expected.

Now my questions are:
1. Why the auto.jsp (which is present in FormsServer.war) file try to search the auto_resources.xml in Orbeon.war but not in FormsServer.war?
2. What should be the solution for such issue?

Re: Resource not loading - 404 Error

Administrator

Hi Hasim,

I'm glad you resolved this. And you're correct: the file should go in the Orbeon Forms' `WEB-INF/resources`. This is because it is Orbeon Forms that interprets your XForms, that URLs that start with the `oxf:` scheme are resolved by Orbeon Forms through its resource managers (see the page linked below for more on this), and that, typically, custom resources for your application are placed in the `WEB-INF/resources`.

Re: Resource not loading - 404 Error

Hi Alex,
couple of things

1. As I told you earlier, we are using whole orbeon.war in our application. That "war" should be present in nexus. The application only call the orbeon.war as dependency direct from nexus. we can't change anything frequently inside the orbeon.war.

2. The auto_resources.xml is our application specific resource which will be changes frequently according business logic. So we can't put these type of resource direct to orbeon.war.