REST/POST Interface and package removal

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

REST/POST Interface and package removal

Jonathan Rowell

Hi,

I have started testing my Grunt scripts with eXist-db version 3.0.

The first thing I notice on installing eXist-db-setup-3.0-acd0c14.jar is the message at the end of the IzPack installation "The syetem cannot find the file C:\Program." - probably because I'm on Windows 7 64-bit - as well as the message "A subdirectory or file c:\eXist-db\tools\jetty\tmp already exists." - probably also irrelevant.

I have been able to load up a package with Grunt, but the unload goes wrong, although on the first attempt I reported OK. It was however, accoding to Dashboard still there. On the subsequent remove it reported that the package was not there, so I looked into the logs. Nothing in exist.log, but in expath-repo.log the following below.
The unload operation posts a request to /exist/apps/dashboard/modules/install.xql and expects a simple reply of application/json and "ok".
It complains about being unable to access java.nio.file.AccessDeniedException: c:\eXist-db\webapp\WEB-INF\data\fs\db\apps\JonathanTest\test -> c:\eXist-db\webapp\WEB-INF\data\fs.journal\txn.2181\oper.830e8638-8dff-47d4-897e-48 which incidentally does not exist.

It seems that the problem lies in guest access. If I install a package and immediately remove it there is no problem. But if I run my package checker after installation and then attempt to remove the package it crashes with an error regarding a txn/oper file. The package checker uses the REST POST interface using Guest access to upload and run a script which tests for the presence of files/documents, and if a document is an XQuery script compiles it, and if an XQuery module enquires whether the module is properly installed - again looking for compilation errors. The REST/POST details are on page 538 of Adam's book.

I rather need the combination of package remove, package load, package test (and subsequent REST tests with Jasmine) as part of my Continuous Integration strategy.
It seems however that the REST interface is not closing handles, so making deletion impossible.

regards

Jonathan




2017-02-10 18:41:00,417 [qtp2140617236-27] INFO  (Deployment.java [installAndDeploy]:280) - Deploying package http://www.programationinformatique.fr/JonathanTest 
2017-02-10 18:50:24,981 [qtp2140617236-47] ERROR (Deployment.java [uninstall]:590) - Exception occurred while removing package. 
java.nio.file.AccessDeniedException: c:\eXist-db\webapp\WEB-INF\data\fs\db\apps\JonathanTest\test -> c:\eXist-db\webapp\WEB-INF\data\fs.journal\txn.2181\oper.830e8638-8dff-47d4-897e-48476e050e27\db\apps\JonathanTest\test
at sun.nio.fs.WindowsException.translateToIOException(Unknown Source) ~[?:1.8.0_77]
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source) ~[?:1.8.0_77]
at sun.nio.fs.WindowsFileCopy.move(Unknown Source) ~[?:1.8.0_77]
at sun.nio.fs.WindowsFileSystemProvider.move(Unknown Source) ~[?:1.8.0_77]
at java.nio.file.Files.move(Unknown Source) ~[?:1.8.0_77]
at org.exist.storage.NativeBroker.removeCollection(NativeBroker.java:1657) ~[exist.jar:?]
at org.exist.storage.NativeBroker.removeCollection(NativeBroker.java:1502) ~[exist.jar:?]
at org.exist.repo.Deployment.uninstall(Deployment.java:579) [exist.jar:?]
at org.exist.repo.Deployment.undeploy(Deployment.java:326) [exist.jar:?]
at org.exist.xquery.modules.expathrepo.Deploy.eval(Deploy.java:171) [exist-modules.jar:?]
at org.exist.xquery.BasicFunction.eval(BasicFunction.java:73) [exist.jar:?]
at org.exist.xquery.InternalFunctionCall.eval(InternalFunctionCall.java:41) [exist.jar:?]
at org.exist.xquery.LetExpr.eval(LetExpr.java:99) [exist.jar:?]
at org.exist.xquery.ConditionalExpression.eval(ConditionalExpression.java:100) [exist.jar:?]
at org.exist.xquery.UserDefinedFunction.eval(UserDefinedFunction.java:155) [exist.jar:?]
at org.exist.xquery.DynamicCardinalityCheck.eval(DynamicCardinalityCheck.java:74) [exist.jar:?]
at org.exist.xquery.Atomize.eval(Atomize.java:67) [exist.jar:?]
at org.exist.xquery.DynamicTypeCheck.eval(DynamicTypeCheck.java:61) [exist.jar:?]
at org.exist.xquery.FunctionCall.evalFunction(FunctionCall.java:302) [exist.jar:?]
at org.exist.xquery.FunctionCall.eval(FunctionCall.java:223) [exist.jar:?]
at org.exist.xquery.LetExpr.eval(LetExpr.java:99) [exist.jar:?]
at org.exist.xquery.LetExpr.eval(LetExpr.java:111) [exist.jar:?]
at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:71) [exist.jar:?]
at org.exist.xquery.PathExpr.eval(PathExpr.java:276) [exist.jar:?]
at org.exist.xquery.TryCatchExpression.eval(TryCatchExpression.java:142) [exist.jar:?]
at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:71) [exist.jar:?]
at org.exist.xquery.PathExpr.eval(PathExpr.java:276) [exist.jar:?]
at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:71) [exist.jar:?]
at org.exist.xquery.SwitchExpression.eval(SwitchExpression.java:104) [exist.jar:?]
at org.exist.xquery.DebuggableExpression.eval(DebuggableExpression.java:58) [exist.jar:?]
at org.exist.xquery.ConditionalExpression.eval(ConditionalExpression.java:102) [exist.jar:?]
at org.exist.xquery.UserDefinedFunction.eval(UserDefinedFunction.java:155) [exist.jar:?]
at org.exist.xquery.FunctionCall.evalFunction(FunctionCall.java:302) [exist.jar:?]
at org.exist.xquery.FunctionCall.eval(FunctionCall.java:223) [exist.jar:?]
at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:71) [exist.jar:?]
at org.exist.xquery.value.FunctionReference.eval(FunctionReference.java:82) [exist.jar:?]
at org.exist.xquery.DynamicFunctionCall.eval(DynamicFunctionCall.java:76) [exist.jar:?]
at org.exist.xquery.ConditionalExpression.eval(ConditionalExpression.java:100) [exist.jar:?]
at org.exist.xquery.UserDefinedFunction.eval(UserDefinedFunction.java:155) [exist.jar:?]
at org.exist.xquery.FunctionCall.evalFunction(FunctionCall.java:302) [exist.jar:?]
at org.exist.xquery.FunctionCall.eval(FunctionCall.java:223) [exist.jar:?]
at org.exist.xquery.DebuggableExpression.eval(DebuggableExpression.java:58) [exist.jar:?]
at org.exist.xquery.LetExpr.eval(LetExpr.java:111) [exist.jar:?]
at org.exist.xquery.LetExpr.eval(LetExpr.java:111) [exist.jar:?]
at org.exist.xquery.LetExpr.eval(LetExpr.java:111) [exist.jar:?]
at org.exist.xquery.LetExpr.eval(LetExpr.java:111) [exist.jar:?]
at org.exist.xquery.LetExpr.eval(LetExpr.java:111) [exist.jar:?]
at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:71) [exist.jar:?]
at org.exist.xquery.PathExpr.eval(PathExpr.java:276) [exist.jar:?]
at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:71) [exist.jar:?]
at org.exist.xquery.XQuery.execute(XQuery.java:253) [exist.jar:?]
at org.exist.xquery.XQuery.execute(XQuery.java:185) [exist.jar:?]
at org.exist.http.RESTServer.executeXQuery(RESTServer.java:1506) [exist-optional.jar:?]
at org.exist.http.RESTServer.doPost(RESTServer.java:671) [exist-optional.jar:?]
at org.exist.http.servlets.EXistServlet.doPost(EXistServlet.java:433) [exist-optional.jar:?]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) [servlet-api-3.1.jar:3.1.0]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [servlet-api-3.1.jar:3.1.0]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845) [jetty-servlet-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583) [jetty-servlet-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:566) [jetty-security-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1174) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511) [jetty-servlet-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1106) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:159) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:74) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.exist.http.urlrewrite.Forward.doRewrite(Forward.java:50) [exist-optional.jar:?]
at org.exist.http.urlrewrite.XQueryURLRewrite.doRewrite(XQueryURLRewrite.java:545) [exist-optional.jar:?]
at org.exist.http.urlrewrite.XQueryURLRewrite.service(XQueryURLRewrite.java:349) [exist-optional.jar:?]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [servlet-api-3.1.jar:3.1.0]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845) [jetty-servlet-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1689) [jetty-servlet-9.3.9.v20160517.jar:9.3.9.v20160517]
at de.betterform.agent.web.filter.XFormsFilter.doFilter(XFormsFilter.java:171) [betterform-exist-5.1-SNAPSHOT-20160615.jar:?]
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1668) [jetty-servlet-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581) [jetty-servlet-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524) [jetty-security-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1174) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511) [jetty-servlet-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1106) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:396) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.server.Server.handle(Server.java:524) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253) [jetty-server-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273) [jetty-io-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95) [jetty-io-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [jetty-io-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) [jetty-util-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) [jetty-util-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) [jetty-util-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) [jetty-util-9.3.9.v20160517.jar:9.3.9.v20160517]
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) [jetty-util-9.3.9.v20160517.jar:9.3.9.v20160517]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_77]




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open