Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] 'other' is different type of Path #5525

Open
lguariento opened this issue Oct 28, 2024 · 7 comments · May be fixed by #5529
Open

[BUG] 'other' is different type of Path #5525

lguariento opened this issue Oct 28, 2024 · 7 comments · May be fixed by #5529
Assignees
Labels
bug issue confirmed as bug regression xquery issue is related to xquery implementation
Milestone

Comments

@lguariento
Copy link

lguariento commented Oct 28, 2024

Describe the bug
With a simple query, be it via Java Admin, via rest, or in eXide, one gets a 'other' is different type of Path
error under certain conditions.

Expected behavior
Getting the result of the query.

To Reproduce
Open eXide -> new XQuery. Query a collection of XML document with a simple for loop importing the functx module.

xquery version "3.1";

declare namespace tei="http://www.tei-c.org/ns/1.0";
import module namespace functx = "http://www.functx.com";

for $x in collection("/db/apps/yourfolder")//tei:TEI
return $x

Copy-pasting the same query in the Java Admin console returns the same error.

Full error:

org.xmldb.api.base.XMLDBException: Failed to invoke method compile in class org.exist.xmlrpc.RpcConnection: 'other' is different type of Path
	at org.exist.xmldb.RemoteCollection.execute(RemoteCollection.java:129)
	at org.exist.xmldb.RemoteXPathQueryService.compileAndCheck(RemoteXPathQueryService.java:151)
	at org.exist.xmldb.RemoteXPathQueryService.compile(RemoteXPathQueryService.java:128)
	at org.exist.client.QueryDialog$QueryRunnable.run(QueryDialog.java:577)
	at java.lang.Thread.run(Thread.java:750)
Caused by: org.apache.xmlrpc.XmlRpcException: Failed to invoke method compile in class org.exist.xmlrpc.RpcConnection: 'other' is different type of Path
	at org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:214)
	at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:173)
	at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:142)
	at org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:70)
	at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:56)
	at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:167)
	at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:158)
	at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:147)
	at org.exist.xmldb.RemoteCollection.execute(RemoteCollection.java:127)
	... 4 more
  • Build: [eXist-6.3.0]
  • Java: openjdk 17.0.13 2024-10-15
  • Debian

Additional context

  • How is eXist-db installed? .jar
  • Any custom changes in e.g. conf.xml? No
@line-o
Copy link
Member

line-o commented Oct 29, 2024

I had a moment to look at this issue and I can reproduce it.

Ad-hoc modules cannot import libraries without location hint:

; xst run "import module namespace functx='http://www.functx.com/';functx:atomic-type(4)"
Error executing your query
Failed to invoke method executeQuery in class org.exist.xmlrpc.RpcConnection: 'other' is different type of Path

@line-o line-o added bug issue confirmed as bug xquery issue is related to xquery implementation labels Oct 29, 2024
@line-o
Copy link
Member

line-o commented Oct 29, 2024

As @lguariento also found out, saving the module to the database allows the library to be imported.

@line-o
Copy link
Member

line-o commented Oct 29, 2024

This affects eXist-6.3.0, develop, develop-6.x.x

@line-o line-o added this to the eXist-6.3.1 milestone Oct 30, 2024
@line-o line-o self-assigned this Oct 30, 2024
@adamretter
Copy link
Contributor

adamretter commented Oct 31, 2024

@lguariento Hi Luca, I have a fix for you that I prepared, and I was about to publish an eXist-db 6.3.1 release to address this. I am sad to say that I can't do that now; see the Slack #community channel for details - https://exist-db.slack.com/archives/CG2MRUZ35/p1730302049097909

@reinhapa
Copy link
Member

@lguariento Hi Luca, I have a fix for you that I prepared, and I was about to publish an eXist-db 6.3.1 release to address this. I am sad to say that I can't do that now;

@adamretter is there a PR/commit for this fix?

line-o added a commit to line-o/exist that referenced this issue Oct 31, 2024
fixes eXist-db#5525

- add functx to autodeploy for xquery tests
- add tests for one-off queries with module imports
  - of a registered module without location hint
  - of a module with location hint
- change XQueryContext to allow imports again
- change SourceFactory to work with contextPath set to "."
@line-o line-o linked a pull request Oct 31, 2024 that will close this issue
line-o added a commit to line-o/exist that referenced this issue Oct 31, 2024
fixes eXist-db#5525

- add functx to autodeploy for xquery tests
- add tests for one-off queries with module imports
  - of a registered module without location hint
  - of a module with location hint
- change XQueryContext to allow imports again
- change SourceFactory to work with contextPath set to "."
@lguariento
Copy link
Author

Thank you. I'll apply that later and will report back.

@line-o line-o moved this to In review in v6.3.1 release Oct 31, 2024
@adamretter
Copy link
Contributor

is there a PR/commit for this fix

@reinhapa Yes.

line-o added a commit to line-o/exist that referenced this issue Nov 1, 2024
fixes eXist-db#5525

- add functx to autodeploy for xquery tests
- add tests for one-off queries with module imports
  - of a registered module without location hint
  - of a module with location hint
- change XQueryContext to allow imports again
- change SourceFactory to work with contextPath set to "."
line-o added a commit to line-o/exist that referenced this issue Nov 19, 2024
fixes eXist-db#5525

- add functx to autodeploy for xquery tests
- add tests for one-off queries with module imports
  - of a registered module without location hint
  - of a module with location hint
- change XQueryContext to allow imports again
- change SourceFactory to work with contextPath set to "."
line-o added a commit to line-o/exist that referenced this issue Nov 19, 2024
fixes eXist-db#5525
fixes eXist-db#5530

- add functx to autodeploy for xquery tests
- add tests for one-off queries with module imports
  - of a registered module without location hint
  - of a module with location hint
- change XQueryContext to allow imports again
- change SourceFactory to work with contextPath set to "."
line-o added a commit to line-o/exist that referenced this issue Nov 19, 2024
fixes eXist-db#5525
fixes eXist-db#5530

- add functx to autodeploy for xquery tests
- add tests for one-off queries with module imports
  - of a registered module without location hint
  - of a module with location hint
- change XQueryContext to allow imports again
- change SourceFactory to work with contextPath set to "."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issue confirmed as bug regression xquery issue is related to xquery implementation
Projects
Status: In review
Development

Successfully merging a pull request may close this issue.

4 participants