form builder integration issues

18 views
Skip to first unread message

Sorin Vasilescu

unread,
Aug 22, 2018, 8:31:55 AM8/22/18
to Orbeon Forms
Hi,

I've done the following things:
- I'm loading form builder in an iframe (like described here, but with URL /orbeon/fr/orbeon/builder/new)
- I'm proxying all requests to /orbeon in order to add headers for user and group (like described here)
- I'm also dynamically adding some inputs for CSRF purposes and reconfiguring the YUI default headers, also for CSRF

I can successfully create, edit, save and publish forms this way, but I have two issues:

1. The "Test" button does not work, it loads the form builder UI, instead of loading a form runner displaying the form. Any idea what I might be doing wrong?

Screenshot from 2018-08-22 14-35-42.png



2. If I create a form while I'm in the iframe and the form gets created with a username and group, I can't edit it directly from the orbeon interface later, I just get a nondescript error message. Is this how it's intended to work because of form builder permissions?

Integrated:

Screenshot from 2018-08-22 14-52-53.png



Stand-alone:

Screenshot from 2018-08-22 14-53-12.png


Thanks,
Sorin.

Alessandro Vernet

unread,
Aug 23, 2018, 6:54:23 PM8/23/18
to orb...@googlegroups.com
Hi Sorin,

Does using the iframe make any difference? What if you load
/orbeon/fr/orbeon/builder/new directly in your browser?

The proxying of the requests can be tricky, as you need to make sure that
the `JSESSIONID` used when producing the page is the same as the one sent to
Orbeon Forms in subsequent requests (which may be different than the
`JSESSIONID` between the browser and your proxy). Does your proxy guarantee
this?

Finally, regarding the error shown in your second screenshot, I'd recommend
you check your `orbeon.log`, and see if it sheds some light on the reason
for this error.

You'll let me know if this helps.

Alex

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

Sorin Vasilescu

unread,
Aug 24, 2018, 5:34:40 AM8/24/18
to orb...@googlegroups.com
Hi Alex,

Thanks for the assist, I've enabled some more logging levels and looked at the log.

The JSESSIONID is a cookie on the client browser. As each request originates from the same client browser, the same cookie is there. The proxy forwards all cookies, headers, etc to Orbeon from the original request it gets from the browser.
I am attaching file orbeon-builder-test-log.txt which contains the things that happen when I click "Test", I'm afraid I don't know enough to interpret it.
However, logging from the proxy tells me I always send JSESSIONID cookie with the value 034A98241971E610710796029F506A97
  
Regarding the error when editing, I can see an error in the log, but again I don't know how to interpret that. I've attached orbeon-builder-edit-log.txt

Thanks,
Sorin.



--
You received this message because you are subscribed to a topic in the Google Groups "Orbeon Forms" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orbeon/VyOIFEXLcoU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orbeon+un...@googlegroups.com.
To post to this group, send email to orb...@googlegroups.com.
orbeon-builder-test-log.txt
orbeon-builder-edit-log.txt

Alessandro Vernet

unread,
Aug 24, 2018, 8:37:24 PM8/24/18
to orb...@googlegroups.com
Hi Sorin,

Let's start with what might be a simple one, since we have an error we can
refer to. In the second log file you attached, I see the following error:

Fatal error: Attribute name "defer" associated with an element
type "script" must be followed by the ' = ' character.

Can you think of where that `defer` attribute name with no value comes from?
Is this something you added to a form? If not, what would the simplest way
for me to reproduce the issue starting from a verbatim install of Orbeon
Forms?

Sorin Vasilescu

unread,
Aug 26, 2018, 4:26:03 PM8/26/18
to orb...@googlegroups.com
Hi Alex,

No clue where "defer" might come from, I haven't manually added anything like that to the form.

Basically, I just created a form using the form builder in the iframe and with the proxy.
Simplest way I can think of is to attach a dump of my db and config files. I'm using version 2017.2.2.201805182106-PE.

Can you try to reproduce using that?
I'm thinking if you can, then there's either a bug, or my data is invalid for some reason.

Best regards,
db.zip
server.xml
properties-local-prod.xml
log4j.xml

Alessandro Vernet

unread,
Aug 28, 2018, 2:53:31 PM8/28/18
to orb...@googlegroups.com
Hi Sorin,

By "simplest", I meant "smallest test case that reproduces the problem". Can
you reproduce the "defer issue" with a minimal form you create on a verbatim
install of Orbeon Forms? If not, I'd recommend you progressively add to that
config until you get to reproduce the issue, this in order to figure what
causes the issue. You'll let me know what you find!

Sorin Vasilescu

unread,
Aug 28, 2018, 3:17:30 PM8/28/18
to orb...@googlegroups.com
Hi,

Yes, I can reproduce it with a form as it loads from the new action, no changes, just save, on a verbatim install of Orbeon with only MySQL db configured.

However, it only happens when I use the iframe/proxy combination. So you'd need that too if you want to reproduce the issue, which is problematic, because you'd need apache, php and the whole php project that does that.

I did take a shot in the dark, however, and I deleted the folder $CATALINA_HOME/temp/orbeon/cache and the issue goes away.
I've no idea what's in there, but if it helps, I can zip the whole cache folder and send it to you.

Best regards,
Sorin.


Alessandro Vernet

unread,
Aug 29, 2018, 6:30:23 PM8/29/18
to orb...@googlegroups.com
Hi Sorin,

Well, I'm not sure why this solves the problem you were having ;), but I'm
glad it works for you now!

Sorin Vasilescu

unread,
Aug 31, 2018, 4:00:43 AM8/31/18
to orb...@googlegroups.com
Hi,

No clue, but I'll stick to that workaround if I encounter that issue again.

That leaves the Test button. Do you think I could connect a debugger to Tomcat and use the code on GitHub to set some breakpoints and try to figure it out?

Thanks,

Alessandro Vernet

unread,
Aug 31, 2018, 3:16:43 PM8/31/18
to orb...@googlegroups.com
Hi Sorin,

For the issue of Form Builder itself, instead of the form you're creating,
showing in the Test dialog, I would start by comparing using a tool like
Wireshark:

1. With an unaltered Orbeon Forms, when you hit the test button, what are
the HTTP requests/responses between the browser and Orbeon Forms.
2. In your scenario, when you hit the test button:
2a. what are the HTTP requests/responses between the browser and your proxy,
2b. what are the HTTP requests/responses between your proxy and Orbeon
Forms.

Hopefully you can find some telling difference between 1 and 2b. You'll let
me know what you find.

Alessandro Vernet

unread,
Sep 11, 2018, 1:41:37 PM9/11/18
to orb...@googlegroups.com
Sorin, did you get a chance to compare the HTTP requests, per my earlier
message? -Alex

Sorin Vasilescu

unread,
Sep 13, 2018, 7:44:11 AM9/13/18
to orb...@googlegroups.com
Hi,

Sorry, haven't had time until just now, thanks for getting back to me.
I've tried Wireshark, and I've found something interesting.

When requesting the test iframe, the client always makes 3 requests, which I can follow from Chrome's developer console to the proxy log and to Wireshark respectively:

Requests go from port 54336 (Chrome) to 80 (Apache) and then to 9080 (Tomcat) and responses are interleaved as expected.
All requests from the client that get proxied to 9080 have the JSESSIONID cookie with the correct value.

However, I've identified an extra request that happens when I use the proxy. What's weird though, is that the requests doesn't originate on the client, I can't find it going to Apache, only to Tomcat.
It looks like it's an internal Orbeon request, but it still goes through the loopback interface: /fr/service/persistence/crud/orbeon/builder/form/form.xhtml
This request has a different JSESSIONID from the other ones, but I seem to have no control over it.

Also, the Orbeon logs differ in the two usecases, they reflect the extra request and the different session id.
Attached are the capture file for the proxied usecase and the logs for both proxied and direct usecases.

Any clue who might be making that request and why the JSESSIONID might be different?

Thanks,
Sorin.


test-form.pcapng.gz
test-proxy.log
test-direct.log

Alessandro Vernet

unread,
Sep 13, 2018, 7:24:47 PM9/13/18
to orb...@googlegroups.com
Hi Sorin,

I am not sure why the request to load the form happens over HTTP in that
case; it should be an "internal request", which you can't see with
WireShark. Would you be able to connect to Tomcat with a debugger to see
what is going on? I would debug code around the line linked below. Is
`findInternalURL()` indeed isn't returning a `Some(internalPath)`? If so,
I'd debug the function itself and see why it determines the path not to be
internal.

https://github.com/orbeon/orbeon-forms/blob/tag-release-2018.1-ce/src/main/scala/org/orbeon/oxf/util/Connection.scala#L151

You'll let me know what you find if you get a chance to debug this.

Sorin Vasilescu

unread,
Sep 17, 2018, 3:00:44 PM9/17/18
to orb...@googlegroups.com
Hi,

You are using release-2018.1, but I can't, form builder does not load for me, I guess because of this bug: https://stackoverflow.com/questions/52264285/orbeon-2018-1-bug-in-initialization-of-opsxformsproperties
In my 2017.2-ce codebase, it's line 150, not line 151.

Other than that, I always see findInternalURL returning something like Some(/fr/service...)
Also, in the URLs being returned, I can't find any mention of the URL I see in Wireshark, which is /fr/orbeon/builder/edit/e8b5efacf4d28faaccda2ff9843e3e2f342794e1

Best regards,

Alessandro Vernet

unread,
Sep 18, 2018, 4:58:51 PM9/18/18
to orb...@googlegroups.com
Hi Sorin,

OK, #3736 is fixed and will be in 2018.1.1, which we'll also release for
Orbeon Forms CE. For now, you can use the test build linked below which
includes the fix. You'll let me know if using 2018.1 makes a difference.

https://s3.amazonaws.com/orbeon-builds/orbeon/orbeon-forms/4524/4524.2/build/distrib/orbeon-2018.1.1.201809181825-CE.zip

Sorin Vasilescu

unread,
Sep 20, 2018, 7:10:05 AM9/20/18
to orb...@googlegroups.com
Hi,

I've installed the build you linked, but it looks the same to me. I still don't see any connection to the URL I'm seeing in Wirecast.

Maybe I'm missing something. You have a screencast attached of the browser on one side and the debug window on the other.

Best regards,
Sorin.


debug.ogv

Alessandro Vernet

unread,
Sep 20, 2018, 12:56:39 PM9/20/18
to Orbeon Forms
Got it Sorin, it was worth a try. I'm afraid there isn't much that we can do to help you through this community forum, as it seems we would need to dig in deeper to figure out why your custom integration doesn't work, maybe doing a WebEx to get a good understanding of what is going on and what your code does, but this is something we don't have the bandwidth to do for free. We do this for customers using Orbeon Forms PE (https://www.orbeon.com/pricing) who have Dev Support (https://www.orbeon.com/services), in case that is an option for your organization.

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

Sorin Vasilescu

unread,
Sep 20, 2018, 3:00:08 PM9/20/18
to orb...@googlegroups.com
Hi, Alex,

Thanks for the support so far, we can definitely park this topic. We're going to get the PE license eventually, not sure about dev support, but we'll check it out.


It would, however help me a lot if I could unblock the other issue I'm having with the autocomplete, but there's a different thread for that.

Best regards,
Sorin.
Reply all
Reply to author
Forward
0 new messages