You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 16, 2021. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 16, 2021. It is now read-only.
Run the docker image, tag exist-db:eXist-3.6.1 using the command as documented in the readme docker run -it -p 9080:8080 -p 9443:8443 evolvedbinary/exist-db:eXist-3.6.1
Log in as admin (use the login to monitoring, login on dashboard does not work in exist when run natively either)
Go to Package Manager
Install DemoApps
Open the Demo Apps and navigate to XForms and RestXQ
First error: There is no example data shown here. In the container: as opposed to when installed natively:
Also one can not add a new address (similar error).
Analysis
The error can be found when looking at the network requests. The request to http://localhost:9080/exist/Flux/call/plaincall/Flux.init.dwr contains an error:
It's a betterForm issue, or at least it's present in the betterForm Demo and Reference XForms module as well.
Where did you get that contextInfo from? If it's server-side context, betterForm should not be querying for data at localhost:9080, but rather 127.0.0.1:8080. If it's browser-side, then it's probably OK.
Can you follow up from on this?
btw. For me the /restxq/address RestXQ endpoint works as expected when queried directly.
@Sincopy The JSON I posted (the dump) is the response the client receives from the server. I captured it using the Chrome Developer Tools (Network Tab, Response). The contextInfo is in there, but you only find it when pretty printing it. http://localhost:9080/exist/restxq/address works for me as well:
As you mentioned, the port on the serverside should be 8080, since the container internally provides exist on port 8080. Either the demos should probably be modified, or the container should be used on port 8080 (e.g. maybe change the readme accordingly).
I verified that it works correctly when the exposed port is changed to 8080.
They way I see it, you are probably facing three problems:
a) betterForms resolves relative paths in the outside context. It seems to be getting information from the browser-side that data is located at the IP:port where the client sees it, rather that where the data/service resides. Since betterForm is (mainly?) a server-side solution, this is perhaps a bit unexpected, though it might be by design.
This means you'd have to provide it with the right context from eXistDB, which is exactly what the controller.xql does, but only as far as paths go. It doesn't 'fix' the server/port issue.
b) eXistDB is unable to provide the local hostname and port either. At least I couldn't find a proper function in the request library module. The request:get-server-name and get-server-port return localhost:9080, which is exactly what you don't want in this case. I'd say this is by design as most applications will need the outside context from these functions.
My gut tells me that controller.xql should use a config in where the host (incl. name and port) can be changed. We could then inject that into the container using an environment variable.
Or (but this isn't a fix): We change the default exposed port on the host to 8080 and mention that if it is changed, that demo stuff with betterForms doesn't work, and why.
Activity
Sincopy commentedon Jan 30, 2018
It's a betterForm issue, or at least it's present in the betterForm Demo and Reference XForms module as well.
Where did you get that contextInfo from? If it's server-side context, betterForm should not be querying for data at localhost:9080, but rather 127.0.0.1:8080. If it's browser-side, then it's probably OK.
Can you follow up from on this?
btw. For me the /restxq/address RestXQ endpoint works as expected when queried directly.
rogerwalt commentedon Jan 30, 2018
@Sincopy The JSON I posted (the dump) is the response the client receives from the server. I captured it using the Chrome Developer Tools (Network Tab, Response). The



contextInfois in there, but you only find it when pretty printing it.http://localhost:9080/exist/restxq/addressworks for me as well:As you mentioned, the port on the serverside should be 8080, since the container internally provides exist on port 8080. Either the demos should probably be modified, or the container should be used on port 8080 (e.g. maybe change the readme accordingly).
I verified that it works correctly when the exposed port is changed to 8080.
What do you suggest?
Sincopy commentedon Jan 30, 2018
First: the one way I can get it to work (without touching the code) is to access the demo directly via:
http://localhost:9080/exist/apps/demo/examples/xforms/demo.html?restxq=http://127.0.0.1:8080/exist/restxq/
They way I see it, you are probably facing three problems:
a) betterForms resolves relative paths in the outside context. It seems to be getting information from the browser-side that data is located at the IP:port where the client sees it, rather that where the data/service resides. Since betterForm is (mainly?) a server-side solution, this is perhaps a bit unexpected, though it might be by design.
This means you'd have to provide it with the right context from eXistDB, which is exactly what the controller.xql does, but only as far as paths go. It doesn't 'fix' the server/port issue.
b) eXistDB is unable to provide the local hostname and port either. At least I couldn't find a proper function in the request library module. The request:get-server-name and get-server-port return localhost:9080, which is exactly what you don't want in this case. I'd say this is by design as most applications will need the outside context from these functions.
c) 'localhost' is not resolved to an IP address inside the container because this works;
http://localhost:9080/exist/apps/demo/examples/xforms/demo.html?restxq=http://127.0.0.1:8080/exist/restxq/
and this doesn't:
http://localhost:9080/exist/apps/demo/examples/xforms/demo.html?restxq=http://localhost:8080/exist/restxq/
I guess this is due to /etc/hosts being empty (default on the distroless image being used) and I can't get the --add-host docker option to change that.
rogerwalt commentedon Jan 30, 2018
My gut tells me that
controller.xqlshould use a config in where the host (incl. name and port) can be changed. We could then inject that into the container using an environment variable.Or (but this isn't a fix): We change the default exposed port on the host to 8080 and mention that if it is changed, that demo stuff with betterForms doesn't work, and why.
Sincopy commentedon Jan 30, 2018
It will work, simply if you can get this address and port (known by jetty) into the controller.xql:

so that it provides:
http://localhost:9080/exist/apps/demo/examples/xforms/demo.html?restxq=http://172.17.0.2:8080/exist/restxq/
It's also only a fix for this one example. It doesn't fix the betterForm demos (ie. FeatureExplorer)
adamretter commentedon Feb 14, 2018
We will be removing betterForm in the near furture, so I will likely wait for that to happen.