Send Process Error

15 views
Skip to first unread message

PITS HKE

unread,
Aug 16, 2022, 11:59:53 AM8/16/22
to Orbeon Forms
Dear all,

I'm trying to post the form data to my designed http service for onward processing.  However, the customised process in properties-local.xml as follows while the error shown in the server.log as attached.

Appreciate for any insight for me to resolve this issue.  Million Thanks.

<property as="xs:string" name="oxf.fr.detail.buttons.app1.form1">
        save
    </property>
    <property as="xs:string" name="oxf.fr.detail.process.save.app1.form1">
        require-valid
        then send("http://localhost:3000")
        then save
    </property>

2022-08-16 23:47:08,395 ERROR [org.orbeon.oxf.xforms.processor.XFormsServer] (default task-1) xforms-submit-error - xf:submission: mandatory `resource` or `action` evaluated to an empty sequence for attribute value: `{instance('fr-send-submission-params')/@uri}`
2022-08-16 23:47:08,594 ERROR [org.orbeon.oxf.xforms.processor.XFormsServer] (default task-1)
+----------------------------------------------------------------------------------------------------------------------+
|An Error has Occurred                                                                                                 |
|----------------------------------------------------------------------------------------------------------------------|
|[No error message provided.]                                                                                          |
|----------------------------------------------------------------------------------------------------------------------|
|Application Call Stack                                                                                                |
|----------------------------------------------------------------------------------------------------------------------|
|----------------------------------------------------------------------------------------------------------------------|
|Exception: org.orbeon.oxf.xforms.action.XFormsAPI$SubmitException                                                     |
|----------------------------------------------------------------------------------------------------------------------|
|org.orbeon.oxf.xforms.action.XFormsAPI$            |$anonfun$sendThrowOnError$1   |XFormsAPI.scala               | 322|
|org.orbeon.oxf.xforms.action.XFormsAPI$            |$anonfun$send$3               |XFormsAPI.scala               | 295|
|scala.util.Try$                                    |apply                         |Try.scala                     | 213|
|org.orbeon.oxf.xforms.action.XFormsAPI$            |$anonfun$send$2               |XFormsAPI.scala               | 295|
|org.orbeon.oxf.xforms.action.XFormsAPI$            |$anonfun$send$2$adapted       |XFormsAPI.scala               | 294|
|org.orbeon.oxf.xforms.event.Dispatch$              |$anonfun$dispatchEvent$5      |Dispatch.scala                |  83|
|org.orbeon.oxf.xforms.event.Dispatch$              |$anonfun$dispatchEvent$5$adapt|Dispatch.scala                |  82|
|scala.collection.Iterator                          |foreach                       |Iterator.scala                | 943|
|scala.collection.Iterator                          |foreach$                      |Iterator.scala                | 943|
|scala.collection.AbstractIterator                  |foreach                       |Iterator.scala                |1431|
|scala.collection.IterableLike                      |foreach                       |IterableLike.scala            |  74|
|scala.collection.IterableLike                      |foreach$                      |IterableLike.scala            |  73|
|scala.collection.AbstractIterable                  |foreach                       |Iterable.scala                |  56|
|org.orbeon.oxf.xforms.event.Dispatch$              |callNativeListeners$1         |Dispatch.scala                |  82|
|org.orbeon.oxf.xforms.event.Dispatch$              |$anonfun$dispatchEvent$9      |Dispatch.scala                | 131|
|scala.runtime.java8.JFunction0$mcV$sp              |apply                         |JFunction0$mcV$sp.java        |  23|
|org.orbeon.oxf.util.Logging                        |withDebug                     |Logging.scala                 |  55|
|org.orbeon.oxf.util.Logging                        |withDebug$                    |Logging.scala                 |  48|
|org.orbeon.oxf.xforms.event.Dispatch$              |withDebug                     |Dispatch.scala                |  38|
|org.orbeon.oxf.xforms.event.Dispatch$              |$anonfun$dispatchEvent$6      |Dispatch.scala                |  89|
|scala.runtime.java8.JFunction0$mcV$sp              |apply                         |JFunction0$mcV$sp.java        |  23|
|org.orbeon.oxf.xforms.event.Dispatch$              |withEvent$1                   |Dispatch.scala                |  55|
|org.orbeon.oxf.xforms.event.Dispatch$              |dispatchEvent                 |Dispatch.scala                |  87|
|eon.oxf.xforms.submission.XFormsModelSubmissionBase|sendSubmitErrorWithDefault    |XFormsModelSubmissionBase.scal|  73|
|eon.oxf.xforms.submission.XFormsModelSubmissionBase|sendSubmitError               |XFormsModelSubmissionBase.scal|  59|
|.orbeon.oxf.xforms.submission.XFormsModelSubmission|$anonfun$doSubmit$8           |XFormsModelSubmission.scala   | 323|
|scala.runtime.java8.JFunction0$mcV$sp              |apply                         |JFunction0$mcV$sp.java        |  23|
|cats.Later                                         |value$lzycompute              |Eval.scala                    | 148|
|cats.Later                                         |value                         |Eval.scala                    | 147|
|.orbeon.oxf.xforms.submission.XFormsModelSubmission|$anonfun$doSubmit$9           |XFormsModelSubmission.scala   | 337|
|.orbeon.oxf.xforms.submission.XFormsModelSubmission|$anonfun$doSubmit$9$adapted   |XFormsModelSubmission.scala   | 333|
|scala.Option                                       |foreach                       |Option.scala                  | 407|
|.orbeon.oxf.xforms.submission.XFormsModelSubmission|doSubmit                      |XFormsModelSubmission.scala   | 333|
|.orbeon.oxf.xforms.submission.XFormsModelSubmission|performDefaultAction          |XFormsModelSubmission.scala   | 126|
|org.orbeon.oxf.xforms.event.Dispatch$              |$anonfun$dispatchEvent$9      |Dispatch.scala                | 140|
|scala.runtime.java8.JFunction0$mcV$sp              |apply                         |JFunction0$mcV$sp.java        |  23|
|org.orbeon.oxf.util.Logging                        |withDebug                     |Logging.scala                 |  55|
|org.orbeon.oxf.util.Logging                        |withDebug$                    |Logging.scala                 |  48|
|org.orbeon.oxf.xforms.event.Dispatch$              |withDebug                     |Dispatch.scala                |  38|
|org.orbeon.oxf.xforms.event.Dispatch$              |$anonfun$dispatchEvent$6      |Dispatch.scala                |  89|
|---8<--------8<--------8<--------8<--------8<--------8<--------8<--------8<--------8<--------8<--------8<--------8<---|
|org.wildfly.security.auth.server.Scoped            |runAsFunctionEx               |Scoped.java                   | 161|
|org.wildfly.security.auth.server.Scoped            |runAs                         |Scoped.java                   |  73|
|fly.elytron.web.undertow.server.ElytronRunAsHandler|handleRequest                 |ElytronRunAsHandler.java      |  67|
|io.undertow.servlet.handlers.RedirectDirHandler    |handleRequest                 |RedirectDirHandler.java       |  68|
|.handlers.security.SSLInformationAssociationHandler|handleRequest                 |SSLInformationAssociationHandl| 117|
|.handlers.security.ServletAuthenticationCallHandler|handleRequest                 |ServletAuthenticationCallHandl|  57|
|io.undertow.server.handlers.PredicateHandler       |handleRequest                 |PredicateHandler.java         |  43|
|w.security.handlers.AuthenticationConstraintHandler|handleRequest                 |AuthenticationConstraintHandle|  53|
|ow.security.handlers.AbstractConfidentialityHandler|handleRequest                 |AbstractConfidentialityHandler|  46|
|rs.security.ServletConfidentialityConstraintHandler|handleRequest                 |ServletConfidentialityConstrai|  64|
|.handlers.security.ServletSecurityConstraintHandler|handleRequest                 |ServletSecurityConstraintHandl|  59|
|.handlers.AbstractSecurityContextAssociationHandler|handleRequest                 |AbstractSecurityContextAssocia|  43|
|.elytron.web.undertow.server.servlet.CleanUpHandler|handleRequest                 |CleanUpHandler.java           |  38|
|io.undertow.server.handlers.PredicateHandler       |handleRequest                 |PredicateHandler.java         |  43|
|tension.undertow.security.jacc.JACCContextIdHandler|handleRequest                 |JACCContextIdHandler.java     |  61|
|io.undertow.server.handlers.PredicateHandler       |handleRequest                 |PredicateHandler.java         |  43|
|.undertow.deployment.GlobalRequestControllerHandler|handleRequest                 |GlobalRequestControllerHandler|  68|
|io.undertow.servlet.handlers.SendErrorPageHandler  |handleRequest                 |SendErrorPageHandler.java     |  52|
|io.undertow.server.handlers.PredicateHandler       |handleRequest                 |PredicateHandler.java         |  43|
|io.undertow.servlet.handlers.ServletInitialHandler |handleFirstRequest            |ServletInitialHandler.java    | 275|
|io.undertow.servlet.handlers.ServletInitialHandler |access$100                    |ServletInitialHandler.java    |  79|
|o.undertow.servlet.handlers.ServletInitialHandler$2|call                          |ServletInitialHandler.java    | 134|
|o.undertow.servlet.handlers.ServletInitialHandler$2|call                          |ServletInitialHandler.java    | 131|
|rvlet.core.ServletRequestContextThreadSetupAction$1|call                          |ServletRequestContextThreadSet|  48|
|dertow.servlet.core.ContextClassLoaderSetupAction$1|call                          |ContextClassLoaderSetupAction.|  43|
|rtowDeploymentInfoService$UndertowThreadSetupAction|lambda$create$0               |UndertowDeploymentInfoService.|1544|
|rtowDeploymentInfoService$UndertowThreadSetupAction|lambda$create$0               |UndertowDeploymentInfoService.|1544|
|rtowDeploymentInfoService$UndertowThreadSetupAction|lambda$create$0               |UndertowDeploymentInfoService.|1544|
|rtowDeploymentInfoService$UndertowThreadSetupAction|lambda$create$0               |UndertowDeploymentInfoService.|1544|
|io.undertow.servlet.handlers.ServletInitialHandler |dispatchRequest               |ServletInitialHandler.java    | 255|
|io.undertow.servlet.handlers.ServletInitialHandler |access$000                    |ServletInitialHandler.java    |  79|
|o.undertow.servlet.handlers.ServletInitialHandler$1|handleRequest                 |ServletInitialHandler.java    | 100|
|io.undertow.server.Connectors                      |executeRootHandler            |Connectors.java               | 387|
|io.undertow.server.HttpServerExchange$1            |run                           |HttpServerExchange.java       | 852|
|org.jboss.threads.ContextClassLoaderSavingRunnable |run                           |ContextClassLoaderSavingRunnab|  35|
|org.jboss.threads.EnhancedQueueExecutor            |safeRun                       |EnhancedQueueExecutor.java    |1990|
|org.jboss.threads.EnhancedQueueExecutor$ThreadBody |doRunTask                     |EnhancedQueueExecutor.java    |1486|
|org.jboss.threads.EnhancedQueueExecutor$ThreadBody |run                           |EnhancedQueueExecutor.java    |1377|
|org.xnio.XnioWorker$WorkerThreadFactory$1$1        |run                           |XnioWorker.java               |1280|
|java.lang.Thread                                   |run                           |Thread.java                   | 829|
+----------------------------------------------------------------------------------------------------------------------+

Alessandro Vernet

unread,
Aug 16, 2022, 6:56:28 PM8/16/22
to orb...@googlegroups.com
Hi,

The relevant error is:

xf:submission: mandatory `resource` or `action` evaluated to an empty sequence for attribute value: `{instance('fr-send-submission-params')/@uri}`

You are calling `send("http://localhost:3000")` (doc), without specifying a parameter name. For some actions, if you only have one parameter, and it happens to be the default parameter, you can skip the parameter name. But for `send()`, the default parameter is `property`, so your call is taken to mean `send(property = "http://localhost:3000")`, which isn't what you meant.

I'd recommend you always provide parameter names, for clarity (and in this case, you can't do without providing one). So your call should be:

send(uri = "http://localhost:3000")

You'll let me know if this solves the problem for you.

-Alex

PITS HKE

unread,
Aug 16, 2022, 9:11:43 PM8/16/22
to Orbeon Forms
Alex,

It does the trick.  My http back-end have received the post action but the req.body is found to be empty.  The process is now customised as follows:

<property as="xs:string" name="oxf.fr.detail.process.save.app1.form1">
        require-valid
        then send(
        uri = "http://localhost:3000",
        method = 'POST',
        content = 'metadata'
        )
        then save
    </property>

However, the output from my http back-end is POST parameter received are:  {}

Comparing to another test curl -H "Content-Type: application/json" -d '{"username":"xyz","password":"xyz"}' http://localhost:3000/, the result POST parameter recieved are:  { username: 'xyz', password: 'xyz' } is found more promising.  Do you have another insight for me please?

Thank you so so much.

Alessandro Vernet

unread,
Aug 17, 2022, 12:58:39 PM8/17/22
to orb...@googlegroups.com
Hi,

Maybe this is because `send()` is posting XML data, while your code expects JSON. Maybe you can test your service by posting XML data with curl, and checking that you get the expected result?

-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 orbeon+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/14a01e7a-d57e-41e7-853c-00f691cc55cbn%40googlegroups.com.

PITS HKE

unread,
Aug 18, 2022, 12:47:09 AM8/18/22
to Orbeon Forms
Hi Alex, Brilliant.  I can get the XML data now.  Million thanks.

Alessandro Vernet

unread,
Aug 18, 2022, 12:20:44 PM8/18/22
to orb...@googlegroups.com
Excellent, I'm glad that `send()` worked, and thanks for the update.

-Alex
Reply all
Reply to author
Forward
0 new messages