exist.db 触发器准备期间出错

exist.db Error during trigger prepare

如果我尝试在我的 exist-db(版本 3.4.1)中的项目文件夹中修改甚至创建文件,则会出现以下错误。

留言:

XMLDBException: Failed to invoke method parse in class org.exist.xmlrpc.RpcConnection: 
org.exist.collections.triggers.TriggerException: Error during trigger prepare
org.exist.xquery.XPathException: err:XQST0048 It is a static error if a 
function or variable declared in a library module is not in the target namespace of the 
library module. [source: /db/apps/ediarum/routinen/trigger/set-permissions-for-document.xql]

异常堆栈跟踪:

org.xmldb.api.base.XMLDBException: Failed to invoke method parse in class 
org.exist.xmlrpc.RpcConnection: 
org.exist.collections.triggers.TriggerException: Error during trigger prepare
org.exist.xquery.XPathException: err:XQST0048 It is a static error if a function or variable declared in a library module is not in the target namespace of the library module. [source: /db/apps/ediarum/routinen/trigger/set-permissions-for-document.xql]
at org.exist.xmldb.RemoteCollection.store(RemoteCollection.java:528)
at org.exist.xmldb.RemoteCollection.storeResource(RemoteCollection.java:502)
at org.exist.xmldb.RemoteCollection.storeResource(RemoteCollection.java:471)
at org.exist.client.DocumentView.run(DocumentView.java:361)
Caused by: org.apache.xmlrpc.XmlRpcException: Failed to invoke method parse in class org.exist.xmlrpc.RpcConnection: 
org.exist.collections.triggers.TriggerException: Error during trigger prepare
org.exist.xquery.XPathException: err:XQST0048 It is a static error if a function or variable declared in a library module is not in the target namespace of the library module. [source: /db/apps/ediarum/routinen/trigger/set-permissions-for-document.xql]
at org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:197)
at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:156)
at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:143)
at org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:69)
at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:56)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:167)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:158)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:147)
at org.exist.xmldb.RemoteCollection.store(RemoteCollection.java:524)
... 3 more
Caused by: org.apache.xmlrpc.XmlRpcException: Failed to invoke method parse in class org.exist.xmlrpc.RpcConnection: 
org.exist.collections.triggers.TriggerException: Error during trigger prepare
org.exist.xquery.XPathException: err:XQST0048 It is a static error if a function or variable declared in a library module is not in the target namespace of the library module. [source: /db/apps/ediarum/routinen/trigger/set-permissions-for-document.xql]
at org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:197)
at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:156)
at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:143)
at org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:69)
at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:56)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:167)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:158)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:147)
at org.exist.xmldb.RemoteCollection.store(RemoteCollection.java:524)
at org.exist.xmldb.RemoteCollection.storeResource(RemoteCollection.java:502)
at org.exist.xmldb.RemoteCollection.storeResource(RemoteCollection.java:471)
at org.exist.client.DocumentView.run(DocumentView.java:361)

可能是锁定问题?在同一项目的另一个文件夹中,可以编辑所有资源。并且出现错误的文件最初是由我创建的......所以它之前已经起作用了。

全新安装后它运行了一段时间,然后突然又出现错误。

权限设置正确!

您的问题的解释在错误消息的这一部分:

err:XQST0048 It is a static error if a function or variable declared in a library module is not in the target namespace of the library module. [source: /db/apps/ediarum/routinen/trigger/set-permissions-for-document.xql]

您的集合中的触发器包含错误,因此当它触发并且您尝试存储文档时,触发器引起的错误会阻止文档被存储。

您需要编辑 /db/apps/ediarum/routinen/trigger/set-permissions-for-document.xql 并修复 XQuery 中的错误。