BaseX server.close() "Connection refused" in Openshift
Wednesday, 5 March 2014 · 6 messages · last reply 11 Mar 2014
P
P.C.5 Mar 2014 20:49 #
I have set up an application in Openshift. This application has a Tomcat 7 (JBoss EWS 2.0) cartridge. I deploy Web applications to it by sending the WAR with an SFTP client. This is a very simple configuration that would be straightforward to set up in Openshift.
Inside a servlet, I start a BaseX
server so that the servlets in this application can use it as clients.I start it by calling the following instructions, which work as expected: String folder = System.getenv("OPENSHIFT_DATA_DIR"); if (folder == null) folder = System.getProperty("user.home"); System.setProperty("org.basex.path", folder); if (false == BaseXServer.ping(host, 15000)) {
server = new BaseXServer("-p15000", "-e15001", "-n" + System.getenv("OPENSHIFT_JBOSSEWS_IP")); }
(Notice that the environment variable "OPENSHIFT_DATA_DIR" indicates the data directory of the Openshift application, where BaseX should store databases. With this property set, the database path, the repository path and the configuration files are all automatically placed relative to this path. I ping the server to see if it is already running; if not, I start it. Notice that I start the server in port 15000 (event handling port 15001), because these ports are available in Openshift. Also, the server is bound to the IP indicated by the environment variable OPENSHIFT_JBOSSEWS_IP, which is the internal IP in my application.)
The problem is that I can't close this server. When I call server.stop(), a "Connection refused" error occurs. I thought this could be a bug, but this may also be specific to Openshift, because I don't get this error when I execute this simple example in my home computer. Here is the stacktrace:
Mar 05, 2014 8:19:33 AM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [NewServlet] in context with path [/basextest] threw exception java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:579) at java.net.Socket.connect(Socket.java:528) at java.net.Socket.<init>(Socket.java:425) at java.net.Socket.<init>(Socket.java:208) at org.basex.BaseXServer.stop(BaseXServer.java:333) at org.basex.BaseXServer.<init>(BaseXServer.java:93) at org.basex.BaseXServer.<init>(BaseXServer.java:65) at x.NewServlet.processRequest(NewServlet.java:112) at x.NewServlet.doGet(NewServlet.java:128) at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
Thank you in advance.
CG
Christian Grün7 Mar 2014 13:10 #
Hi P.C.,
thanks for describing your setup, and sorry for letting you wait. The reason for the delay is that (at least) I have no clue what might cause the problem. Maybe someone else out there has worked with Openshift before?
Could you add the debugging flag (-d) to the BaseX call and send me the output?
Best,
Christian
Quoted text · P.C. · 93 lines
On Wed, Mar 5, 2014 at 7:49 PM, P.C. <favq1 at yahoo.com> wrote: > I have set up an application in Openshift. This application has a Tomcat 7 > (JBoss EWS 2.0) cartridge. I deploy Web applications to it by sending the > WAR with an SFTP client. This is a very simple configuration that would be > straightforward to set up in Openshift. > > Inside a servlet, I start a BaseX server so that the servlets in this > application can use it as clients. I start it by calling the following > instructions, which work as expected: > > String folder = System.getenv("OPENSHIFT_DATA_DIR"); > if (folder == null) folder = System.getProperty("user.home"); > System.setProperty("org.basex.path", folder); > if (false == BaseXServer.ping(host, 15000)) { > server = new BaseXServer("-p15000", "-e15001", "-n" + > System.getenv("OPENSHIFT_JBOSSEWS_IP")); > } > > (Notice that the environment variable "OPENSHIFT_DATA_DIR" indicates the > data directory of the Openshift application, where BaseX should store > databases. With this property set, the database path, the repository path > and the configuration files are all automatically placed relative to this > path. I ping the server to see if it is already running; if not, I start it. > Notice that I start the server in port 15000 (event handling port 15001), > because these ports are available in Openshift. Also, the server is bound to > the IP indicated by the environment variable OPENSHIFT_JBOSSEWS_IP, which is > the internal IP in my application.) > > The problem is that I can't close this server. When I call server.stop(), a > "Connection refused" error occurs. I thought this could be a bug, but this > may also be specific to Openshift, because I don't get this error when I > execute this simple example in my home computer. Here is the stacktrace: > > Mar 05, 2014 8:19:33 AM org.apache.catalina.core.StandardWrapperValve invoke > SEVERE: Servlet.service() for servlet [NewServlet] in context with path > [/basextest] threw exception > java.net.ConnectException: Connection refused > at java.net.PlainSocketImpl.socketConnect(Native Method) > at > java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) > at > java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) > at > java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) > at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) > at java.net.Socket.connect(Socket.java:579) > at java.net.Socket.connect(Socket.java:528) > at java.net.Socket.<init>(Socket.java:425) > at java.net.Socket.<init>(Socket.java:208) > at org.basex.BaseXServer.stop(BaseXServer.java:333) > at org.basex.BaseXServer.<init>(BaseXServer.java:93) > at org.basex.BaseXServer.<init>(BaseXServer.java:65) > at x.NewServlet.processRequest(NewServlet.java:112) > at x.NewServlet.doGet(NewServlet.java:128) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) > at > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) > at > org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) > at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) > at > org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) > at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) > at > org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008) > at > org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) > at > org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) > > > Thank you in advance. > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
AB
Andy Bunce7 Mar 2014 13:49 #
Hi P.C,
I think you will need to set the
STOPPORT option (-s) [1] to an Openshift friendly value e.g. 15002.
Regards
/Andy
[1] http://docs.basex.org/wiki/Options#STOPPORT
On Fri, Mar 7, 2014 at 12:10 PM, Christian Grün
<christian.gruen at gmail.com>wrote:Quoted text · Christian Grün · 137 lines
> Hi P.C., > > thanks for describing your setup, and sorry for letting you wait. The > reason for the delay is that (at least) I have no clue what might > cause the problem. Maybe someone else out there has worked with > Openshift before? > > Could you add the debugging flag (-d) to the BaseX call and send me the > output? > > Best, > Christian > > > > On Wed, Mar 5, 2014 at 7:49 PM, P.C. <favq1 at yahoo.com> wrote: > > I have set up an application in Openshift. This application has a Tomcat > 7 > > (JBoss EWS 2.0) cartridge. I deploy Web applications to it by sending the > > WAR with an SFTP client. This is a very simple configuration that would > be > > straightforward to set up in Openshift. > > > > Inside a servlet, I start a BaseX server so that the servlets in this > > application can use it as clients. I start it by calling the following > > instructions, which work as expected: > > > > String folder = System.getenv("OPENSHIFT_DATA_DIR"); > > if (folder == null) folder = System.getProperty("user.home"); > > System.setProperty("org.basex.path", folder); > > if (false == BaseXServer.ping(host, 15000)) { > > server = new BaseXServer("-p15000", "-e15001", "-n" + > > System.getenv("OPENSHIFT_JBOSSEWS_IP")); > > } > > > > (Notice that the environment variable "OPENSHIFT_DATA_DIR" indicates the > > data directory of the Openshift application, where BaseX should store > > databases. With this property set, the database path, the repository path > > and the configuration files are all automatically placed relative to this > > path. I ping the server to see if it is already running; if not, I start > it. > > Notice that I start the server in port 15000 (event handling port 15001), > > because these ports are available in Openshift. Also, the server is > bound to > > the IP indicated by the environment variable OPENSHIFT_JBOSSEWS_IP, > which is > > the internal IP in my application.) > > > > The problem is that I can't close this server. When I call > server.stop(), a > > "Connection refused" error occurs. I thought this could be a bug, but > this > > may also be specific to Openshift, because I don't get this error when I > > execute this simple example in my home computer. Here is the stacktrace: > > > > Mar 05, 2014 8:19:33 AM org.apache.catalina.core.StandardWrapperValve > invoke > > SEVERE: Servlet.service() for servlet [NewServlet] in context with path > > [/basextest] threw exception > > java.net.ConnectException: Connection refused > > at java.net.PlainSocketImpl.socketConnect(Native Method) > > at > > > java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) > > at > > > java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) > > at > > > java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) > > at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) > > at java.net.Socket.connect(Socket.java:579) > > at java.net.Socket.connect(Socket.java:528) > > at java.net.Socket.<init>(Socket.java:425) > > at java.net.Socket.<init>(Socket.java:208) > > at org.basex.BaseXServer.stop(BaseXServer.java:333) > > at org.basex.BaseXServer.<init>(BaseXServer.java:93) > > at org.basex.BaseXServer.<init>(BaseXServer.java:65) > > at x.NewServlet.processRequest(NewServlet.java:112) > > at x.NewServlet.doGet(NewServlet.java:128) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) > > at > > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) > > at > > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) > > at > > > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) > > at > > > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) > > at > > > org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) > > at > > > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) > > at > > > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) > > at > > org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) > > at > > > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) > > at > > > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) > > at > > > org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008) > > at > > > org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) > > at > > > org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) > > at > > > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) > > > > > > Thank you in advance. > > > > _______________________________________________ > > BaseX-Talk mailing list > > BaseX-Talk at mailman.uni-konstanz.de > > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk > > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
AB
Andy Bunce7 Mar 2014 14:04 #
I think -s applies only to the basexhttp server not tomcat, but the message does look it is trying to use a disallowed port somewhere.
/Andy
Quoted text · Andy Bunce · 158 lines
On Fri, Mar 7, 2014 at 12:49 PM, Andy Bunce <bunce.andy at gmail.com> wrote: > Hi P.C, > I think you will need to set the STOPPORT option (-s) [1] to an Openshift > friendly value e.g. 15002. > > Regards > /Andy > > [1] http://docs.basex.org/wiki/Options#STOPPORT > > > On Fri, Mar 7, 2014 at 12:10 PM, Christian Grün <christian.gruen at gmail.com > > wrote: > >> Hi P.C., >> >> thanks for describing your setup, and sorry for letting you wait. The >> reason for the delay is that (at least) I have no clue what might >> cause the problem. Maybe someone else out there has worked with >> Openshift before? >> >> Could you add the debugging flag (-d) to the BaseX call and send me the >> output? >> >> Best, >> Christian >> >> >> >> On Wed, Mar 5, 2014 at 7:49 PM, P.C. <favq1 at yahoo.com> wrote: >> > I have set up an application in Openshift. This application has a >> Tomcat 7 >> > (JBoss EWS 2.0) cartridge. I deploy Web applications to it by sending >> the >> > WAR with an SFTP client. This is a very simple configuration that would >> be >> > straightforward to set up in Openshift. >> > >> > Inside a servlet, I start a BaseX server so that the servlets in this >> > application can use it as clients. I start it by calling the following >> > instructions, which work as expected: >> > >> > String folder = System.getenv("OPENSHIFT_DATA_DIR"); >> > if (folder == null) folder = System.getProperty("user.home"); >> > System.setProperty("org.basex.path", folder); >> > if (false == BaseXServer.ping(host, 15000)) { >> > server = new BaseXServer("-p15000", "-e15001", "-n" + >> > System.getenv("OPENSHIFT_JBOSSEWS_IP")); >> > } >> > >> > (Notice that the environment variable "OPENSHIFT_DATA_DIR" indicates the >> > data directory of the Openshift application, where BaseX should store >> > databases. With this property set, the database path, the repository >> path >> > and the configuration files are all automatically placed relative to >> this >> > path. I ping the server to see if it is already running; if not, I >> start it. >> > Notice that I start the server in port 15000 (event handling port >> 15001), >> > because these ports are available in Openshift. Also, the server is >> bound to >> > the IP indicated by the environment variable OPENSHIFT_JBOSSEWS_IP, >> which is >> > the internal IP in my application.) >> > >> > The problem is that I can't close this server. When I call >> server.stop(), a >> > "Connection refused" error occurs. I thought this could be a bug, but >> this >> > may also be specific to Openshift, because I don't get this error when I >> > execute this simple example in my home computer. Here is the stacktrace: >> > >> > Mar 05, 2014 8:19:33 AM org.apache.catalina.core.StandardWrapperValve >> invoke >> > SEVERE: Servlet.service() for servlet [NewServlet] in context with path >> > [/basextest] threw exception >> > java.net.ConnectException: Connection refused >> > at java.net.PlainSocketImpl.socketConnect(Native Method) >> > at >> > >> java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) >> > at >> > >> java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) >> > at >> > >> java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) >> > at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) >> > at java.net.Socket.connect(Socket.java:579) >> > at java.net.Socket.connect(Socket.java:528) >> > at java.net.Socket.<init>(Socket.java:425) >> > at java.net.Socket.<init>(Socket.java:208) >> > at org.basex.BaseXServer.stop(BaseXServer.java:333) >> > at org.basex.BaseXServer.<init>(BaseXServer.java:93) >> > at org.basex.BaseXServer.<init>(BaseXServer.java:65) >> > at x.NewServlet.processRequest(NewServlet.java:112) >> > at x.NewServlet.doGet(NewServlet.java:128) >> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) >> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) >> > at >> > >> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) >> > at >> > >> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) >> > at >> > >> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) >> > at >> > >> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) >> > at >> > >> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) >> > at >> > >> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) >> > at >> > >> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) >> > at >> > >> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) >> > at >> > >> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) >> > at >> > >> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) >> > at >> > >> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008) >> > at >> > >> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) >> > at >> > >> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) >> > at >> > >> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) >> > >> > >> > Thank you in advance. >> > >> > _______________________________________________ >> > BaseX-Talk mailing list >> > BaseX-Talk at mailman.uni-konstanz.de >> > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >> > >> _______________________________________________ >> BaseX-Talk mailing list >> BaseX-Talk at mailman.uni-konstanz.de >> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >> > >
AB
Andy Bunce7 Mar 2014 14:15 #
Does
server.stop(15000,15001)
work?
https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/basex/BaseXServer.java#L329
Quoted text · Andy Bunce · 169 lines
On Fri, Mar 7, 2014 at 1:04 PM, Andy Bunce <bunce.andy at gmail.com> wrote: > I think -s applies only to the basexhttp server not tomcat, but the > message does look it is trying to use a disallowed port somewhere. > /Andy > > > On Fri, Mar 7, 2014 at 12:49 PM, Andy Bunce <bunce.andy at gmail.com> wrote: > >> Hi P.C, >> I think you will need to set the STOPPORT option (-s) [1] to an Openshift >> friendly value e.g. 15002. >> >> Regards >> /Andy >> >> [1] http://docs.basex.org/wiki/Options#STOPPORT >> >> >> On Fri, Mar 7, 2014 at 12:10 PM, Christian Grün < >> christian.gruen at gmail.com> wrote: >> >>> Hi P.C., >>> >>> thanks for describing your setup, and sorry for letting you wait. The >>> reason for the delay is that (at least) I have no clue what might >>> cause the problem. Maybe someone else out there has worked with >>> Openshift before? >>> >>> Could you add the debugging flag (-d) to the BaseX call and send me the >>> output? >>> >>> Best, >>> Christian >>> >>> >>> >>> On Wed, Mar 5, 2014 at 7:49 PM, P.C. <favq1 at yahoo.com> wrote: >>> > I have set up an application in Openshift. This application has a >>> Tomcat 7 >>> > (JBoss EWS 2.0) cartridge. I deploy Web applications to it by sending >>> the >>> > WAR with an SFTP client. This is a very simple configuration that >>> would be >>> > straightforward to set up in Openshift. >>> > >>> > Inside a servlet, I start a BaseX server so that the servlets in this >>> > application can use it as clients. I start it by calling the following >>> > instructions, which work as expected: >>> > >>> > String folder = System.getenv("OPENSHIFT_DATA_DIR"); >>> > if (folder == null) folder = System.getProperty("user.home"); >>> > System.setProperty("org.basex.path", folder); >>> > if (false == BaseXServer.ping(host, 15000)) { >>> > server = new BaseXServer("-p15000", "-e15001", "-n" + >>> > System.getenv("OPENSHIFT_JBOSSEWS_IP")); >>> > } >>> > >>> > (Notice that the environment variable "OPENSHIFT_DATA_DIR" indicates >>> the >>> > data directory of the Openshift application, where BaseX should store >>> > databases. With this property set, the database path, the repository >>> path >>> > and the configuration files are all automatically placed relative to >>> this >>> > path. I ping the server to see if it is already running; if not, I >>> start it. >>> > Notice that I start the server in port 15000 (event handling port >>> 15001), >>> > because these ports are available in Openshift. Also, the server is >>> bound to >>> > the IP indicated by the environment variable OPENSHIFT_JBOSSEWS_IP, >>> which is >>> > the internal IP in my application.) >>> > >>> > The problem is that I can't close this server. When I call >>> server.stop(), a >>> > "Connection refused" error occurs. I thought this could be a bug, but >>> this >>> > may also be specific to Openshift, because I don't get this error when >>> I >>> > execute this simple example in my home computer. Here is the >>> stacktrace: >>> > >>> > Mar 05, 2014 8:19:33 AM org.apache.catalina.core.StandardWrapperValve >>> invoke >>> > SEVERE: Servlet.service() for servlet [NewServlet] in context with path >>> > [/basextest] threw exception >>> > java.net.ConnectException: Connection refused >>> > at java.net.PlainSocketImpl.socketConnect(Native Method) >>> > at >>> > >>> java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) >>> > at >>> > >>> java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) >>> > at >>> > >>> java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) >>> > at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) >>> > at java.net.Socket.connect(Socket.java:579) >>> > at java.net.Socket.connect(Socket.java:528) >>> > at java.net.Socket.<init>(Socket.java:425) >>> > at java.net.Socket.<init>(Socket.java:208) >>> > at org.basex.BaseXServer.stop(BaseXServer.java:333) >>> > at org.basex.BaseXServer.<init>(BaseXServer.java:93) >>> > at org.basex.BaseXServer.<init>(BaseXServer.java:65) >>> > at x.NewServlet.processRequest(NewServlet.java:112) >>> > at x.NewServlet.doGet(NewServlet.java:128) >>> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) >>> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) >>> > at >>> > >>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) >>> > at >>> > >>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) >>> > at >>> > >>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) >>> > at >>> > >>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) >>> > at >>> > >>> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) >>> > at >>> > >>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) >>> > at >>> > >>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) >>> > at >>> > >>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) >>> > at >>> > >>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) >>> > at >>> > >>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) >>> > at >>> > >>> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1008) >>> > at >>> > >>> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) >>> > at >>> > >>> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) >>> > at >>> > >>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) >>> > >>> > >>> > Thank you in advance. >>> > >>> > _______________________________________________ >>> > BaseX-Talk mailing list >>> > BaseX-Talk at mailman.uni-konstanz.de >>> > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >>> > >>> _______________________________________________ >>> BaseX-Talk mailing list >>> BaseX-Talk at mailman.uni-konstanz.de >>> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >>> >> >> >
P
P.C.11 Mar 2014 02:18 #
Christian and Andy,
thank you for the response. I tried to use the "-d" option when starting the server, like this:
server = new BaseXServer("-p"+SERVERPORT, "-e"+EVENTPORT, "-n" + host, "-d");
but I wasn't able to get any information (actually, for some reason I had to change
DEBUG to true inside the .basex file). In the "catalina.out" file, the same "java.net.ConnectException: Connection refused" exception appears. For some reason, the connection is refused when I try to stop the server (but the connection works when trying to execute other commands). In the BaseX log, nothing different appears. It also happens when I try to do the following:
BaseXServer.stop(SERVERPORT, EVENTPORT);
Anyway, in the BaseX log, there are lines such as:
19:35:43.118127.12.249.129:33012adminREQUESTINFO
19:35:43.865127.12.249.129:33012adminOK810.3 ms
19:35:57.304127.12.249.129:33083adminREQUESTINFO
19:35:58.072127.12.249.129:33083adminOK768.67 ms
127.12.249.129 is the internal Openshift IP. The numbers 33012, 33083 are arbitrary port numbers? The Openshift available port numbers range from 15000 to 35530.
thank you in advance.Written for BaseX 7.8. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery