contentLib.delete gives Empty message in exception

Enonic version: 6.4.2
OS: Mac and Linux

Whenever I try deleting content using contentLib.delete as documented here:
http://repo.enonic.com/public/com/enonic/xp/docs/6.4.2/docs-6.4.2-libdoc.zip!/module-lib_xp_content.html#.delete

I get

18:27:59.289 ERROR c.e.x.p.i.e.ExceptionRendererImpl - Empty message in exception
com.enonic.xp.portal.PortalException: Empty message in exception
	at com.enonic.xp.portal.impl.exception.ExceptionMapper.map(ExceptionMapper.java:27) ~[portal-impl-6.4.2.jar:6.4.2]
	at com.enonic.xp.portal.impl.PortalServlet.handleError(PortalServlet.java:215) [portal-impl-6.4.2.jar:6.4.2]
	at com.enonic.xp.portal.impl.PortalServlet.doHandle(PortalServlet.java:209) [portal-impl-6.4.2.jar:6.4.2]
	at com.enonic.xp.portal.impl.PortalServlet.service(PortalServlet.java:76) [portal-impl-6.4.2.jar:6.4.2]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [web-jetty-6.4.2.jar:6.4.2]
	at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:85) [web-jetty-6.4.2.jar:6.4.2]
	at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:79) [web-jetty-6.4.2.jar:6.4.2]
	at com.enonic.xp.web.impl.auth.BasicAuthFilter.doHandle(BasicAuthFilter.java:31) [web-impl-6.4.2.jar:6.4.2]
	at com.enonic.xp.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:31) [web-api-6.4.2.jar:6.4.2]
	at com.enonic.xp.web.filter.BaseWebFilter.doFilter(BaseWebFilter.java:33) [web-api-6.4.2.jar:6.4.2]
	at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135) [web-jetty-6.4.2.jar:6.4.2]
	at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74) [web-jetty-6.4.2.jar:6.4.2]
	at com.enonic.xp.web.impl.context.ContextFilter.lambda$doHandle$0(ContextFilter.java:34) [web-impl-6.4.2.jar:6.4.2]
	at com.enonic.xp.context.ContextImpl.callWith(ContextImpl.java:101) ~[core-api-6.4.2.jar:6.4.2]
	at com.enonic.xp.web.impl.context.ContextFilter.doHandle(ContextFilter.java:33) [web-impl-6.4.2.jar:6.4.2]
	at com.enonic.xp.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:31) [web-api-6.4.2.jar:6.4.2]
	at com.enonic.xp.web.filter.BaseWebFilter.doFilter(BaseWebFilter.java:33) [web-api-6.4.2.jar:6.4.2]
	at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135) [web-jetty-6.4.2.jar:6.4.2]
	at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74) [web-jetty-6.4.2.jar:6.4.2]
	at com.enonic.xp.web.vhost.impl.VirtualHostFilter.doHandle(VirtualHostFilter.java:32) ~[na:na]
	at com.enonic.xp.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:31) [web-api-6.4.2.jar:6.4.2]
	at com.enonic.xp.web.filter.BaseWebFilter.doFilter(BaseWebFilter.java:33) [web-api-6.4.2.jar:6.4.2]
	at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135) [web-jetty-6.4.2.jar:6.4.2]
	at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74) [web-jetty-6.4.2.jar:6.4.2]
	at com.enonic.xp.web.impl.dos.DosFilterWrapper.doFilter(DosFilterWrapper.java:60) ~[na:na]
	at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135) [web-jetty-6.4.2.jar:6.4.2]
	at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74) [web-jetty-6.4.2.jar:6.4.2]
	at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:124) ~[na:na]
	at org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:61) ~[na:na]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [web-jetty-6.4.2.jar:6.4.2]
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:821) ~[na:na]
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583) ~[na:na]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) ~[na:na]
	at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:437) ~[na:na]
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) ~[na:na]
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1158) ~[na:na]
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511) ~[na:na]
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) ~[na:na]
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1090) ~[na:na]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[na:na]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119) ~[na:na]
	at org.eclipse.jetty.server.Server.handle(Server.java:517) ~[na:na]
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:306) ~[na:na]
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242) ~[na:na]
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261) ~[na:na]
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95) ~[na:na]
	at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75) ~[na:na]
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213) ~[na:na]
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147) ~[na:na]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654) ~[na:na]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572) ~[na:na]
	at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_77]
Caused by: com.enonic.xp.resource.ResourceProblemException: Empty message in exception
	at com.enonic.xp.resource.ResourceProblemException$Builder.build(ResourceProblemException.java:131) ~[core-api-6.4.2.jar:6.4.2]
	at com.enonic.xp.script.impl.util.ErrorHelper.doHandleException(ErrorHelper.java:54) ~[na:na]
	at com.enonic.xp.script.impl.util.ErrorHelper.handleError(ErrorHelper.java:27) ~[na:na]
	at com.enonic.xp.script.impl.executor.ScriptExecutorImpl.invokeMethod(ScriptExecutorImpl.java:170) ~[na:na]
	at com.enonic.xp.script.impl.value.FunctionScriptValue.call(FunctionScriptValue.java:29) ~[na:na]
	at com.enonic.xp.script.impl.ScriptExportsImpl.executeMethod(ScriptExportsImpl.java:56) ~[na:na]
	at com.enonic.xp.portal.impl.controller.ControllerScriptImpl.doExecute(ControllerScriptImpl.java:53) ~[portal-impl-6.4.2.jar:6.4.2]
	at com.enonic.xp.portal.impl.controller.ControllerScriptImpl.execute(ControllerScriptImpl.java:32) ~[portal-impl-6.4.2.jar:6.4.2]
	at com.enonic.xp.portal.impl.handler.service.ServiceHandlerWorker.execute(ServiceHandlerWorker.java:68) ~[portal-impl-6.4.2.jar:6.4.2]
	at com.enonic.xp.portal.handler.BaseHandler.handle(BaseHandler.java:68) ~[portal-api-6.4.2.jar:6.4.2]
	at com.enonic.xp.portal.impl.PortalServlet.doHandle(PortalServlet.java:205) [portal-impl-6.4.2.jar:6.4.2]
	... 49 common frames omitted
Caused by: java.lang.NullPointerException: null
	at com.enonic.xp.core.impl.content.DeleteContentCommand.getCompareStatus(DeleteContentCommand.java:104) ~[na:na]
	at com.enonic.xp.core.impl.content.DeleteContentCommand.recursiveDelete(DeleteContentCommand.java:67) ~[na:na]
	at com.enonic.xp.core.impl.content.DeleteContentCommand.doExecute(DeleteContentCommand.java:60) ~[na:na]
	at com.enonic.xp.core.impl.content.DeleteContentCommand.execute(DeleteContentCommand.java:44) ~[na:na]
	at com.enonic.xp.core.impl.content.ContentServiceImpl.delete(ContentServiceImpl.java:271) ~[na:na]
	at com.enonic.xp.lib.content.DeleteContentHandler.doDelete(DeleteContentHandler.java:52) ~[na:na]
	at com.enonic.xp.lib.content.DeleteContentHandler.deleteByPath(DeleteContentHandler.java:45) ~[na:na]
	at com.enonic.xp.lib.content.DeleteContentHandler.doExecute(DeleteContentHandler.java:19) ~[na:na]
	at com.enonic.xp.context.ContextImpl.callWith(ContextImpl.java:101) ~[core-api-6.4.2.jar:6.4.2]
	at com.enonic.xp.lib.content.BaseContextHandler.execute(BaseContextHandler.java:50) ~[na:na]
	at jdk.nashorn.internal.scripts.Script$Recompilation$3625$3074A$content.L:1$delete(no.posten.website:/site/lib/xp/content.js:93) ~[na:na]
	at jdk.nashorn.internal.scripts.Script$Recompilation$3624$4374AA$sndb.L:1$_deleteUnitFromBranch(no.posten.website:/services/sndb/sndb.js:173) ~[na:na]
	at jdk.nashorn.internal.scripts.Script$Recompilation$3623$11710AJA$sndb.L:1$_updateUnits$L:387(no.posten.website:/services/sndb/sndb.js:389) ~[na:na]
	at jdk.nashorn.internal.objects.NativeArray$9.forEach(NativeArray.java:1606) ~[nashorn.jar:na]
	at jdk.nashorn.internal.runtime.arrays.IteratorAction.apply(IteratorAction.java:110) ~[nashorn.jar:na]
	at jdk.nashorn.internal.objects.NativeArray.forEach(NativeArray.java:1609) ~[nashorn.jar:na]
	at jdk.nashorn.internal.scripts.Script$Recompilation$3605$10852A$sndb.L:1$_updateUnits(no.posten.website:/services/sndb/sndb.js:387) ~[na:na]
	at jdk.nashorn.internal.scripts.Script$Recompilation$3604$12020A$sndb.L:1$get-1(no.posten.website:/services/sndb/sndb.js:426) ~[na:na]
	at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:625) ~[nashorn.jar:na]
	at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494) ~[nashorn.jar:na]
	at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393) ~[nashorn.jar:na]
	at jdk.nashorn.api.scripting.ScriptObjectMirror.call(ScriptObjectMirror.java:117) ~[nashorn.jar:na]
	at com.enonic.xp.script.impl.function.CallFunction.call(CallFunction.java:24) ~[na:na]
	at jdk.nashorn.api.scripting.ScriptObjectMirror.callMember(ScriptObjectMirror.java:201) ~[nashorn.jar:na]
	at jdk.nashorn.api.scripting.NashornScriptEngine.invokeImpl(NashornScriptEngine.java:383) ~[nashorn.jar:na]
	at jdk.nashorn.api.scripting.NashornScriptEngine.invokeMethod(NashornScriptEngine.java:199) ~[nashorn.jar:na]
	at com.enonic.xp.script.impl.executor.ScriptExecutorImpl.invokeMethod(ScriptExecutorImpl.java:166) ~[na:na]
	... 56 common frames omitted

This happens when I try to delete from branch: ‘draft’

Step1: create on ‘draft’
Step2: publish creation from ‘draft’ to ‘master’
Step3: modify on ‘draft’
Step4: publish modification from ‘draft’ to ‘master’
Step5: delete on ‘draft’
Step6: publish deleteion from ‘draft’ to ‘master’

fails at step 5.

delete on ‘master’ works, but must also be published?

This works, but feels soo wrong:

delete on 'master
publish from ‘master’ to ‘draft’

That does seem a little funny. The developers must have had a reason for it. Regardless, this should be documented somewhere. Thanks for bringing it to our attention.

Hi!

Seems like this messge have fallen by the wayside. :frowning: We have now tested this on 6.6.0, and can not reproduce it. There were some changes to this functionality in 6.5, but none in 6.6, so we have reason to believe it was fixed for the 6.5.0 release. Have you upgraded to 6.5, so you can test this?

Since I found the workaround.
I have of course never done it the failing the intuitive way anymore.
So then of course I don’t get the error either…

1 Like