Highlighted

PackageException occurs if oak:index reside inside /apps/<project>/

Himanshu_Singhal

MVP

09-04-2019

Hi,

I'm following Ensure Oak Index blog to move index from /oak:index to  /apps/<project>/. in my project.

I've added the index and now when I'm trying to deploy to AEM, it throws following error:

org.apache.jackrabbit.vault.packaging.PackageException: java.lang.UnsupportedOperationException: This builder is read-only.

[ERROR]   at org.apache.jackrabbit.vault.packaging.impl.ZipVaultPackage.extract(ZipVaultPackage.java:238)

[ERROR]   at org.apache.jackrabbit.vault.packaging.impl.JcrPackageImpl.extract(JcrPackageImpl.java:398)

[ERROR]   at org.apache.jackrabbit.vault.packaging.impl.JcrPackageImpl.extract(JcrPackageImpl.java:357)

[ERROR]   at org.apache.jackrabbit.vault.packaging.impl.JcrPackageImpl.install(JcrPackageImpl.java:351)

[ERROR]   at com.day.crx.packaging.impl.J2EEPackageManager.consoleInstall(J2EEPackageManager.java:353)

[ERROR]   at com.day.crx.packaging.impl.J2EEPackageManager.doPost(J2EEPackageManager.java:191)

[ERROR]   at com.day.crx.packaging.impl.PackageManagerServlet.doPost(PackageManagerServlet.java:128)

[ERROR]   at javax.servlet.http.HttpServlet.service(HttpServlet.java:644)

[ERROR]   at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)

[ERROR]   at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:85)

[ERROR]   at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:79)

[ERROR]   at com.adobe.granite.license.impl.LicenseCheckFilter.doFilter(LicenseCheckFilter.java:308)

[ERROR]   at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)

[ERROR]   at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)

[ERROR]   at org.apache.felix.http.sslfilter.internal.SslFilter.doFilter(SslFilter.java:96)

[ERROR]   at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)

[ERROR]   at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)

[ERROR]   at org.apache.sling.security.impl.ReferrerFilter.doFilter(ReferrerFilter.java:295)

[ERROR]   at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)

[ERROR]   at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)

[ERROR]   at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:138)

[ERROR]   at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:135)

[ERROR]   at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(InvocationChain.java:74)

[ERROR]   at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:128)

[ERROR]   at org.apache.felix.http.base.internal.dispatch.DispatcherServlet.service(DispatcherServlet.java:49)

[ERROR]   at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)

[ERROR]   at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)

[ERROR]   at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)

[ERROR]   at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)

[ERROR]   at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)

[ERROR]   at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)

[ERROR]   at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)

[ERROR]   at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)

[ERROR]   at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)

[ERROR]   at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)

[ERROR]   at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)

[ERROR]   at org.eclipse.jetty.server.Server.handle(Server.java:499)

[ERROR]   at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)

[ERROR]   at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)

[ERROR]   at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)

[ERROR]   at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)

[ERROR]   at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)

[ERROR]   at java.lang.Thread.run(Thread.java:748)

[ERROR] Caused by: java.lang.UnsupportedOperationException: This builder is read-only.

[ERROR]   at org.apache.jackrabbit.oak.spi.state.ReadOnlyBuilder.unsupported(ReadOnlyBuilder.java:45)

[ERROR]   at org.apache.jackrabbit.oak.spi.state.ReadOnlyBuilder.setProperty(ReadOnlyBuilder.java:174)

[ERROR]   at org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditorContext.enableReindexMode(LuceneIndexEditorContext.java:167)

[ERROR]   at org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditor.enter(LuceneIndexEditor.java:118)

[ERROR]   at org.apache.jackrabbit.oak.plugins.index.IndexUpdate.enter(IndexUpdate.java:176)

[ERROR]   at org.apache.jackrabbit.oak.spi.commit.CompositeEditor.enter(CompositeEditor.java:66)

[ERROR]   at org.apache.jackrabbit.oak.spi.commit.VisibleEditor.enter(VisibleEditor.java:57)

[ERROR]   at org.apache.jackrabbit.oak.spi.commit.CompositeEditor.enter(CompositeEditor.java:66)

[ERROR]   at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeAdded(EditorDiff.java:122)

[ERROR]   at org.apache.jackrabbit.oak.segment.MapRecord.compare(MapRecord.java:500)

[ERROR]   at org.apache.jackrabbit.oak.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:608)

[ERROR]   at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:148)

[ERROR]   at org.apache.jackrabbit.oak.segment.MapRecord$2.childNodeChanged(MapRecord.java:401)

[ERROR]   at org.apache.jackrabbit.oak.segment.MapRecord.compare(MapRecord.java:490)

[ERROR]   at org.apache.jackrabbit.oak.segment.MapRecord.compare(MapRecord.java:391)

[ERROR]   at org.apache.jackrabbit.oak.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:608)

[ERROR]   at org.apache.jackrabbit.oak.spi.commit.EditorDiff.process(EditorDiff.java:52)

[ERROR]   at org.apache.jackrabbit.oak.spi.commit.EditorHook.processCommit(EditorHook.java:55)

[ERROR]   at org.apache.jackrabbit.oak.spi.commit.CompositeHook.processCommit(CompositeHook.java:61)

[ERROR]   at org.apache.jackrabbit.oak.spi.commit.CompositeHook.processCommit(CompositeHook.java:61)

[ERROR]   at org.apache.jackrabbit.oak.segment.SegmentNodeStore$Commit.prepare(SegmentNodeStore.java:604)

[ERROR]   at org.apache.jackrabbit.oak.segment.SegmentNodeStore$Commit.optimisticMerge(SegmentNodeStore.java:634)

[ERROR]   at org.apache.jackrabbit.oak.segment.SegmentNodeStore$Commit.execute(SegmentNodeStore.java:690)

[ERROR]   at org.apache.jackrabbit.oak.segment.SegmentNodeStore.merge(SegmentNodeStore.java:334)

[ERROR]   at org.apache.jackrabbit.oak.core.MutableRoot.commit(MutableRoot.java:249)

[ERROR]   at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.commit(SessionDelegate.java:347)

[ERROR]   at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.save(SessionDelegate.java:494)

[ERROR]   at org.apache.jackrabbit.oak.jcr.session.SessionImpl$8.performVoid(SessionImpl.java:419)

[ERROR]   at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.performVoid(SessionDelegate.java:274)

[ERROR]   at org.apache.jackrabbit.oak.jcr.session.SessionImpl.save(SessionImpl.java:416)

[ERROR]   at org.apache.jackrabbit.vault.fs.io.AutoSave.save(AutoSave.java:172)

[ERROR]   at org.apache.jackrabbit.vault.fs.io.Importer.run(Importer.java:426)

[ERROR]   at org.apache.jackrabbit.vault.packaging.impl.ZipVaultPackage.extract(ZipVaultPackage.java:233)

[ERROR]   ... 42 more


Anyone faced similar issue?

BR,
Himanshu Singhal

Replies

Highlighted

Gaurav-Behl

MVP

09-04-2019

I've used Ensure Index and I didn't face this issue

Validate the ACLs as mentioned

User name: acs-commons-ensure-oak-index-service

ACLs:

  • jcr:read on /apps
  • jcr:read, rep:write, rep:indexDefinitionManagement on */oak:index/*
Highlighted

Himanshu_Singhal

MVP

09-04-2019

Hi Gaurav,

What I've done is created index under project path and then added the configuration.

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
   jcr:primaryType="sling:OsgiConfig"
   ensure-definitions.path="/apps/project/oak:index"
   immediate="{Boolean}true"
   oak-indexes.path="/oak:index"/>

And, then, I'm trying to deploy to AEM. But, it throws error in my case. ACS commons package already exist in AEM.

Is there anything am I missing?

BR,

Himanshu