From: Jay S. <ja...@ja...> - 2010-07-27 23:07:56
|
Dmitriy, Ah ha! Your work around suggestion is a good straightforward one. Does eXist currently have an algorithm for handling that offending code being executed 2 or more times simulatenously? I suppose each transaction occurs atomically, on a copy of the tree as it existed when the code was encountered? Or is that intended behavior? Should you or I file a bug report about this? I'm happy to if it will save you time, it will be my first so if there are any more specifics let me know. This error is a relief, I thought it had something to do with my recursion, which would've really set me back. This isn't so bad. Thank you very much Dmitriy! Cheers from Adelaide, Jay On Tue, 27 Jul 2010 20:53:41 +0500 Dmitriy Shabanov <sha...@gm...> wrote: > Hi Jay, > > The problem you have is concurrent update issue (eXist's bug). > > The "eval code" is @kdr.xqm line "update delete > $log/log-entry[position() le ($count - $max)]" > > I'll try to resolve it, but don't know what time it will take. Possible > workaround: schedule it (per hour or any) & remove from module. > > -- > Cheers, > > Dmitriy Shabanov > > PS Are you doing it on your own or for big boss? > > On Mon, 2010-07-26 at 10:03 +0930, Jay Straw wrote: > > You guess right :-) I think a database backup zip and another archive with my filesystem scripts would be most appropriate, it's a wide system with the modular hooks. http://jaystraw.info/exist has them. Or should I post everything here? Let me know if you need anything else or have any questions. > > > > To reproduce the error: > > > > + Restore db backup zip in eXist, and unzip filesystem zip in webapp/ (includes my controller.xql of course) > > > > + try going to url /Deep (case sensitive), it should work and the nav is only two links (that expand when clicked, and load fragments dynamically, all should work for the moment) > > > > + Refresh several times. Things don't always look the same, or work, depending on when/where the NullPtr occurs. If you have firebug or similiar you can see 500's being returned, here for the CSS, there for a js file or two. Never the request itself gets a 500 it seems, only subsequent requests. And if their content's programmatic (like the /?getKinderTools returns a javascript file) then it's in the response properly, even though the response is a 500 > > > > + Behold the NullPointerExceptions in your exist console window :-) > > > > If you or anyone needs any info, let me know! I've never programmed java, but I'm quick, and eager to solve this problem with you! > > > > Cheers, Jay > > > > On Sun, 25 Jul 2010 20:10:19 +0500 > > Dmitriy Shabanov <sha...@gm...> wrote: > > > > > There are two reason for that error: bug or database corruption. Guess, > > > you did restore or fresh upload, so it should be a bug. > > > > > > Can you share your script & data related to it? (I'll try to reproduce > > > it locally) > > > > > > -- > > > Cheers, > > > > > > Dmitriy Shabanov > > > > > > On Sun, 2010-07-25 at 17:16 +0930, Jay Straw wrote: > > > > Thanks very much Dmitriy. I downloaded the trunk from SVN, compiled it and configured it, including your compiled-cache init param. But I'm getting the same intermittent errors! > > > > > > > > They're all NullPointerException errors. And, all of the stack traces include some Cache function. Sometimes, though I get a 500 from the server, it includes the requested resource like everything went fine, which seems odd. This example wasn't so lucky: > > > > > > > > HTTP ERROR 500 > > > > Problem accessing /script/do.js. Reason: Server Error Caused by: > > > > > > > > java.lang.NullPointerException > > > > at org.exist.xquery.update.Modification.selectAndLock(Modification.java:158) > > > > at org.exist.xquery.update.Delete.eval(Delete.java:123) > > > > 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.DebuggableExpression.eval(DebuggableExpression.java:63) > > > > at org.exist.xquery.LetExpr.eval(LetExpr.java:208) > > > > at org.exist.xquery.BindingExpression.eval(BindingExpression.java:155) > > > > 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.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:155) > > > > 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.LetExpr.eval(LetExpr.java:155) > > > > at org.exist.xquery.ForExpr.eval(ForExpr.java:312) > > > > at org.exist.xquery.BindingExpression.eval(BindingExpression.java:155) > > > > at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:61) > > > > at org.exist.xquery.PathExpr.eval(PathExpr.java:241) > > > > at org.exist.xquery.EnclosedExpr.eval(EnclosedExpr.java:70) > > > > at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:61) > > > > at org.exist.xquery.PathExpr.eval(PathExpr.java:241) > > > > at org.exist.xquery.ElementConstructor.eval(ElementConstructor.java:270) > > > > 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.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:155) > > > > 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:227) > > > > at org.exist.xquery.XQuery.execute(XQuery.java:182) > > > > at org.exist.http.urlrewrite.XQueryURLRewrite.runQuery(XQueryURLRewrite.java:627) > > > > at org.exist.http.urlrewrite.XQueryURLRewrite.doFilter(XQueryURLRewrite.java:243) > > > > cache?--at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187) > > > > at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:421) > > > > at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) > > > > at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:456) > > > > at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:225) > > > > at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:930) > > > > at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:358) > > > > at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183) > > > > at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:866) > > > > at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) > > > > at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126) > > > > at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113) > > > > at org.eclipse.jetty.server.Server.handle(Server.java:351) > > > > at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:594) > > > > at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:1041) > > > > at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:549) > > > > at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:211) > > > > at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:424) > > > > at org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:489) > > > > at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436) > > > > at java.lang.Thread.run(Thread.java:619) > > > > > > > > I've never programmed in Java before (I had to look up NullPointerException today), is this a bug in eXist or Jetty? > > > > > > > > Thanks again, Jay > > > > > > > > On Sun, 25 Jul 2010 09:06:40 +0500 > > > > Dmitriy Shabanov <sha...@gm...> wrote: > > > > > > > > > The trunk have an option to disable script caching that > > > > > @webapp/WEB-INF/web.xml > > > > > <init-param> > > > > > <param-name>compiled-cache</param-name> > > > > > <param-value>false</param-value> > > > > > </init-param> > > > > > > > > > > -- > > > > > Cheers, > > > > > > > > > > Dmitriy Shabanov > > > > > > > > > > On Sun, 2010-07-25 at 10:42 +0930, Jay Straw wrote: > > > > > > Greetings, > > > > > > > > > > > > Is there any way I can turn caching off for every URLRewrite request? Like setting <cache-control cache='no'/> in any <dispatch/>, without actually having to do so? > > > > > > > > > > > > In case you think I'm mad... > > > > > > > > > > > > In controller.xql, I have a FLWOR that checks a collection for modular hooks that can interrupt and direct an HTTP request based on anything. Hooks contain XQuery in a CDATA that is eval'd in the FLWOR. > > > > > > > > > > > > I'm extremely happy with this interface, except cache-control seems to default to 'yes'. > > > > > > > > > > > > I get frequent 500 errors, with java error output has things like: > > > > > > > > > > > > 25 Jul 2010 10:13:41,970 [P1-8] WARN (ServletHandler.java [handle]:577) - EXCEPTION > > > > > > javax.servlet.ServletException: An error occurred: 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) > > > > > > > > > > > > [ ... ] > > > > > > > > > > > > 25 Jul 2010 10:13:41,970 [P1-8] ERROR (ServletHandler.java [handle]:593) - /script/do.js: > > > > > > java.lang.NullPointerException > > > > > > at org.exist.xquery.update.Modification.selectAndLock(Modification.java:159) > > > > > > at org.exist.xquery.update.Delete.eval(Delete.java:123) > > > > > > at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:61) > > > > > > at org.exist.xquery.PathExpr.eval(PathExpr.java:241) > > > > > > > > > > > > [ ... ] > > > > > > > > > > > > The behavior is so weird at times, that I feel...worried. :-) That maybe it's not just this caching issue, but certainly fixing it will improve things (right now I add a newline to controller.xql everytime I modify a hook, which only works once per URL) > > > > > > > > > > > > > > |