[basex-talk] New user questions

2019-05-13 Thread Joshua Kordani
Greetings all.

I am attempting to setup an environment for processing junit xml output files, 
to be handed off to the end user.

In general, batches of junit files will be imported over time, and as they get 
imported I wish to add timestamp tags to certain elements.  Right now the only 
way I see to programmatically do this is take details from the filename, derive 
a datetime, and apply it to the elements in question that are associated with a 
given file.  I am trying to make this process easy on the user, such that they 
specify a new file or set of files to import, then all pertinent records in 
each file get timestamped.  I don't quite see how to access enough "external 
environment" to allow for a script to grab a user specified filename and do 
this work and I could use some pointers.  I undertand that datetimes are not 
indexable fields, or else i'm not sure exactly what the documentation has to 
say about indexes and datetimes, but if there is anything I can do to allow a 
user to filter by them that would be great.

The user is fine with what ultimately becomes a command line interface to 
import these files and generates reports.  I can see how to build xquery 
commands to isolate all of the elements in question and pass statically baked 
data to variables such as date time to add to existing elements in the 
database, but I still am not sure how to use this to build a system to allow a 
user to add a file or set of files at a time and have them processed in this 
way.

Thank you!
Joshua Kordani

DISCLAIMER: This email communication and any attached files are Speedcast 
Wireless proprietary and may be legally privileged.  Export-controlled 
information shall not be disseminated without proper authorization and proper 
export-control markings, per Speedcast Wireless export policy.  If you have 
received this transmission in error please notify the sender immediately and 
then delete this email and all its attachments. If you are not the addressee, 
any disclosure, reproduction, copying, distribution, or any other dissemination 
or use of this communication is strictly prohibited.  Thank you.


Re: [basex-talk] A really basic question

2019-05-13 Thread Gardner, Arthur
Thank you!

I had, in fact, reviewed that document.

A lot of these suggestions would make more sense on a personal device.  I am at 
work in a corporate network.

Is running from the jar a viable alternative?

Arthur Gardner | Infosys Ltd
MetLife | Clarks Summit, PA
Office 570-587-6898 | Mobile 262-442-7472

From: Christian Grün 
Sent: Monday, May 13, 2019 3:47 PM
To: Gardner, Arthur 
Cc: BaseX 
Subject: [EXT] Re: [basex-talk] A really basic question

Hi Arthur,

You could try one of the options that are detailed in the following article:

https://windowsreport.com/app-cant-run-windows-10/

Does this help?

Best regards,
Christian



Gardner, Arthur mailto:arthur.gard...@metlife.com>> 
schrieb am Mo., 13. Mai 2019, 21:38:
Hi.  I’ve installed the Windows Installer (9.2.1) in Windows 10.

The installed shortcut points to BaseX.exe.

When I click it, I see this message: This app can’t run on your PC

If I modify the shortcut to point to BaseX.jar, it runs like a champ.

I haven’t actually asked a question, but I guess you get the idea.  The issue 
could be on my end, of course.

Arthur Gardner | Infosys Ltd
MetLife | Clarks Summit, PA
Office 570-587-6898 | Mobile 262-442-7472


The information contained in this message may be CONFIDENTIAL and is for the 
intended addressee only.  Any unauthorized use, dissemination of the 
information, or copying of this message is prohibited.  If you are not the 
intended addressee, please notify the sender immediately and delete this 
message.


Re: [basex-talk] A really basic question

2019-05-13 Thread Christian Grün
Hi Arthur,

You could try one of the options that are detailed in the following article:

https://windowsreport.com/app-cant-run-windows-10/

Does this help?

Best regards,
Christian




Gardner, Arthur  schrieb am Mo., 13. Mai 2019,
21:38:

> Hi.  I’ve installed the Windows Installer (9.2.1) in Windows 10.
>
>
>
> The installed shortcut points to BaseX.exe.
>
>
>
> When I click it, I see this message: *This app can’t run on your PC*
>
>
>
> If I modify the shortcut to point to BaseX.jar, it runs like a champ.
>
>
>
> I haven’t actually asked a question, but I guess you get the idea.  The
> issue could be on my end, of course.
>
>
>
> Arthur Gardner | Infosys Ltd
>
> MetLife | Clarks Summit, PA
>
> Office 570-587-6898 | Mobile 262-442-7472
>
>
>
> The information contained in this message may be CONFIDENTIAL and is for
> the intended addressee only.  Any unauthorized use, dissemination of the
> information, or copying of this message is prohibited.  If you are not the
> intended addressee, please notify the sender immediately and delete this
> message.
>


[basex-talk] A really basic question

2019-05-13 Thread Gardner, Arthur
Hi.  I've installed the Windows Installer (9.2.1) in Windows 10.

The installed shortcut points to BaseX.exe.

When I click it, I see this message: This app can't run on your PC

If I modify the shortcut to point to BaseX.jar, it runs like a champ.

I haven't actually asked a question, but I guess you get the idea.  The issue 
could be on my end, of course.

Arthur Gardner | Infosys Ltd
MetLife | Clarks Summit, PA
Office 570-587-6898 | Mobile 262-442-7472


The information contained in this message may be CONFIDENTIAL and is for the 
intended addressee only.  Any unauthorized use, dissemination of the 
information, or copying of this message is prohibited.  If you are not the 
intended addressee, please notify the sender immediately and delete this 
message.


[basex-talk] Windows installer

2019-05-13 Thread Gardner, Arthur
Hi.  I've installed the Windows Installer (9.2.1) in Windows 10.

The installed shortcut points to BaseX.exe.

When I click it, I see this message: This app can't run on your PC

If I modify the shortcut to point to BaseX.jar, it runs like a champ.

I haven't actually asked a question, but I guess you get the idea.  The issue 
could be on my end, of course.


Arthur Gardner | Infosys Ltd
MetLife | Clarks Summit, PA
Office 570-587-6898 | Mobile 262-442-7472


The information contained in this message may be CONFIDENTIAL and is for the 
intended addressee only.  Any unauthorized use, dissemination of the 
information, or copying of this message is prohibited.  If you are not the 
intended addressee, please notify the sender immediately and delete this 
message.


Re: [basex-talk] ArrayIndexOutOfBoundsException: 2147483647

2019-05-13 Thread Christian Grün
Hi Paul,

Your database might have exceeded the node limit for a single database
[1,2]. If the ADD command is used, the update will be rejected before the
nodes are inserted. I think we should add these checks to XQuery updates.

Best,
Christian

[1] http://docs.basex.org/wiki/Statistics
[2] http://docs.basex.org/wiki/Databases



Han (US), Paul P  schrieb am Mo., 13. Mai 2019,
18:15:

> Hello,
>
>
>
> We encountered this ArrayIndexOutOfBoundsException when importing large
> data file with version 9.1.  Can you please us help?
>
>
>
> Thanks,
>
> Paul
>
>
>
> 019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT Contact:
> basex-talk@mailman.uni-konstanz.de
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT Version: BaseX 9.1
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT Java: Oracle
> Corporation, 1.8.0_201
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT OS: Linux, amd64
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT Stack Trace:
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT 
> java.lang.ArrayIndexOutOfBoundsException:
> 2147483647
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.basex.io.random.TableDiskAccess.fpre(TableDiskAccess.java:502)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.basex.io.random.TableDiskAccess.cursor(TableDiskAccess.java:453)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.basex.io.random.TableDiskAccess.read4(TableDiskAccess.java:165)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.basex.data.Data.size(Data.java:348)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.basex.data.NSNode.find(NSNode.java:128)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.basex.data.Namespaces.uriIdForPrefix(Namespaces.java:159)?
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.basex.data.Namespaces.root(Namespaces.java:234)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.basex.data.NSScope.loop(NSScope.java:44)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.basex.data.Data.insert(Data.java:772)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.basex.query.up.primitives.db.DBAdd.apply(DBAdd.java:67)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.basex.query.up.DataUpdates.apply(DataUpdates.java:175)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.basex.query.up.ContextModifier.apply(ContextModifier.java:120)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.basex.query.up.Updates.apply(Updates.java:156)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.basex.query.QueryContext.iter(QueryContext.java:350)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.basex.query.QueryProcessor.iter(QueryProcessor.java:90)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.basex.core.cmd.AQuery.query(AQuery.java:109)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.basex.core.cmd.XQuery.run(XQuery.java:22)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.basex.core.Command.run(Command.java:257)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.basex.http.rest.RESTCmd.run(RESTCmd.java:105)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.basex.http.rest.RESTQuery.query(RESTQuery.java:69)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.basex.http.rest.RESTQuery.run0(RESTQuery.java:37)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.basex.http.rest.RESTCmd.run(RESTCmd.java:70)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.basex.core.Command.run(Command.java:257)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.basex.core.Command.execute(Command.java:93)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.basex.core.Command.execute(Command.java:116)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.basex.http.rest.RESTServlet.run(RESTServlet.java:27)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.basex.http.BaseXServlet.service(BaseXServlet.java:59)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
>
>   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
>
>2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(A

[basex-talk] ArrayIndexOutOfBoundsException: 2147483647

2019-05-13 Thread Han (US), Paul P
Hello,

We encountered this ArrayIndexOutOfBoundsException when importing large data 
file with version 9.1.  Can you please us help?

Thanks,
Paul

019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT Contact: 
basex-talk@mailman.uni-konstanz.de
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT Version: BaseX 9.1
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT Java: Oracle Corporation, 
1.8.0_201
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT OS: Linux, amd64
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT Stack Trace:
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT 
java.lang.ArrayIndexOutOfBoundsException: 2147483647
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.basex.io.random.TableDiskAccess.fpre(TableDiskAccess.java:502)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.basex.io.random.TableDiskAccess.cursor(TableDiskAccess.java:453)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.basex.io.random.TableDiskAccess.read4(TableDiskAccess.java:165)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.basex.data.Data.size(Data.java:348)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.basex.data.NSNode.find(NSNode.java:128)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.basex.data.Namespaces.uriIdForPrefix(Namespaces.java:159)?
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.basex.data.Namespaces.root(Namespaces.java:234)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.basex.data.NSScope.loop(NSScope.java:44)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.basex.data.Data.insert(Data.java:772)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.basex.query.up.primitives.db.DBAdd.apply(DBAdd.java:67)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.basex.query.up.DataUpdates.apply(DataUpdates.java:175)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.basex.query.up.ContextModifier.apply(ContextModifier.java:120)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.basex.query.up.Updates.apply(Updates.java:156)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.basex.query.QueryContext.iter(QueryContext.java:350)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.basex.query.QueryProcessor.iter(QueryProcessor.java:90)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.basex.core.cmd.AQuery.query(AQuery.java:109)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.basex.core.cmd.XQuery.run(XQuery.java:22)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.basex.core.Command.run(Command.java:257)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.basex.http.rest.RESTCmd.run(RESTCmd.java:105)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.basex.http.rest.RESTQuery.query(RESTQuery.java:69)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.basex.http.rest.RESTQuery.run0(RESTQuery.java:37)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.basex.http.rest.RESTCmd.run(RESTCmd.java:70)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.basex.core.Command.run(Command.java:257)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.basex.core.Command.execute(Command.java:93)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.basex.core.Command.execute(Command.java:116)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.basex.http.rest.RESTServlet.run(RESTServlet.java:27)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.basex.http.BaseXServlet.service(BaseXServlet.java:59)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
  2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
   2019-05-13T15:56:45.05+ [APP/PROC/WEB/1] OUT at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBa

Re: [basex-talk] ​[experr:HC0001] unknown protocol: localhost (Windows only)

2019-05-13 Thread Christian Grün
You can specify arbitrary file system paths as argument:

• If you prefix your actual path with db:option('WEBPATH'), you should
end up in the directory that’s relevant for you.
• file:base-dir() points to the directory of your XQuery module
• file:current-dir() points to the directory from which BaseX or your
web server was started.



On Mon, May 13, 2019 at 6:01 PM France Baril
 wrote:
>
> It looks for content in the home directory, not in webapp/static.
>
> Le lun. 13 mai 2019 12 h 04, Christian Grün  a 
> écrit :
>>
>> > My 1st thought was the file module, but it doesn't seem to have access to 
>> > that directory.
>>
>> Sounds surprising. Which error message do you get?
>>
>>
>> >>  Hi France,
>> >>
>> >> Thanks for the test case. I called your RESTXQ function with Windows,
>> >> and it seems to work. What I did:
>> >>
>> >> * I started basexhttp.bat
>> >> * I modified your script to be runnable (8972 → 8984, namespace added
>> >> for "a-test", etc.)
>> >> * I added a test.png to the "static" webapp directory
>> >> * I called http://localhost/a-test (in the browser and via curl), it
>> >> returns 200
>> >>
>> >> Maybe you did something differently?
>> >>
>> >> Does the problem persist if you…
>> >>
>> >> * send the HTTP request without xquery:fork-join?
>> >> * use fetch:binary?
>> >>
>> >> The easier your example code and setup is, the easier it might get to
>> >> reproduce the problem.
>> >>
>> >> And a general observation: It’s recommendable not to the same HTTP
>> >> instance from a RESTXQ function (but this may simply have been the
>> >> result of our persistance to deliver us with reproducible test
>> >> cases?).
>> >>
>> >> Cheers
>> >> Christian
>> >>
>> >>
>> >> On Wed, May 8, 2019 at 11:54 AM France Baril
>> >>  wrote:
>> >> >
>> >> > Hi,
>> >> >
>> >> > We have two servers with similar jetty configuration, we find that an 
>> >> > http:request call on static works on Linux but not on Windows.
>> >> >
>> >> > HOW TO REPLICATE
>> >> >
>> >> > Add an image test.png in webapp/static
>> >> > Try the attached .xqm (change img-url for your server path)
>> >> > Copy of the .xqm function for reference:
>> >> >
>> >> >> declare  %rest:path('/a-test')
>> >> >>%rest:GET
>> >> >>%output:method("html")
>> >> >>%output:html-version("5.0")
>> >> >> function a-test:http-req(){
>> >> >>let $img-url := 'http://localhost:8972/static/test.png'
>> >> >>let $http-function := function() {http:send-request(> >> >> method='get' status-only='true'/>, $img-url)}
>> >> >>let $http-s := xquery:fork-join($http-function)
>> >> >>let $http-status := $http-s//data(@status)
>> >> >>return {$http-status}
>> >> >> };
>> >> >
>> >> >
>> >> > Test: http://localhost:8972/a-test
>> >> >
>> >> > Result on Linux: 200
>> >> > Result on Windows: [experr:HC0001] unknown protocol: localhost
>> >> >
>> >> > This seemed to be security issue, but tests in multiple browsers return 
>> >> > the same results and enabling CORS doesn't help... technically we're 
>> >> > calling from the same domain/port... but hey we tried!
>> >> >
>> >> > If we type the value of $img-url directly in the browser, we see the 
>> >> > image on both platforms, so the issue is not with accessing the image 
>> >> > itself, but with accessing it with the http:send-request function.
>> >
>> >
>> >
>> > --
>> > France Baril
>> > Architecte documentaire / Documentation architect
>> > france.ba...@architextus.com


Re: [basex-talk] ​[experr:HC0001] unknown protocol: localhost (Windows only)

2019-05-13 Thread France Baril
It looks for content in the home directory, not in webapp/static.

Le lun. 13 mai 2019 12 h 04, Christian Grün  a
écrit :

> > My 1st thought was the file module, but it doesn't seem to have access
> to that directory.
>
> Sounds surprising. Which error message do you get?
>
>
> >>  Hi France,
> >>
> >> Thanks for the test case. I called your RESTXQ function with Windows,
> >> and it seems to work. What I did:
> >>
> >> * I started basexhttp.bat
> >> * I modified your script to be runnable (8972 → 8984, namespace added
> >> for "a-test", etc.)
> >> * I added a test.png to the "static" webapp directory
> >> * I called http://localhost/a-test (in the browser and via curl), it
> >> returns 200
> >>
> >> Maybe you did something differently?
> >>
> >> Does the problem persist if you…
> >>
> >> * send the HTTP request without xquery:fork-join?
> >> * use fetch:binary?
> >>
> >> The easier your example code and setup is, the easier it might get to
> >> reproduce the problem.
> >>
> >> And a general observation: It’s recommendable not to the same HTTP
> >> instance from a RESTXQ function (but this may simply have been the
> >> result of our persistance to deliver us with reproducible test
> >> cases?).
> >>
> >> Cheers
> >> Christian
> >>
> >>
> >> On Wed, May 8, 2019 at 11:54 AM France Baril
> >>  wrote:
> >> >
> >> > Hi,
> >> >
> >> > We have two servers with similar jetty configuration, we find that an
> http:request call on static works on Linux but not on Windows.
> >> >
> >> > HOW TO REPLICATE
> >> >
> >> > Add an image test.png in webapp/static
> >> > Try the attached .xqm (change img-url for your server path)
> >> > Copy of the .xqm function for reference:
> >> >
> >> >> declare  %rest:path('/a-test')
> >> >>%rest:GET
> >> >>%output:method("html")
> >> >>%output:html-version("5.0")
> >> >> function a-test:http-req(){
> >> >>let $img-url := 'http://localhost:8972/static/test.png'
> >> >>let $http-function := function() {http:send-request( method='get' status-only='true'/>, $img-url)}
> >> >>let $http-s := xquery:fork-join($http-function)
> >> >>let $http-status := $http-s//data(@status)
> >> >>return {$http-status}
> >> >> };
> >> >
> >> >
> >> > Test: http://localhost:8972/a-test
> >> >
> >> > Result on Linux: 200
> >> > Result on Windows: [experr:HC0001] unknown protocol: localhost
> >> >
> >> > This seemed to be security issue, but tests in multiple browsers
> return the same results and enabling CORS doesn't help... technically we're
> calling from the same domain/port... but hey we tried!
> >> >
> >> > If we type the value of $img-url directly in the browser, we see the
> image on both platforms, so the issue is not with accessing the image
> itself, but with accessing it with the http:send-request function.
> >
> >
> >
> > --
> > France Baril
> > Architecte documentaire / Documentation architect
> > france.ba...@architextus.com
>


Re: [basex-talk] (no subject)

2019-05-13 Thread Christian Grün
> Yes. I tried sending the request to Google via an online took. As a matter of 
> fact, I also tried to send it in an HTML form and I got a correct response.

In that case, you could compare your XQuery string with the HTTP
request data that is sent by the browser.



> On May 13, 2019, at 5:20 PM, Christian Grün  wrote:
>
> Did you already manage to send a successful request via curl or via any other 
> ways?
>
>
>
> On Mon, May 13, 2019 at 12:25 PM Chantal Ragy  
> wrote:
>>
>> Hi Christian,
>>
>> i am trying to send Google a POST request and provide the server with 
>> requested parameters. However, it compiles with an error of either missing 
>> content length or of missing required parameter, although all the parameters 
>> are actually provided.
>>
>> 
>>
>> On May 13, 2019, at 12:21 PM, Christian Grün  
>> wrote:
>>
>> i am trying to send a post request to google token endpoint. However, I am 
>> not able to send a list of parameters in the POST request.
>> Does anyone have an idea how to do so?
>>
>>
>> What did you try so far?
>>
>>
>


Re: [basex-talk] (no subject)

2019-05-13 Thread Christian Grün
Did you already manage to send a successful request via curl or via any
other ways?



On Mon, May 13, 2019 at 12:25 PM Chantal Ragy 
wrote:

> Hi Christian,
>
> i am trying to send Google a POST request and provide the server with
> requested parameters. However, it compiles with an error of either missing
> content length or of missing required parameter, although all the
> parameters are actually provided.
>
>
> On May 13, 2019, at 12:21 PM, Christian Grün 
> wrote:
>
> i am trying to send a post request to google token endpoint. However, I am
> not able to send a list of parameters in the POST request.
> Does anyone have an idea how to do so?
>
>
> What did you try so far?
>
>
>


Re: [basex-talk] (no subject)

2019-05-13 Thread Christian Grün
> i am trying to send a post request to google token endpoint. However, I am 
> not able to send a list of parameters in the POST request.
> Does anyone have an idea how to do so?

What did you try so far?


Re: [basex-talk] RestXQ custom HTTP error code

2019-05-13 Thread Christian Grün
Dear Jérôme,

Thanks for your observation. I have readopted the processing of the
XQuery error code; it’s working again in the latest snapshot [1].

Salutations,
Christian

[1] http://files.basex.org/releases/latest/


On Fri, May 10, 2019 at 10:46 AM Jerome Chauveau
 wrote:
>
> Hi,
>
> I am trying to return a custom http error code in my rxq webapp (jetty 
> embeded) like is the documentation :
>
> declare
>   %rest:path("/teapot")
> function page:teapot() {
>   fn:error(xs:QName('error'), "I'm a teapot", 418)
> };
>
> My client always receive a 400 instead of 418.
>
> Tests are running on BaseX912 & BaseX921.
> Thank you for your time.
>
> Regards,
>
> Jérôme Chauveau


Re: [basex-talk] ​[experr:HC0001] unknown protocol: localhost (Windows only)

2019-05-13 Thread Christian Grün
> My 1st thought was the file module, but it doesn't seem to have access to 
> that directory.

Sounds surprising. Which error message do you get?


>>  Hi France,
>>
>> Thanks for the test case. I called your RESTXQ function with Windows,
>> and it seems to work. What I did:
>>
>> * I started basexhttp.bat
>> * I modified your script to be runnable (8972 → 8984, namespace added
>> for "a-test", etc.)
>> * I added a test.png to the "static" webapp directory
>> * I called http://localhost/a-test (in the browser and via curl), it
>> returns 200
>>
>> Maybe you did something differently?
>>
>> Does the problem persist if you…
>>
>> * send the HTTP request without xquery:fork-join?
>> * use fetch:binary?
>>
>> The easier your example code and setup is, the easier it might get to
>> reproduce the problem.
>>
>> And a general observation: It’s recommendable not to the same HTTP
>> instance from a RESTXQ function (but this may simply have been the
>> result of our persistance to deliver us with reproducible test
>> cases?).
>>
>> Cheers
>> Christian
>>
>>
>> On Wed, May 8, 2019 at 11:54 AM France Baril
>>  wrote:
>> >
>> > Hi,
>> >
>> > We have two servers with similar jetty configuration, we find that an 
>> > http:request call on static works on Linux but not on Windows.
>> >
>> > HOW TO REPLICATE
>> >
>> > Add an image test.png in webapp/static
>> > Try the attached .xqm (change img-url for your server path)
>> > Copy of the .xqm function for reference:
>> >
>> >> declare  %rest:path('/a-test')
>> >>%rest:GET
>> >>%output:method("html")
>> >>%output:html-version("5.0")
>> >> function a-test:http-req(){
>> >>let $img-url := 'http://localhost:8972/static/test.png'
>> >>let $http-function := function() {http:send-request(> >> method='get' status-only='true'/>, $img-url)}
>> >>let $http-s := xquery:fork-join($http-function)
>> >>let $http-status := $http-s//data(@status)
>> >>return {$http-status}
>> >> };
>> >
>> >
>> > Test: http://localhost:8972/a-test
>> >
>> > Result on Linux: 200
>> > Result on Windows: [experr:HC0001] unknown protocol: localhost
>> >
>> > This seemed to be security issue, but tests in multiple browsers return 
>> > the same results and enabling CORS doesn't help... technically we're 
>> > calling from the same domain/port... but hey we tried!
>> >
>> > If we type the value of $img-url directly in the browser, we see the image 
>> > on both platforms, so the issue is not with accessing the image itself, 
>> > but with accessing it with the http:send-request function.
>
>
>
> --
> France Baril
> Architecte documentaire / Documentation architect
> france.ba...@architextus.com


Re: [basex-talk] Database lock during RESTXQ operation

2019-05-13 Thread Michael Seiferle
Hi Martin,

This error may happen if (1) two different instances of basex try to 
open/update the very same database.
As BaseX uses standard JVM functionality to acquire the Lock it is very likely 
that indeed to different processes tried to access the very same file.

Maybe there is some kind of shared database between your instances that you are 
trying to access?




Best from Konstanz

Michael



> Am 10.05.2019 um 09:17 schrieb Martin Iggulden 
> :
> 
> the same Java VM because the RESTXQ server is the only active interface to 
> the database.
>  
> We have seen this error before, but it’s difficult to reproduce.
>  
> Do you know how this might have happened? And is there a procedure for 
> clearing down an erroneous database lock if it happens?
>  
> We are running BaseX version 9.1.2.
>