Repeating "bin/basexhttp -S" and "bin/basexhttpstop" is no longer supported?
On BaseX 9.4.1 and 9.4.2, you can repeat:
$ java -version java version "1.8.0_261" Java(TM) SE Runtime Environment (build 1.8.0_261-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.261-b12, mixed mode) $ BaseX941/basex/bin/basexhttp -S /tmp/BaseX941/basex/.basex: writing new configuration file. BaseX 9.4.1 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @676ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was started (port: 8984). Server was started (port: 1984). $ BaseX941/basex/bin/basexhttpstop BaseX 9.4.1 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @227ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was stopped (port: 8984). Server was stopped (port: 1984). $ BaseX941/basex/bin/basexhttp -S BaseX 9.4.1 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @231ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was started (port: 8984). Server was started (port: 1984). $ BaseX941/basex/bin/basexhttpstop BaseX 9.4.1 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @237ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was stopped (port: 8984). Server was stopped (port: 1984).
On 9.4.3, you can't:
$ BaseX943/basex/bin/basexhttp -S /tmp/BaseX943/basex/.basex: writing new configuration file. BaseX 9.4.3 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @309ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was started (port: 8984). Server was started (port: 1984). $ BaseX943/basex/bin/basexhttpstop BaseX 9.4.3 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @250ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was stopped (port: 8984). Server was stopped (port: 1984). $ BaseX943/basex/bin/basexhttp -S BaseX 9.4.3 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @254ms to org.eclipse.jetty.util.log.Slf4jLog [main] INFO org.eclipse.jetty.util.log - Logging initialized @225ms to org.eclipse.jetty.util.log.Slf4jLog [main] INFO org.eclipse.jetty.server.Server - jetty-9.4.31.v20200723; built: 2020-07-23T17:57:36.812Z; git: 450ba27947e13e66baa8cd1ce7e85a4461cacc1d; jvm 1.8.0_261-b12 [main] INFO org.eclipse.jetty.webapp.StandardDescriptorProcessor - NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet [main] INFO org.eclipse.jetty.server.session - DefaultSessionIdManager workerName=node0 [main] INFO org.eclipse.jetty.server.session - No SessionScavenger set, using defaults [main] INFO org.eclipse.jetty.server.session - node0 Scavenging every 600000ms [main] WARN org.eclipse.jetty.server.handler.ContextHandler.ROOT - unavailable org.basex.core.BaseXException: Server is running or permission was denied (port: 1984). at org.basex.BaseXServer.<init>(BaseXServer.java:108) at org.basex.http.HTTPContext.init(HTTPContext.java:102) at org.basex.http.BaseXServlet.init(BaseXServlet.java:37) at org.eclipse.jetty.servlet.ServletHolder$WrapperServlet.init(ServletHolder.java:1289) at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:602) at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:413) at org.eclipse.jetty.servlet.ServletHandler.lambda$initialize$0(ServletHandler.java:767) at java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:352) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:483) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) at java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:312) at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:743) at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580) at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:791) at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:360) at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1445) at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1409) at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:855) at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:275) at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:524) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169) at org.eclipse.jetty.server.Server.start(Server.java:408) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110) at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97) at org.eclipse.jetty.server.Server.doStart(Server.java:372) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) at org.basex.BaseXHTTP.<init>(BaseXHTTP.java:128) at org.basex.BaseXHTTP.main(BaseXHTTP.java:52) [main] WARN org.eclipse.jetty.webapp.WebAppContext - Failed startup of context o.e.j.w.WebAppContext@44f75083{BaseX: The XML Database and XQuery Processor,/,file:///tmp/BaseX943/basex/webapp/,UNAVAILABLE}{/tmp/BaseX943/basex/webapp} javax.servlet.ServletException: org.basex.core.BaseXException: Server is running or permission was denied (port: 1984). at org.basex.http.BaseXServlet.init(BaseXServlet.java:39) at org.eclipse.jetty.servlet.ServletHolder$WrapperServlet.init(ServletHolder.java:1289) at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:602) at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:413) at org.eclipse.jetty.servlet.ServletHandler.lambda$initialize$0(ServletHandler.java:767) at java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:352) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:483) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) at java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:312) at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:743) at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580) at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:791) at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:360) at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1445) at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1409) at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:855) at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:275) at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:524) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169) at org.eclipse.jetty.server.Server.start(Server.java:408) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110) at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97) at org.eclipse.jetty.server.Server.doStart(Server.java:372) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) at org.basex.BaseXHTTP.<init>(BaseXHTTP.java:128) at org.basex.BaseXHTTP.main(BaseXHTTP.java:52) Caused by: org.basex.core.BaseXException: Server is running or permission was denied (port: 1984). at org.basex.BaseXServer.<init>(BaseXServer.java:108) at org.basex.http.HTTPContext.init(HTTPContext.java:102) at org.basex.http.BaseXServlet.init(BaseXServlet.java:37) ... 26 more Failed to bind to /0.0.0.0:8984
Hi AirQuick,
The BaseX startup behavior hasn’t been changed in recent versions, and I didn’t manage to reproduce the behavior you described. Which OS do you use? Does it work if you delay the invocations?
If you use Linux, it’s usually more elegant to start BaseX as background task. A second Java process will be launched when running -S, and this process cannot be controlled by the original process anymore.
Cheers Christian
basexhttp -S
BaseX 9.4.4 beta [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @342ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was started (port: 80). Server was started (port: 1984).
basexhttpstop
BaseX 9.4.4 beta [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @345ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was stopped (port: 80). Server was stopped (port: 1984).
basexhttp -S
BaseX 9.4.4 beta [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @322ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was started (port: 80). Server was started (port: 1984).
basexhttp stop
BaseX 9.4.4 beta [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @342ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was stopped (port: 80). Server was stopped (port: 1984).
On 9/14/20, AirQuick noreply@airquick.airpost.net wrote:
Repeating "bin/basexhttp -S" and "bin/basexhttpstop" is no longer supported?
On BaseX 9.4.1 and 9.4.2, you can repeat:
$ java -version java version "1.8.0_261" Java(TM) SE Runtime Environment (build 1.8.0_261-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.261-b12, mixed mode) $ BaseX941/basex/bin/basexhttp -S /tmp/BaseX941/basex/.basex: writing new configuration file. BaseX 9.4.1 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @676ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was started (port: 8984). Server was started (port: 1984). $ BaseX941/basex/bin/basexhttpstop BaseX 9.4.1 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @227ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was stopped (port: 8984). Server was stopped (port: 1984). $ BaseX941/basex/bin/basexhttp -S BaseX 9.4.1 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @231ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was started (port: 8984). Server was started (port: 1984). $ BaseX941/basex/bin/basexhttpstop BaseX 9.4.1 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @237ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was stopped (port: 8984). Server was stopped (port: 1984).
On 9.4.3, you can't:
$ BaseX943/basex/bin/basexhttp -S /tmp/BaseX943/basex/.basex: writing new configuration file. BaseX 9.4.3 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @309ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was started (port: 8984). Server was started (port: 1984). $ BaseX943/basex/bin/basexhttpstop BaseX 9.4.3 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @250ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was stopped (port: 8984). Server was stopped (port: 1984). $ BaseX943/basex/bin/basexhttp -S BaseX 9.4.3 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @254ms to org.eclipse.jetty.util.log.Slf4jLog [main] INFO org.eclipse.jetty.util.log - Logging initialized @225ms to org.eclipse.jetty.util.log.Slf4jLog [main] INFO org.eclipse.jetty.server.Server - jetty-9.4.31.v20200723; built: 2020-07-23T17:57:36.812Z; git: 450ba27947e13e66baa8cd1ce7e85a4461cacc1d; jvm 1.8.0_261-b12 [main] INFO org.eclipse.jetty.webapp.StandardDescriptorProcessor - NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet [main] INFO org.eclipse.jetty.server.session - DefaultSessionIdManager workerName=node0 [main] INFO org.eclipse.jetty.server.session - No SessionScavenger set, using defaults [main] INFO org.eclipse.jetty.server.session - node0 Scavenging every 600000ms [main] WARN org.eclipse.jetty.server.handler.ContextHandler.ROOT - unavailable org.basex.core.BaseXException: Server is running or permission was denied (port: 1984). at org.basex.BaseXServer.<init>(BaseXServer.java:108) at org.basex.http.HTTPContext.init(HTTPContext.java:102) at org.basex.http.BaseXServlet.init(BaseXServlet.java:37) at org.eclipse.jetty.servlet.ServletHolder$WrapperServlet.init(ServletHolder.java:1289) at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:602) at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:413) at org.eclipse.jetty.servlet.ServletHandler.lambda$initialize$0(ServletHandler.java:767) at java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:352) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:483) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) at java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:312) at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:743) at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580) at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:791) at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:360) at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1445) at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1409) at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:855) at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:275) at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:524) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169) at org.eclipse.jetty.server.Server.start(Server.java:408) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110) at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97) at org.eclipse.jetty.server.Server.doStart(Server.java:372) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) at org.basex.BaseXHTTP.<init>(BaseXHTTP.java:128) at org.basex.BaseXHTTP.main(BaseXHTTP.java:52) [main] WARN org.eclipse.jetty.webapp.WebAppContext - Failed startup of context o.e.j.w.WebAppContext@44f75083{BaseX: The XML Database and XQuery Processor,/,file:///tmp/BaseX943/basex/webapp/,UNAVAILABLE}{/tmp/BaseX943/basex/webapp} javax.servlet.ServletException: org.basex.core.BaseXException: Server is running or permission was denied (port: 1984). at org.basex.http.BaseXServlet.init(BaseXServlet.java:39) at org.eclipse.jetty.servlet.ServletHolder$WrapperServlet.init(ServletHolder.java:1289) at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:602) at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:413) at org.eclipse.jetty.servlet.ServletHandler.lambda$initialize$0(ServletHandler.java:767) at java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:352) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:483) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) at java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:312) at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:743) at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580) at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:791) at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:360) at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1445) at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1409) at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:855) at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:275) at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:524) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169) at org.eclipse.jetty.server.Server.start(Server.java:408) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110) at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97) at org.eclipse.jetty.server.Server.doStart(Server.java:372) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) at org.basex.BaseXHTTP.<init>(BaseXHTTP.java:128) at org.basex.BaseXHTTP.main(BaseXHTTP.java:52) Caused by: org.basex.core.BaseXException: Server is running or permission was denied (port: 1984). at org.basex.BaseXServer.<init>(BaseXServer.java:108) at org.basex.http.HTTPContext.init(HTTPContext.java:102) at org.basex.http.BaseXServlet.init(BaseXServlet.java:37) ... 26 more Failed to bind to /0.0.0.0:8984
-- AirQuick
Thanks for taking a look at this issue, Christian.
I use Ubuntu 18.04 LTS. Waiting for approx 10 seconds between the commands did not help. My GitHub Actions instances suggest that the same problem happens also on macOS 10.15.6.
As far as I tested with "mvn clean package -DskipTests=true" on Ubuntu 18.04 LTS, the problem seems to have started at the commit c51ce563.
A similar behavior is observed also on Windows 10. java.exe process launched by `basexhttp -S` does not quit after `basexhttpstop`:
``` C:\Users\WDAGUtilityAccount\Desktop\BaseX943\basex>query process java.exe No Process exists for java.exe
C:\Users\WDAGUtilityAccount\Desktop\BaseX943\basex>bin\basexhttp -S C:/Users/WDAGUtilityAccount/Desktop/BaseX943/basex/.basex: writing new configuration file. BaseX 9.4.3 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @497ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was started (port: 8984). Server was started (port: 1984).
C:\Users\WDAGUtilityAccount\Desktop\BaseX943\basex>query process java.exe USERNAME SESSIONNAME ID PID IMAGE
wdagutilityaccount 31c5ce942... 1 5736 java.exe
C:\Users\WDAGUtilityAccount\Desktop\BaseX943\basex>bin\basexhttpstop BaseX 9.4.3 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @431ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was stopped (port: 8984). Server was stopped (port: 1984).
C:\Users\WDAGUtilityAccount\Desktop\BaseX943\basex>query process java.exe USERNAME SESSIONNAME ID PID IMAGE
wdagutilityaccount 31c5ce942... 1 5736 java.exe
C:\Users\WDAGUtilityAccount\Desktop\BaseX943\basex> ```
java.exe process goes away on 9.4.2:
``` C:\Users\WDAGUtilityAccount\Desktop\BaseX942\basex>query process java.exe No Process exists for java.exe
C:\Users\WDAGUtilityAccount\Desktop\BaseX942\basex>bin\basexhttp -S C:/Users/WDAGUtilityAccount/Desktop/BaseX942/basex/.basex: writing new configuration file. BaseX 9.4.2 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @475ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was started (port: 8984). Server was started (port: 1984).
C:\Users\WDAGUtilityAccount\Desktop\BaseX942\basex>query process java.exe USERNAME SESSIONNAME ID PID IMAGE
wdagutilityaccount 31c5ce942... 1 6000 java.exe
C:\Users\WDAGUtilityAccount\Desktop\BaseX942\basex>bin\basexhttpstop BaseX 9.4.2 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @429ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was stopped (port: 8984). Server was stopped (port: 1984).
C:\Users\WDAGUtilityAccount\Desktop\BaseX942\basex>query process java.exe No Process exists for java.exe
C:\Users\WDAGUtilityAccount\Desktop\BaseX942\basex> ```
The link to the specific commit that introduced the problem was very helpful: If the server is stopped, a notification file is written to the temporary directory of the local file system. The location of this file was changed, and the server could only be stopped with an existing 'basex' folder in the temporary directory.
A new snapshot is available [1]. The commit contains some more lines of code [2], as I have fixed some little inconsistencies that were introduced with the Jetty 9 upgrade.
Cheers Christian
[1] https://files.basex.org/releases/latest/ [2] https://github.com/BaseXdb/basex/commit/f72d87e77339561ae287f49281d32012dcae...
I use Ubuntu 18.04 LTS. Waiting for approx 10 seconds between the commands did not help. My GitHub Actions instances suggest that the same problem happens also on macOS 10.15.6.
As far as I tested with "mvn clean package -DskipTests=true" on Ubuntu 18.04 LTS, the problem seems to have started at the commit c51ce563.
A similar behavior is observed also on Windows 10. java.exe process launched by `basexhttp -S` does not quit after `basexhttpstop`:
C:\Users\WDAGUtilityAccount\Desktop\BaseX943\basex>query process java.exe No Process exists for java.exe C:\Users\WDAGUtilityAccount\Desktop\BaseX943\basex>bin\basexhttp -S C:/Users/WDAGUtilityAccount/Desktop/BaseX943/basex/.basex: writing new configuration file. BaseX 9.4.3 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @497ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was started (port: 8984). Server was started (port: 1984). C:\Users\WDAGUtilityAccount\Desktop\BaseX943\basex>query process java.exe USERNAME SESSIONNAME ID PID IMAGE >wdagutilityaccount 31c5ce942... 1 5736 java.exe C:\Users\WDAGUtilityAccount\Desktop\BaseX943\basex>bin\basexhttpstop BaseX 9.4.3 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @431ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was stopped (port: 8984). Server was stopped (port: 1984). C:\Users\WDAGUtilityAccount\Desktop\BaseX943\basex>query process java.exe USERNAME SESSIONNAME ID PID IMAGE >wdagutilityaccount 31c5ce942... 1 5736 java.exe C:\Users\WDAGUtilityAccount\Desktop\BaseX943\basex>
java.exe process goes away on 9.4.2:
C:\Users\WDAGUtilityAccount\Desktop\BaseX942\basex>query process java.exe No Process exists for java.exe C:\Users\WDAGUtilityAccount\Desktop\BaseX942\basex>bin\basexhttp -S C:/Users/WDAGUtilityAccount/Desktop/BaseX942/basex/.basex: writing new configuration file. BaseX 9.4.2 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @475ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was started (port: 8984). Server was started (port: 1984). C:\Users\WDAGUtilityAccount\Desktop\BaseX942\basex>query process java.exe USERNAME SESSIONNAME ID PID IMAGE >wdagutilityaccount 31c5ce942... 1 6000 java.exe C:\Users\WDAGUtilityAccount\Desktop\BaseX942\basex>bin\basexhttpstop BaseX 9.4.2 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @429ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was stopped (port: 8984). Server was stopped (port: 1984). C:\Users\WDAGUtilityAccount\Desktop\BaseX942\basex>query process java.exe No Process exists for java.exe C:\Users\WDAGUtilityAccount\Desktop\BaseX942\basex>
-- AirQuick
----- Original message ----- From: "Christian Grün" christian.gruen@gmail.com To: AirQuick noreply@airquick.airpost.net Cc: basex-talk@mailman.uni-konstanz.de Subject: Re: [basex-talk] Repeating "bin/basexhttp -S" and "bin/basexhttpstop" Date: Tuesday, September 15, 2020 15:59
Hi AirQuick,
The BaseX startup behavior hasn’t been changed in recent versions, and I didn’t manage to reproduce the behavior you described. Which OS do you use? Does it work if you delay the invocations?
If you use Linux, it’s usually more elegant to start BaseX as background task. A second Java process will be launched when running -S, and this process cannot be controlled by the original process anymore.
Cheers Christian
basexhttp -S
BaseX 9.4.4 beta [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @342ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was started (port: 80). Server was started (port: 1984).
basexhttpstop
BaseX 9.4.4 beta [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @345ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was stopped (port: 80). Server was stopped (port: 1984).
basexhttp -S
BaseX 9.4.4 beta [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @322ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was started (port: 80). Server was started (port: 1984).
basexhttp stop
BaseX 9.4.4 beta [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @342ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was stopped (port: 80). Server was stopped (port: 1984).
On 9/14/20, AirQuick noreply@airquick.airpost.net wrote:
Repeating "bin/basexhttp -S" and "bin/basexhttpstop" is no longer supported?
On BaseX 9.4.1 and 9.4.2, you can repeat:
$ java -version java version "1.8.0_261" Java(TM) SE Runtime Environment (build 1.8.0_261-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.261-b12, mixed mode) $ BaseX941/basex/bin/basexhttp -S /tmp/BaseX941/basex/.basex: writing new configuration file. BaseX 9.4.1 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @676ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was started (port: 8984). Server was started (port: 1984). $ BaseX941/basex/bin/basexhttpstop BaseX 9.4.1 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @227ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was stopped (port: 8984). Server was stopped (port: 1984). $ BaseX941/basex/bin/basexhttp -S BaseX 9.4.1 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @231ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was started (port: 8984). Server was started (port: 1984). $ BaseX941/basex/bin/basexhttpstop BaseX 9.4.1 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @237ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was stopped (port: 8984). Server was stopped (port: 1984).
On 9.4.3, you can't:
$ BaseX943/basex/bin/basexhttp -S /tmp/BaseX943/basex/.basex: writing new configuration file. BaseX 9.4.3 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @309ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was started (port: 8984). Server was started (port: 1984). $ BaseX943/basex/bin/basexhttpstop BaseX 9.4.3 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @250ms to org.eclipse.jetty.util.log.Slf4jLog HTTP Server was stopped (port: 8984). Server was stopped (port: 1984). $ BaseX943/basex/bin/basexhttp -S BaseX 9.4.3 [HTTP Server] [main] INFO org.eclipse.jetty.util.log - Logging initialized @254ms to org.eclipse.jetty.util.log.Slf4jLog [main] INFO org.eclipse.jetty.util.log - Logging initialized @225ms to org.eclipse.jetty.util.log.Slf4jLog [main] INFO org.eclipse.jetty.server.Server - jetty-9.4.31.v20200723; built: 2020-07-23T17:57:36.812Z; git: 450ba27947e13e66baa8cd1ce7e85a4461cacc1d; jvm 1.8.0_261-b12 [main] INFO org.eclipse.jetty.webapp.StandardDescriptorProcessor - NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet [main] INFO org.eclipse.jetty.server.session - DefaultSessionIdManager workerName=node0 [main] INFO org.eclipse.jetty.server.session - No SessionScavenger set, using defaults [main] INFO org.eclipse.jetty.server.session - node0 Scavenging every 600000ms [main] WARN org.eclipse.jetty.server.handler.ContextHandler.ROOT - unavailable org.basex.core.BaseXException: Server is running or permission was denied (port: 1984). at org.basex.BaseXServer.<init>(BaseXServer.java:108) at org.basex.http.HTTPContext.init(HTTPContext.java:102) at org.basex.http.BaseXServlet.init(BaseXServlet.java:37) at org.eclipse.jetty.servlet.ServletHolder$WrapperServlet.init(ServletHolder.java:1289) at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:602) at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:413) at org.eclipse.jetty.servlet.ServletHandler.lambda$initialize$0(ServletHandler.java:767) at java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:352) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:483) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) at java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:312) at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:743) at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580) at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:791) at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:360) at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1445) at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1409) at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:855) at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:275) at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:524) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169) at org.eclipse.jetty.server.Server.start(Server.java:408) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110) at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97) at org.eclipse.jetty.server.Server.doStart(Server.java:372) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) at org.basex.BaseXHTTP.<init>(BaseXHTTP.java:128) at org.basex.BaseXHTTP.main(BaseXHTTP.java:52) [main] WARN org.eclipse.jetty.webapp.WebAppContext - Failed startup of context o.e.j.w.WebAppContext@44f75083{BaseX: The XML Database and XQuery Processor,/,file:///tmp/BaseX943/basex/webapp/,UNAVAILABLE}{/tmp/BaseX943/basex/webapp} javax.servlet.ServletException: org.basex.core.BaseXException: Server is running or permission was denied (port: 1984). at org.basex.http.BaseXServlet.init(BaseXServlet.java:39) at org.eclipse.jetty.servlet.ServletHolder$WrapperServlet.init(ServletHolder.java:1289) at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:602) at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:413) at org.eclipse.jetty.servlet.ServletHandler.lambda$initialize$0(ServletHandler.java:767) at java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:352) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:483) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) at java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:312) at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:743) at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580) at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:791) at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:360) at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1445) at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1409) at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:855) at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:275) at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:524) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169) at org.eclipse.jetty.server.Server.start(Server.java:408) at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110) at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97) at org.eclipse.jetty.server.Server.doStart(Server.java:372) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72) at org.basex.BaseXHTTP.<init>(BaseXHTTP.java:128) at org.basex.BaseXHTTP.main(BaseXHTTP.java:52) Caused by: org.basex.core.BaseXException: Server is running or permission was denied (port: 1984). at org.basex.BaseXServer.<init>(BaseXServer.java:108) at org.basex.http.HTTPContext.init(HTTPContext.java:102) at org.basex.http.BaseXServlet.init(BaseXServlet.java:37) ... 26 more Failed to bind to /0.0.0.0:8984
-- AirQuick
Thanks for fixing it. With the new snapshot, the problem is no longer reproduced on Ubuntu 18.04 LTS and Windows 10.
basex-talk@mailman.uni-konstanz.de