Expand my Community achievements bar.

SOLVED

1. javax.jcr.InvalidItemStateException: OakState0001: Unresolved conflicts in /content/dam/demotraining/asset.jpg - Error while creating a Page Programatically

Avatar

Level 2

Hello, I'm pasting the error log please let me know what's wrong here. 

javax.jcr.InvalidItemStateException: OakState0001: Unresolved conflicts in /content/dam/demotraining/asset.jpg
at org.apache.jackrabbit.oak.api.CommitFailedException.asRepositoryException(CommitFailedException.java:238) [org.apache.jackrabbit.oak-api:1.10.2]
at org.apache.jackrabbit.oak.api.CommitFailedException.asRepositoryException(CommitFailedException.java:213) [org.apache.jackrabbit.oak-api:1.10.2]
at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.newRepositoryException(SessionDelegate.java:669) [org.apache.jackrabbit.oak-jcr:1.10.2]
at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.save(SessionDelegate.java:495) [org.apache.jackrabbit.oak-jcr:1.10.2]
at org.apache.jackrabbit.oak.jcr.session.SessionImpl$8.performVoid(SessionImpl.java:420) [org.apache.jackrabbit.oak-jcr:1.10.2]
at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.performVoid(SessionDelegate.java:273) [org.apache.jackrabbit.oak-jcr:1.10.2]
at org.apache.jackrabbit.oak.jcr.session.SessionImpl.save(SessionImpl.java:417) [org.apache.jackrabbit.oak-jcr:1.10.2]
at com.day.cq.dam.core.impl.RenditionMakerImpl.generateRenditions(RenditionMakerImpl.java:232) [com.day.cq.dam.cq-dam-core:5.12.164]
at com.day.cq.dam.core.process.CreateThumbnailProcess.createThumbnails(CreateThumbnailProcess.java:119) [com.day.cq.dam.cq-dam-core:5.12.164]
at com.day.cq.dam.core.impl.process.ThumbnailProcess.execute(ThumbnailProcess.java:128) [com.day.cq.dam.cq-dam-core:5.12.164]
at com.day.cq.workflow.compatibility.CQWorkflowProcessRunner.execute(CQWorkflowProcessRunner.java:93) [com.day.cq.workflow.cq-workflow-impl:6.3.8]
at com.adobe.granite.workflow.core.job.HandlerBase.executeProcess(HandlerBase.java:191) [com.adobe.granite.workflow.core:2.0.240]
at com.adobe.granite.workflow.core.job.JobHandler.process(JobHandler.java:260) [com.adobe.granite.workflow.core:2.0.240]
at org.apache.sling.event.impl.jobs.JobConsumerManager$JobConsumerWrapper.process(JobConsumerManager.java:502) [org.apache.sling.event:4.2.12]
at org.apache.sling.event.impl.jobs.queues.JobQueueImpl.startJob(JobQueueImpl.java:293) [org.apache.sling.event:4.2.12]
at org.apache.sling.event.impl.jobs.queues.JobQueueImpl.access$100(JobQueueImpl.java:60) [org.apache.sling.event:4.2.12]
at org.apache.sling.event.impl.jobs.queues.JobQueueImpl$1.run(JobQueueImpl.java:229) [org.apache.sling.event:4.2.12]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.apache.jackrabbit.oak.api.CommitFailedException: OakState0001: Unresolved conflicts in /content/dam/demotraining/asset.jpg
at org.apache.jackrabbit.oak.plugins.commit.ConflictValidator.failOnMergeConflict(ConflictValidator.java:115) [org.apache.jackrabbit.oak-core:1.10.2]
at org.apache.jackrabbit.oak.plugins.commit.ConflictValidator.propertyChanged(ConflictValidator.java:90) [org.apache.jackrabbit.oak-core:1.10.2]
at org.apache.jackrabbit.oak.spi.commit.CompositeEditor.propertyChanged(CompositeEditor.java:90) [org.apache.jackrabbit.oak-store-spi:1.10.2]
at org.apache.jackrabbit.oak.spi.commit.EditorDiff.propertyChanged(EditorDiff.java:92) [org.apache.jackrabbit.oak-store-spi:1.10.2]
at org.apache.jackrabbit.oak.segment.SegmentNodeState.compareProperties(SegmentNodeState.java:664) [org.apache.jackrabbit.oak-segment-tar:1.10.2]
at org.apache.jackrabbit.oak.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:523) [org.apache.jackrabbit.oak-segment-tar:1.10.2]
at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:147) [org.apache.jackrabbit.oak-store-spi:1.10.2]
at org.apache.jackrabbit.oak.segment.MapRecord.compare(MapRecord.java:422) [org.apache.jackrabbit.oak-segment-tar:1.10.2]
at org.apache.jackrabbit.oak.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:651) [org.apache.jackrabbit.oak-segment-tar:1.10.2]
at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:147) [org.apache.jackrabbit.oak-store-spi:1.10.2]
at org.apache.jackrabbit.oak.segment.MapRecord.compare(MapRecord.java:422) [org.apache.jackrabbit.oak-segment-tar:1.10.2]
at org.apache.jackrabbit.oak.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:651) [org.apache.jackrabbit.oak-segment-tar:1.10.2]
at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:147) [org.apache.jackrabbit.oak-store-spi:1.10.2]
at org.apache.jackrabbit.oak.segment.MapRecord.compare(MapRecord.java:422) [org.apache.jackrabbit.oak-segment-tar:1.10.2]
at org.apache.jackrabbit.oak.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:651) [org.apache.jackrabbit.oak-segment-tar:1.10.2]
at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:147) [org.apache.jackrabbit.oak-store-spi:1.10.2]
at org.apache.jackrabbit.oak.segment.MapRecord.compare(MapRecord.java:422) [org.apache.jackrabbit.oak-segment-tar:1.10.2]
at org.apache.jackrabbit.oak.segment.SegmentNodeState.compareAgainstBaseState(SegmentNodeState.java:651) [org.apache.jackrabbit.oak-segment-tar:1.10.2]
at org.apache.jackrabbit.oak.spi.commit.EditorDiff.process(EditorDiff.java:51) [org.apache.jackrabbit.oak-store-spi:1.10.2]
at org.apache.jackrabbit.oak.spi.commit.EditorHook.processCommit(EditorHook.java:54) [org.apache.jackrabbit.oak-store-spi:1.10.2]
at org.apache.jackrabbit.oak.spi.commit.CompositeHook.processCommit(CompositeHook.java:60) [org.apache.jackrabbit.oak-store-spi:1.10.2]
at org.apache.jackrabbit.oak.spi.commit.CompositeHook.processCommit(CompositeHook.java:60) [org.apache.jackrabbit.oak-store-spi:1.10.2]
at org.apache.jackrabbit.oak.segment.scheduler.Commit.apply(Commit.java:105) [org.apache.jackrabbit.oak-segment-tar:1.10.2]
at org.apache.jackrabbit.oak.segment.scheduler.LockBasedScheduler.execute(LockBasedScheduler.java:308) [org.apache.jackrabbit.oak-segment-tar:1.10.2]
at org.apache.jackrabbit.oak.segment.scheduler.LockBasedScheduler.schedule(LockBasedScheduler.java:279) [org.apache.jackrabbit.oak-segment-tar:1.10.2]
at org.apache.jackrabbit.oak.segment.SegmentNodeStore.merge(SegmentNodeStore.java:211) [org.apache.jackrabbit.oak-segment-tar:1.10.2]
at org.apache.jackrabbit.oak.core.MutableRoot.commit(MutableRoot.java:250) [org.apache.jackrabbit.oak-core:1.10.2]
at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.commit(SessionDelegate.java:346) [org.apache.jackrabbit.oak-jcr:1.10.2]
at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.save(SessionDelegate.java:493) 

*ERROR* [Thread-47] com.day.cq.dam.core.impl.ui.preview.FolderPreviewUpdaterImpl error while executing folder thumbnail update job: /content/dam/demotraining/asset.jpg
java.lang.IllegalArgumentException: width or height <= 0
at com.day.image.Layer.init(Layer.java:3181) [day-commons-gfx:2.1.50]
at com.day.image.Layer.<init>(Layer.java:501) [day-commons-gfx:2.1.50]
at com.day.cq.dam.core.impl.ui.preview.FolderPreviewGenerator$FolderPreviewCreator.createPreview(FolderPreviewGenerator.java:292) [com.day.cq.dam.cq-dam-core:5.12.164]
at com.day.cq.dam.core.impl.ui.preview.AssetDrivenFolderPreviewGenerator.generate(AssetDrivenFolderPreviewGenerator.java:245) [com.day.cq.dam.cq-dam-core:5.12.164]
at com.day.cq.dam.core.impl.ui.preview.FolderPreviewUpdaterImpl.updateFolderThumbnail(FolderPreviewUpdaterImpl.java:144) [com.day.cq.dam.cq-dam-core:5.12.164]
at com.day.cq.dam.core.impl.ui.preview.FolderPreviewUpdaterImpl.run(FolderPreviewUpdaterImpl.java:201) [com.day.cq.dam.cq-dam-core:5.12.164]
at java.base/java.lang.Thread.run(Thread.java:834)

 

 

Caused by: org.apache.sling.scripting.sightly.SightlyException: Identifier com.aem.demo.core.models.HelloWorldModel cannot be correctly instantiated by the Use API
at org.apache.sling.scripting.sightly.impl.engine.extension.use.UseRuntimeExtension.call(UseRuntimeExtension.java:77) [org.apache.sling.scripting.sightly:1.1.2.1_4_0]
at org.apache.sling.scripting.sightly.impl.engine.runtime.RenderContextImpl.call(RenderContextImpl.java:77) [org.apache.sling.scripting.sightly:1.1.2.1_4_0]
at org.apache.sling.scripting.sightly.apps.demotraining.components.content.helloworld.helloworld_html.render(helloworld_html.java:52)
at org.apache.sling.scripting.sightly.render.RenderUnit.render(RenderUnit.java:50) [org.apache.sling.scripting.sightly.runtime:1.1.0.1_4_0]
at org.apache.sling.scripting.sightly.impl.engine.SightlyCompiledScript.eval(SightlyCompiledScript.java:60) [org.apache.sling.scripting.sightly:1.1.2.1_4_0]
at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:386) [org.apache.sling.scripting.core:2.0.56]
at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:184) [org.apache.sling.scripting.core:2.0.56]
at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:491) [org.apache.sling.scripting.core:2.0.56]
... 137 common frames omitted
Caused by: org.apache.sling.models.factory.MissingElementsException: Could not inject all required fields into class com.aem.demo.core.models.HelloWorldModel
at org.apache.sling.models.impl.ModelAdapterFactory.createObject(ModelAdapterFactory.java:765) [org.apache.sling.models.impl:1.4.10]
at org.apache.sling.models.impl.ModelAdapterFactory.internalCreateModel(ModelAdapterFactory.java:448) [org.apache.sling.models.impl:1.4.10]
at org.apache.sling.models.impl.ModelAdapterFactory.createModel(ModelAdapterFactory.java:314) [org.apache.sling.models.impl:1.4.10]
at org.apache.sling.scripting.sightly.models.impl.SlingModelsUseProvider.provide(SlingModelsUseProvider.java:135) [org.apache.sling.scripting.sightly.models.provider:1.0.8]
at org.apache.sling.scripting.sightly.impl.engine.extension.use.UseRuntimeExtension.call(UseRuntimeExtension.java:72) [org.apache.sling.scripting.sightly:1.1.2.1_4_0]
... 144 common frames omitted
Suppressed: org.apache.sling.models.factory.MissingElementException: Could not inject private java.lang.String com.aem.demo.core.models.HelloWorldModel.text
at org.apache.sling.models.impl.ModelAdapterFactory.createObject(ModelAdapterFactory.java:749) [org.apache.sling.models.impl:1.4.10]
... 148 common frames omitted
Caused by: org.apache.sling.models.factory.ModelClassException: No injector returned a non-null value!
at org.apache.sling.models.impl.ModelAdapterFactory.injectElement(ModelAdapterFactory.java:635) [org.apache.sling.models.impl:1.4.10]
at org.apache.sling.models.impl.ModelAdapterFactory.createObject(ModelAdapterFactory.java:744) [org.apache.sling.models.impl:1.4.10]

1 Accepted Solution

Avatar

Correct answer by
Level 2

It worked after I add @Deleted Account annotation to the fields that I was Injecting in the HelloWorldModel. Thanks all

View solution in original post

6 Replies

Avatar

Employee Advisor

Can you try to stop the bundle/service named "com.aem.demo.core.models.HelloWorldModel" and try again? It seems like that service is not correctly instantiated

Avatar

Community Advisor

Hi @ashwinikhaple,

 

Your log has 2 errors

  • *ERROR* [Thread-47] com.day.cq.dam.core.impl.ui.preview.FolderPreviewUpdaterImpl error while executing folder thumbnail update job: /content/dam/demotraining/asset.jpg
    java.lang.IllegalArgumentException: width or height <= 0
    • Check the asset.jpg file and its size
  • Caused by: org.apache.sling.models.factory.MissingElementsException: Could not inject all required fields into class com.aem.demo.core.models.HelloWorldModel
    • Check this model and its attributes missing

Hope this helps.

 

Thanks,

Kiran Vedantam

Avatar

Level 2
Hello @Kiran_Vedantam , I checked for the 1st error I don't think there is any problem with asset.jpg file because previously when I used it in the same project it was working fine. For the HelloWorldModel I can show the code if you want I'm not getting which attribute is missing here

Avatar

Community Advisor
Hi Can u debug the HelloWorldModel and check why the @PostConstruct method is returning null?

Avatar

Correct answer by
Level 2

It worked after I add @Deleted Account annotation to the fields that I was Injecting in the HelloWorldModel. Thanks all

Avatar

Administrator
@ashwinikhaple, thank you for sharing answer with the community.


Kautuk Sahni