From: Jason S. <js...@in...> - 2011-02-24 20:33:32
|
I'm not as familiar with the REST API, so I will have to defer this to others. You mentioned you have your own error handler. What does it do? This sure looks like something is shutting down the server in the normal way. You aren't calling System.exit() in your code anywhere, by chance? Jason Smith ________________________________ From: Lauri Hyttinen [lau...@ho...] Sent: Thursday, February 24, 2011 4:55 AM To: Jason Smith; exi...@li... Subject: RE: [Exist-development] Java exceptions crash the server Hello Jason (and others) You asked in another email what I used to call the xquery (which calls the java method) and the answer is REST. Yes the addAineistoKuvaus method calls: table.appendChild(table.importNode(new_statmeta_node,true)); and this causes the crash. The small bit of java code I had in the earlier email worked just fine and it was a bit later in the code that this method call occurred. The problem with the call is that I am trying to put the new_statmeta_node in the wrong place and I have fixed this error now so it does not occur anymore. While fixing the error I used insertBefore method which caused the error below (the new error has also been fixed, I had forgotten to import the node to the document). org.w3c.dom.DOMException: WRONG_DOCUMENT_ERR: A node is used in a different document than the one that created it. at org.apache.xerces.dom.ParentNode.internalInsertBefore(Unknown Source) at org.apache.xerces.dom.ParentNode.insertBefore(Unknown Source) at metariv2.MetariV2.addAineistoKuvaus(MetariV2.java:680) However this exception also crashed the server similarly to HIERARCHY_REQUEST_ERR. So the problem persists, for some reason these exception crash the server. Now I am thinking that maybe my own error handler causes these problems? Could this be the case? Since these two exceptions are about doing things to the document that are not allowed? That part of the code I am a bit unsure of since it is basically from this page: http://download.oracle.com/javase/tutorial/jaxp/dom/readingXML.html#gestm Also I got some more stacktrace stuff that occurred in one of the runs, not sure if it is related. It came after shutdown had occurred. ... 24 helmi 2011 12:30:07,114 [Shutdown] INFO (Server.java [run]:565) - Shutdown hook complete Failed to release query result on server: Failed to create input stream: Connection refused Failed to release query result on server: Failed to create input stream: Connection refused Failed to release query result on server: Failed to read server's response: Connection refused Failed to release query result on server: Failed to read server's response: Connection refused Failed to release query result on server: Failed to read server's response: Connection refused 24 helmi 2011 12:30:07,316 [P1-7] WARN (ServletHandler.java [handle]:577) - EXCEPTION javax.servlet.ServletException: An error occurred: An unknown error occurred: I/O error while processing request: null at org.exist.http.urlrewrite.XQueryURLRewrite.doFilter(XQueryURLRewrite.java:360) at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568) at org.mortbay.http.HttpContext.handle(HttpContext.java:1530) at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633) at org.mortbay.http.HttpContext.handle(HttpContext.java:1482) at org.mortbay.http.HttpServer.service(HttpServer.java:909) at org.mortbay.http.HttpConnection.service(HttpConnection.java:820) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837) at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534) 24 helmi 2011 12:30:07,317 [P1-7] WARN (ServletHandler.java [handle]:577) - EXCEPTION javax.servlet.ServletException: An unknown error occurred: I/O error while processing request: null at org.exist.xmlrpc.RpcServlet.doPost(RpcServlet.java:60) at javax.servlet.http.HttpServlet.service(HttpServlet.java:763) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:473) at org.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:263) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:171) at org.exist.http.urlrewrite.Forward.doRewrite(Forward.java:44) at org.exist.http.urlrewrite.XQueryURLRewrite.doFilter(XQueryURLRewrite.java:203) at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568) at org.mortbay.http.HttpContext.handle(HttpContext.java:1530) at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633) at org.mortbay.http.HttpContext.handle(HttpContext.java:1482) at org.mortbay.http.HttpServer.service(HttpServer.java:909) at org.mortbay.http.HttpConnection.service(HttpConnection.java:820) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837) at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534) 24 helmi 2011 12:30:07,319 [P1-7] WARN (ServletHandler.java [handle]:577) - EXCEPTION javax.servlet.ServletException: I/O error while processing request: null at org.apache.xmlrpc.webserver.XmlRpcServletServer.execute(XmlRpcServletServer.java:114) at org.apache.xmlrpc.webserver.XmlRpcServlet.doPost(XmlRpcServlet.java:196) at org.exist.xmlrpc.RpcServlet.doPost(RpcServlet.java:57) at javax.servlet.http.HttpServlet.service(HttpServlet.java:763) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:473) at org.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:263) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:171) at org.exist.http.urlrewrite.Forward.doRewrite(Forward.java:44) at org.exist.http.urlrewrite.XQueryURLRewrite.doFilter(XQueryURLRewrite.java:203) at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568) at org.mortbay.http.HttpContext.handle(HttpContext.java:1530) at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633) at org.mortbay.http.HttpContext.handle(HttpContext.java:1482) at org.mortbay.http.HttpServer.service(HttpServer.java:909) at org.mortbay.http.HttpConnection.service(HttpConnection.java:820) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837) at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534) 24 helmi 2011 12:30:07,321 [P1-7] WARN (ServletHandler.java [handle]:595) - /exist/xmlrpc: org.apache.xmlrpc.XmlRpcException: I/O error while processing request: null at org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcStreamServer.java:247) at org.apache.xmlrpc.webserver.XmlRpcServletServer.execute(XmlRpcServletServer.java:112) at org.apache.xmlrpc.webserver.XmlRpcServlet.doPost(XmlRpcServlet.java:196) at org.exist.xmlrpc.RpcServlet.doPost(RpcServlet.java:57) at javax.servlet.http.HttpServlet.service(HttpServlet.java:763) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:473) at org.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:263) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:171) at org.exist.http.urlrewrite.Forward.doRewrite(Forward.java:44) at org.exist.http.urlrewrite.XQueryURLRewrite.doFilter(XQueryURLRewrite.java:203) at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568) at org.mortbay.http.HttpContext.handle(HttpContext.java:1530) at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633) at org.mortbay.http.HttpContext.handle(HttpContext.java:1482) at org.mortbay.http.HttpServer.service(HttpServer.java:909) at org.mortbay.http.HttpConnection.service(HttpConnection.java:820) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837) at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534) Caused by: EOFException(EOFException(java.net.SocketException: Socket closed)) at org.mortbay.http.BufferedOutputStream.flush(BufferedOutputStream.java:209) at org.mortbay.http.HttpOutputStream.flush(HttpOutputStream.java:478) at org.mortbay.http.HttpOutputStream.write(HttpOutputStream.java:425) at org.mortbay.jetty.servlet.ServletOut.write(ServletOut.java:54) at java.io.ByteArrayOutputStream.writeTo(ByteArrayOutputStream.java:109) at org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcStreamServer.java:237) ... 24 more Caused by: EOFException(EOFException(java.net.SocketException: Socket closed)) at org.mortbay.http.BufferedOutputStream.flush(BufferedOutputStream.java:209) at org.mortbay.http.HttpOutputStream.flush(HttpOutputStream.java:478) at org.mortbay.http.HttpOutputStream.write(HttpOutputStream.java:425) at org.mortbay.jetty.servlet.ServletOut.write(ServletOut.java:54) at java.io.ByteArrayOutputStream.writeTo(ByteArrayOutputStream.java:109) at org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcStreamServer.java:237) at org.apache.xmlrpc.webserver.XmlRpcServletServer.execute(XmlRpcServletServer.java:112) at org.apache.xmlrpc.webserver.XmlRpcServlet.doPost(XmlRpcServlet.java:196) at org.exist.xmlrpc.RpcServlet.doPost(RpcServlet.java:57) at javax.servlet.http.HttpServlet.service(HttpServlet.java:763) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:473) at org.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:263) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:171) at org.exist.http.urlrewrite.Forward.doRewrite(Forward.java:44) at org.exist.http.urlrewrite.XQueryURLRewrite.doFilter(XQueryURLRewrite.java:203) at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568) at org.mortbay.http.HttpContext.handle(HttpContext.java:1530) at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633) at org.mortbay.http.HttpContext.handle(HttpContext.java:1482) at org.mortbay.http.HttpServer.service(HttpServer.java:909) at org.mortbay.http.HttpConnection.service(HttpConnection.java:820) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837) at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534) ________________________________ From: js...@in... To: lau...@ho...; exi...@li... Date: Tue, 22 Feb 2011 08:42:28 -0800 Subject: RE: [Exist-development] Java exceptions crash the server It looks like you have an XQuery that is calling back into your own code, into a command called "enrich." Inside that method, you make a call to addAineistoKuvaus, which in turn is trying to do something with a Xerces DOM document. You are attempting to insert a node where it is not permitted. There isn't really any eXist code involved in the error at this point - it's all MetariV2 and Xerces. Maybe you are trying to do something directly to the document, when you mean to use the documentElement??? Jason Smith ________________________________ From: Lauri Hyttinen [lau...@ho...] Sent: Tuesday, February 22, 2011 5:44 AM To: exi...@li... Subject: Re: [Exist-development] Java exceptions crash the server This is the tailend of the stacktrace + end of the exist output (from startup.sh). The metariv2.MetariV2 stuff is my code. org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted. at org.apache.xerces.dom.CoreDocumentImpl.insertBefore(Unknown Source) at org.apache.xerces.dom.NodeImpl.appendChild(Unknown Source) at metariv2.MetariV2.addAineistoKuvaus(MetariV2.java:664) at metariv2.MetariV2.enrich(MetariV2.java:1339) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.exist.xquery.JavaCall.eval(JavaCall.java:266) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:61) at org.exist.xquery.PathExpr.eval(PathExpr.java:241) at org.exist.xquery.LetExpr.eval(LetExpr.java:155) at org.exist.xquery.BindingExpression.eval(BindingExpression.java:158) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:61) at org.exist.xquery.PathExpr.eval(PathExpr.java:241) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:61) at org.exist.xquery.PathExpr.eval(PathExpr.java:241) at org.exist.xquery.ConditionalExpression.eval(ConditionalExpression.java:100) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:61) at org.exist.xquery.PathExpr.eval(PathExpr.java:241) at org.exist.xquery.DynamicCardinalityCheck.eval(DynamicCardinalityCheck.java:71) at org.exist.xquery.functions.util.CatchFunction.eval(CatchFunction.java:83) at org.exist.xquery.InternalFunctionCall.eval(InternalFunctionCall.java:55) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:61) at org.exist.xquery.PathExpr.eval(PathExpr.java:241) at org.exist.xquery.DebuggableExpression.eval(DebuggableExpression.java:56) at org.exist.xquery.DebuggableExpression.eval(DebuggableExpression.java:63) at org.exist.xquery.LetExpr.eval(LetExpr.java:208) at org.exist.xquery.LetExpr.eval(LetExpr.java:206) at org.exist.xquery.LetExpr.eval(LetExpr.java:206) at org.exist.xquery.LetExpr.eval(LetExpr.java:206) at org.exist.xquery.LetExpr.eval(LetExpr.java:206) at org.exist.xquery.LetExpr.eval(LetExpr.java:206) at org.exist.xquery.LetExpr.eval(LetExpr.java:206) at org.exist.xquery.LetExpr.eval(LetExpr.java:206) at org.exist.xquery.LetExpr.eval(LetExpr.java:206) at org.exist.xquery.BindingExpression.eval(BindingExpression.java:158) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:61) at org.exist.xquery.PathExpr.eval(PathExpr.java:241) at org.exist.xquery.UserDefinedFunction.eval(UserDefinedFunction.java:137) at org.exist.xquery.FunctionCall.evalFunction(FunctionCall.java:274) at org.exist.xquery.FunctionCall.eval(FunctionCall.java:201) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:61) at org.exist.xquery.PathExpr.eval(PathExpr.java:241) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:61) at org.exist.xquery.PathExpr.eval(PathExpr.java:241) at org.exist.xquery.ConditionalExpression.eval(ConditionalExpression.java:100) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:61) at org.exist.xquery.PathExpr.eval(PathExpr.java:241) at org.exist.xquery.DebuggableExpression.eval(DebuggableExpression.java:56) at org.exist.xquery.ConditionalExpression.eval(ConditionalExpression.java:102) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:61) at org.exist.xquery.PathExpr.eval(PathExpr.java:241) at org.exist.xquery.DynamicCardinalityCheck.eval(DynamicCardinalityCheck.java:71) at org.exist.xquery.functions.util.CatchFunction.eval(CatchFunction.java:83) at org.exist.xquery.InternalFunctionCall.eval(InternalFunctionCall.java:55) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:61) at org.exist.xquery.PathExpr.eval(PathExpr.java:241) at org.exist.xquery.DebuggableExpression.eval(DebuggableExpression.java:56) at org.exist.xquery.DebuggableExpression.eval(DebuggableExpression.java:63) at org.exist.xquery.LetExpr.eval(LetExpr.java:208) at org.exist.xquery.LetExpr.eval(LetExpr.java:206) at org.exist.xquery.LetExpr.eval(LetExpr.java:206) at org.exist.xquery.LetExpr.eval(LetExpr.java:206) at org.exist.xquery.BindingExpression.eval(BindingExpression.java:158) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:61) at org.exist.xquery.PathExpr.eval(PathExpr.java:241) at org.exist.xquery.UserDefinedFunction.eval(UserDefinedFunction.java:137) at org.exist.xquery.FunctionCall.evalFunction(FunctionCall.java:274) at org.exist.xquery.FunctionCall.eval(FunctionCall.java:201) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:61) at org.exist.xquery.PathExpr.eval(PathExpr.java:241) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:61) at org.exist.xquery.XQuery.execute(XQuery.java:228) at org.exist.xquery.XQuery.execute(XQuery.java:183) at org.exist.http.RESTServer.executeXQuery(RESTServer.java:1233) at org.exist.http.RESTServer.doGet(RESTServer.java:435) at org.exist.http.servlets.EXistServlet.doGet(EXistServlet.java:323) at javax.servlet.http.HttpServlet.service(HttpServlet.java:743) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:473) at org.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:263) at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:171) at org.exist.http.urlrewrite.Forward.doRewrite(Forward.java:44) at org.exist.http.urlrewrite.XQueryURLRewrite.doFilter(XQueryURLRewrite.java:203) at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821) at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568) at org.mortbay.http.HttpContext.handle(HttpContext.java:1530) at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633) at org.mortbay.http.HttpContext.handle(HttpContext.java:1482) at org.mortbay.http.HttpServer.service(HttpServer.java:909) at org.mortbay.http.HttpConnection.service(HttpConnection.java:820) at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986) at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837) at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534) 22 helmi 2011 13:58:59,906 [Shutdown] INFO (Server.java [run]:555) - Shutdown hook executing 22 helmi 2011 13:58:59,907 [Acceptor ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=8080]] INFO (ThreadedServer.java [run]:659) - Stopping Acceptor ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=8080] 22 helmi 2011 13:59:00,026 [Shutdown] INFO (SocketListener.java [stop]:213) - Stopped SocketListener on 0.0.0.0:8080 22 helmi 2011 13:59:00,053 [Shutdown] INFO (Container.java [stop]:156) - Stopped org.mortbay.jetty.servlet.WebApplicationHandler@22ce00 22 helmi 2011 13:59:00,379 [Shutdown] INFO (Container.java [stop]:156) - Stopped WebApplicationContext[/exist,eXist XML Database] 22 helmi 2011 13:59:00,380 [Shutdown] INFO (Container.java [stop]:156) - Stopped org.mortbay.jetty.Server@1c297a3 22 helmi 2011 13:59:00,380 [Shutdown] INFO (Server.java [run]:565) - Shutdown hook complete Failed to release query result on server: Failed to create input stream: Connection refused Failed to release query result on server: Failed to read server's response: Connection refused Failed to release query result on server: Failed to read server's response: Connection refused Failed to release query result on server: Failed to read server's response: Connection refused Failed to release query result on server: Failed to read server's response: Connection refused Failed to release query result on server: Failed to read server's response: Connection refused 22 helmi 2011 14:01:00,131 [Shutdown] ERROR (JettyStart.java [shutdown]:241) - Database shutdown: stopping server in 1sec ... Afterwards when I restart the server: user@server:~/bin/startup.sh Using locale: fi_FI.UTF-8 22 helmi 2011 14:02:58,453 [main] INFO (JettyStart.java [run]:90) - Configuring eXist from /usr/local/exist/conf.xml 22 helmi 2011 14:02:58,454 [main] INFO (JettyStart.java [run]:91) - 22 helmi 2011 14:02:58,454 [main] INFO (JettyStart.java [run]:92) - Running with Java 1.6.0 [Sun Microsystems Inc. (Java HotSpot(TM) Server VM) in /usr/lib/jvm/java-6-sun-1.6.0.00/jre] 22 helmi 2011 14:02:58,455 [main] INFO (JettyStart.java [run]:97) - 22 helmi 2011 14:02:58,456 [main] INFO (JettyStart.java [run]:101) - [eXist Version : 1.4.0] 22 helmi 2011 14:02:58,456 [main] INFO (JettyStart.java [run]:103) - [eXist Build : 20091111] 22 helmi 2011 14:02:58,457 [main] INFO (JettyStart.java [run]:105) - [eXist Home : /usr/local/exist] 22 helmi 2011 14:02:58,457 [main] INFO (JettyStart.java [run]:107) - [SVN Revision : 10440] 22 helmi 2011 14:02:58,458 [main] INFO (JettyStart.java [run]:115) - [Operating System : Linux 2.6.15-53-server i386] 22 helmi 2011 14:02:58,458 [main] INFO (JettyStart.java [run]:118) - [jetty.home : /usr/local/exist/tools/jetty] 22 helmi 2011 14:02:58,459 [main] INFO (JettyStart.java [run]:120) - [log4j.configuration : file:/usr/local/exist/log4j.xml] Redo [=============================================== ] (94 %)= ] (94 %) It gets stuck here. Nothing happens for minutes, until I get bored and ctrl+c it. I may have jumped the gun on this one though, because the the next time server starts the index is broken. PS. I have zeroed on the offending code on my metariv2 stuff to be this part if it helps in any way. while(i2.hasMoreResources()) { XMLResource s = (XMLResource)i2.nextResource(); Node node = s.getContentAsDOM(); Node statmeta_import = node.getFirstChild(); for (int j = 0; j < statmeta_old_classifications.getLength(); j++) { Element link = (Element)statmeta_old_classifications.item(j); if (link.getAttribute("classificationId").equals(luokitusID)) { //Replace the old empty classfication with the one retrieved Node korvattava = statmeta_old_classifications.item(j); Node korvattavan_parent = korvattava.getParentNode(); korvattavan_parent.replaceChild(statmeta_docu.importNode(statmeta_import, true),korvattava); } } } Best regards, Lauri Hyttinen ________________________________ From: da...@ex... Date: Tue, 22 Feb 2011 09:28:01 +0100 Subject: Re: [Exist-development] Java exceptions crash the server To: lau...@ho... CC: exi...@li... Hi, On Tue, Feb 22, 2011 at 8:35 AM, Lauri Hyttinen <lau...@ho...<mailto:lau...@ho...>> wrote: My code causes an org.w3c.dom.DOMException with a HIERACHY REQUEST ERROR being the cause and this causes eXist to shut down. Earlier I had a null pointer exception which also caused the same effect. The null pointer exception is fixed and I am in the process of addressing the DOMException. But regardless of the exception is eXist supposed to shut down when a java module does these things? I know I have to write better java code :) but still it would be easier on the mind when I did not crash the server with my faulty java module. it is unlikely that such an exception crashes the database. To understand your issue better I'd need to see the stacktraces. In general: if the databases stops to respond, in many cases the 'broker' is never returned to the 'brokerpool'. This is fatal since there is just a limited number of brokers available. regards Dannes -- eXist-db Native XML Database - http://exist-db.org Join us on linked-in: http://www.linkedin.com/groups?gid=35624 |