Quantcast

Versioning module woes in 3.0/3.1

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

Versioning module woes in 3.0/3.1

Ari Nordström
Hi,

I've been trying to make the versioning module work in 3.0 and 3.1, but what worked in 2.2 doesn't, now.

I've installed the XAR and set up the module following Adam's instructions on Github (https://github.com/eXist-db/xquery-versioning-module) and have a clean eXist install, with only the versioning module and FunctX installed. Well, plus the XQ documentation. The relevant collection structure looks like this:

/db/test
/db/test/docs (versioned)
/db/test/xq (containing a simple XQ for testing what happens in /db/test/docs)

/db/test/docs is versioned by adding this collection.xconf to /db/system/config/db/test/docs:

    <index>
        <fulltext default="none" attributes="no">
        </fulltext>
    </index>
    <triggers>
        <trigger event="create,delete,update,copy,move" class="org.exist.versioning.VersioningTrigger">
            <parameter name="overwrite" value="yes"/>
        </trigger>
    </triggers>
</collection>

The XQ (which worked just fine in 2.2, sans the "at" part of the import) looks like this:

xquery version "3.0";

import module namespace v="http://exist-db.org/versioning"
at "/db/system/repo/xquery-versioning-module-1.1/content/versioning.xqm";


let $doc := doc('/db/test/docs/test.xml')

let $versions := v:history($doc)
let $revisions := v:revisions($doc)
let $v := v:versions($doc)

(:let $old := v:doc($doc,34):)
(:let $delete := xmldb:remove('/db/test/docs','test.xml'):)

return <message>
        <p>{$versions}</p>
    </message>


Basically, I've uploaded a file test.xml to /db/test/docs, edited it, and saved it in eXide and in oXygen. After each save, I've run the XQ to see if something happens but nothing does. All I get is this:

<message>
<p>
<v:history xmlns:v="http://exist-db.org/versioning">
<v:document>/db/test/docs/test.xml</v:document>
<v:revisions/>
</v:history>
</p>
</message>

The versioning module does create a test.xml.base version in /db/system/versions/db/test/docs. That's about it, though.

So I looked in exist.log and found this:

2017-03-08 21:50:01,191 [Thread-4] ERROR (Configuration.java [lookupModuleClass]:448) - Configuration problem: class not found for module 'http://exist-db.org/xquery/versioning' (ClassNotFoundException); class:'org.exist.versioning.xquery.VersioningModule'; message:'org.exist.versioning.xquery.VersioningModule' 

Checking Github again, I realised lib/user did not contain xquery-versioning-module-1.1.jar, but there was one next to the XQM in /db/system/repo/xquery-versioning-module-1.1/content. I copied it to lib/user (should the XAR have done this?) and restarted eXist.

This now appears in the log when I save my test XML:

2017-03-08 21:56:03,373 [qtp1932064624-56] INFO  (NativeBroker.java [removeXMLResource]:2709) - Removing document test.xml (1115) ... 
2017-03-08 21:56:03,392 [qtp1932064624-56] ERROR (VersioningTrigger.java [after]:410) - Caught exception in VersioningTrigger: sun.nio.fs.UnixPath cannot be cast to java.lang.String 
java.lang.ClassCastException: sun.nio.fs.UnixPath cannot be cast to java.lang.String
at org.exist.versioning.VersioningTrigger.newRevision(VersioningTrigger.java:463) ~[xquery-versioning-module-1.1.jar:?]
at org.exist.versioning.VersioningTrigger.after(VersioningTrigger.java:341) ~[xquery-versioning-module-1.1.jar:?]
at org.exist.versioning.VersioningTrigger.afterUpdateDocument(VersioningTrigger.java:577) ~[xquery-versioning-module-1.1.jar:?]
at org.exist.collections.triggers.DocumentTriggers.afterUpdateDocument(DocumentTriggers.java:254) ~[exist.jar:3.1.0]
at org.exist.collections.MutableCollection.storeXMLInternal(MutableCollection.java:1264) ~[exist.jar:3.1.0]
at org.exist.collections.MutableCollection.store(MutableCollection.java:1120) ~[exist.jar:3.1.0]
at org.exist.xmlrpc.RpcConnection.lambda$parse$39(RpcConnection.java:1316) ~[exist.jar:3.1.0]
at org.exist.xmlrpc.function.XmlRpcCollectionFunction.apply(XmlRpcCollectionFunction.java:47) ~[exist.jar:3.1.0]
at org.exist.xmlrpc.RpcConnection.lambda$withCollection$116(RpcConnection.java:3593) ~[exist.jar:3.1.0]
at org.exist.xmlrpc.RpcConnection.lambda$null$114(RpcConnection.java:3553) ~[exist.jar:3.1.0]
at org.exist.xmlrpc.function.XmlRpcFunction.apply(XmlRpcFunction.java:45) ~[exist.jar:3.1.0]
at org.exist.xmlrpc.RpcConnection.withDb(RpcConnection.java:3762) ~[exist.jar:3.1.0]
at org.exist.xmlrpc.RpcConnection.withDb(RpcConnection.java:3746) ~[exist.jar:3.1.0]
at org.exist.xmlrpc.RpcConnection.lambda$writeCollection$115(RpcConnection.java:3553) ~[exist.jar:3.1.0]
at org.exist.xmlrpc.RpcConnection.parse(RpcConnection.java:1290) [exist.jar:3.1.0]
at org.exist.xmlrpc.RpcConnection.parse(RpcConnection.java:1284) [exist.jar:3.1.0]
at org.exist.xmlrpc.RpcConnection.parse(RpcConnection.java:1278) [exist.jar:3.1.0]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_121]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_121]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_121]
at org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.invoke(ReflectiveXmlRpcHandler.java:115) [xmlrpc-server-3.1.3.jar:3.1.3]
at org.apache.xmlrpc.server.ReflectiveXmlRpcHandler.execute(ReflectiveXmlRpcHandler.java:106) [xmlrpc-server-3.1.3.jar:3.1.3]
at org.apache.xmlrpc.server.XmlRpcServerWorker.execute(XmlRpcServerWorker.java:46) [xmlrpc-server-3.1.3.jar:3.1.3]
at org.apache.xmlrpc.server.XmlRpcServer.execute(XmlRpcServer.java:86) [xmlrpc-server-3.1.3.jar:3.1.3]
at org.apache.xmlrpc.server.XmlRpcStreamServer.execute(XmlRpcStreamServer.java:200) [xmlrpc-server-3.1.3.jar:3.1.3]
at org.apache.xmlrpc.webserver.XmlRpcServletServer.execute(XmlRpcServletServer.java:112) [xmlrpc-server-3.1.3.jar:3.1.3]
at org.apache.xmlrpc.webserver.XmlRpcServlet.doPost(XmlRpcServlet.java:196) [xmlrpc-server-3.1.3.jar:3.1.3]
at org.exist.xmlrpc.RpcServlet.doPost(RpcServlet.java:67) [exist.jar:3.1.0]
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:3.1.0]
at org.exist.http.urlrewrite.XQueryURLRewrite.service(XQueryURLRewrite.java:219) [exist-optional.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:837) [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: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(Thread.java:745) [?:1.8.0_121]

Is this a bug or am I missing something else than the missing JAR? I'm running Ubuntu Linux 16.10 with the Cinnamon desktop, OpenJDK 8.

Any input, comments, etc welcome.

Thanks,

/Ari

------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Loading...