From: Joe W. <jo...@gm...> - 2011-05-04 13:06:34
|
On a related note, is it correct that a simple request like: http:send-request(<http:request method="GET" href="http://exist-db.org/"/>) should return an NPE? I've saved this query as /db/http-test.xq and run as http://localhost:8080/exist/apps/http-test.xq, and here's the NPE error: HTTP ERROR 500 Problem accessing /exist/apps/http-test.xq. Reason: An error occurred: null Caused by: javax.servlet.ServletException: An error occurred: null at org.exist.http.servlets.EXistServlet.doGet(EXistServlet.java:367) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:534) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:476) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:517) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:934) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:404) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:184) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:869) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:240) at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:116) at org.exist.http.urlrewrite.Forward.doRewrite(Forward.java:47) at org.exist.http.urlrewrite.XQueryURLRewrite.doRewrite(XQueryURLRewrite.java:523) at org.exist.http.urlrewrite.XQueryURLRewrite.doFilter(XQueryURLRewrite.java:343) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1323) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:474) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:480) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:934) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:404) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:184) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:869) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:151) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) at org.eclipse.jetty.server.Server.handle(Server.java:346) at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:581) at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:1040) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:592) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:214) at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:411) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:526) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:41) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:528) at java.lang.Thread.run(Thread.java:680) Caused by: java.lang.NullPointerException at java.io.Reader.<init>(Reader.java:61) at java.io.InputStreamReader.<init>(InputStreamReader.java:80) at org.cyberneko.html.HTMLScanner$ContentScanner.changeEncoding(HTMLScanner.java:2679) at org.cyberneko.html.HTMLScanner$ContentScanner.scanPI(HTMLScanner.java:2537) at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:1990) at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:910) at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:499) at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:452) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.exist.xquery.modules.ModuleUtils.htmlToXHtml(ModuleUtils.java:241) at org.exist.xquery.modules.ModuleUtils.htmlToXHtml(ModuleUtils.java:185) at org.expath.httpclient.model.exist.EXistResult.add(EXistResult.java:80) at org.expath.httpclient.impl.XmlResponseBody.init(XmlResponseBody.java:78) at org.expath.httpclient.impl.XmlResponseBody.<init>(XmlResponseBody.java:45) at org.expath.httpclient.impl.BodyFactory.makeResponsePart(BodyFactory.java:101) at org.expath.httpclient.impl.BodyFactory.makeResponseBody(BodyFactory.java:85) at org.expath.httpclient.impl.HttpRequestImpl.send(HttpRequestImpl.java:58) at org.expath.exist.SendRequestFunction.sendOnce(SendRequestFunction.java:170) at org.expath.exist.SendRequestFunction.sendRequest(SendRequestFunction.java:144) at org.expath.exist.SendRequestFunction.eval(SendRequestFunction.java:126) at org.exist.xquery.BasicFunction.eval(BasicFunction.java:68) at org.exist.xquery.InternalFunctionCall.eval(InternalFunctionCall.java:55) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:70) at org.exist.xquery.PathExpr.eval(PathExpr.java:243) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:70) at org.exist.xquery.XQuery.execute(XQuery.java:246) at org.exist.xquery.XQuery.execute(XQuery.java:201) at org.exist.http.RESTServer.executeXQuery(RESTServer.java:1393) at org.exist.http.RESTServer.doGet(RESTServer.java:465) at org.exist.http.servlets.EXistServlet.doGet(EXistServlet.java:334) ... 39 more Caused by: java.lang.NullPointerException at java.io.Reader.<init>(Reader.java:61) at java.io.InputStreamReader.<init>(InputStreamReader.java:80) at org.cyberneko.html.HTMLScanner$ContentScanner.changeEncoding(HTMLScanner.java:2679) at org.cyberneko.html.HTMLScanner$ContentScanner.scanPI(HTMLScanner.java:2537) at org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:1990) at org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:910) at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:499) at org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:452) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.exist.xquery.modules.ModuleUtils.htmlToXHtml(ModuleUtils.java:241) at org.exist.xquery.modules.ModuleUtils.htmlToXHtml(ModuleUtils.java:185) at org.expath.httpclient.model.exist.EXistResult.add(EXistResult.java:80) at org.expath.httpclient.impl.XmlResponseBody.init(XmlResponseBody.java:78) at org.expath.httpclient.impl.XmlResponseBody.<init>(XmlResponseBody.java:45) at org.expath.httpclient.impl.BodyFactory.makeResponsePart(BodyFactory.java:101) at org.expath.httpclient.impl.BodyFactory.makeResponseBody(BodyFactory.java:85) at org.expath.httpclient.impl.HttpRequestImpl.send(HttpRequestImpl.java:58) at org.expath.exist.SendRequestFunction.sendOnce(SendRequestFunction.java:170) at org.expath.exist.SendRequestFunction.sendRequest(SendRequestFunction.java:144) at org.expath.exist.SendRequestFunction.eval(SendRequestFunction.java:126) at org.exist.xquery.BasicFunction.eval(BasicFunction.java:68) at org.exist.xquery.InternalFunctionCall.eval(InternalFunctionCall.java:55) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:70) at org.exist.xquery.PathExpr.eval(PathExpr.java:243) at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:70) at org.exist.xquery.XQuery.execute(XQuery.java:246) at org.exist.xquery.XQuery.execute(XQuery.java:201) at org.exist.http.RESTServer.executeXQuery(RESTServer.java:1393) at org.exist.http.RESTServer.doGet(RESTServer.java:465) at org.exist.http.servlets.EXistServlet.doGet(EXistServlet.java:334) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:534) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:476) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:517) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:934) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:404) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:184) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:869) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:240) at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:116) at org.exist.http.urlrewrite.Forward.doRewrite(Forward.java:47) at org.exist.http.urlrewrite.XQueryURLRewrite.doRewrite(XQueryURLRewrite.java:523) at org.exist.http.urlrewrite.XQueryURLRewrite.doFilter(XQueryURLRewrite.java:343) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1323) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:474) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:480) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:934) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:404) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:184) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:869) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:151) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) at org.eclipse.jetty.server.Server.handle(Server.java:346) at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:581) at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:1040) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:592) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:214) at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:411) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:526) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:41) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:528) at java.lang.Thread.run(Thread.java:680) Powered by Jetty:// |