[ 
https://issues.apache.org/jira/browse/JCRVLT-646?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Konrad Windszus reassigned JCRVLT-646:
--------------------------------------

    Assignee: Konrad Windszus

> Potential javax.jcr.nodetype.ConstraintViolationException while deserializing 
> extended file aggregates
> ------------------------------------------------------------------------------------------------------
>
>                 Key: JCRVLT-646
>                 URL: https://issues.apache.org/jira/browse/JCRVLT-646
>             Project: Jackrabbit FileVault
>          Issue Type: Bug
>          Components: Packaging
>    Affects Versions: 3.5.4
>            Reporter: Konrad Windszus
>            Assignee: Konrad Windszus
>            Priority: Major
>             Fix For: 3.6.2
>
>
> In [extended file 
> aggregates|https://jackrabbit.apache.org/filevault/vaultfs.html#extended-file-aggregates]
>  the node with type nt:file is given by 
> # an enhanced DocView XML for parts some parts
> # a binary file for the rest
> The enhanced DocView XML is processed first. If afterwards an (intermediate) 
> save is triggered the following exception can be observed
> {code}
> javax.jcr.nodetype.ConstraintViolationException: OakConstraint0021: 
> /oak:index/damAssetLucene-7-custom-2/tika/config.xml/jcr:content[[nt:resource]]:
>  Mandatory property jcr:data not found in a new node
>       at 
> org.apache.jackrabbit.oak.api.CommitFailedException.asRepositoryException(CommitFailedException.java:226)
>       at 
> org.apache.jackrabbit.oak.api.CommitFailedException.asRepositoryException(CommitFailedException.java:213)
>       at 
> org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.newRepositoryException(SessionDelegate.java:704)
>       at 
> org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.save(SessionDelegate.java:525)
>       at 
> org.apache.jackrabbit.oak.jcr.session.SessionImpl$9.performVoid(SessionImpl.java:459)
>       at 
> org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.performVoid(SessionDelegate.java:275)
>       at 
> org.apache.jackrabbit.oak.jcr.session.SessionImpl.save(SessionImpl.java:456)
>       at 
> org.apache.jackrabbit.vault.fs.io.AutoSave.saveWithBackoff(AutoSave.java:198)
>       at org.apache.jackrabbit.vault.fs.io.AutoSave.save(AutoSave.java:171)
>       at org.apache.jackrabbit.vault.fs.io.Importer.commit(Importer.java:847)
>       at org.apache.jackrabbit.vault.fs.io.Importer.commit(Importer.java:871)
>       at org.apache.jackrabbit.vault.fs.io.Importer.commit(Importer.java:871)
>       at org.apache.jackrabbit.vault.fs.io.Importer.run(Importer.java:472)
>       at org.apache.jackrabbit.vault.fs.io.Importer.run(Importer.java:353)
>       at 
> org.apache.jackrabbit.vault.packaging.integration.ImportIT.testPackageWithNtFile(ImportIT.java:441)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:498)
>       at 
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
>       at 
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>       at 
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
>       at 
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
>       at 
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
>       at 
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
>       at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
>       at 
> org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
>       at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
>       at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
>       at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
>       at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
>       at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
>       at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
>       at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
>       at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
>       at 
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
>       at 
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
>       at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:54)
>       at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>       at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
>       at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
>       at 
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:93)
>       at 
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:529)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:756)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452)
>       at 
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)
> Caused by: org.apache.jackrabbit.oak.api.CommitFailedException: 
> OakConstraint0021: 
> /oak:index/damAssetLucene-7-custom-2/tika/config.xml/jcr:content[[nt:resource]]:
>  Mandatory property jcr:data not found in a new node
>       at 
> org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor$1.onConstraintViolation(TypeEditor.java:109)
>       at 
> org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor.constraintViolation(TypeEditor.java:234)
>       at 
> org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor.checkNodeTypeConstraints(TypeEditor.java:467)
>       at 
> org.apache.jackrabbit.oak.plugins.nodetype.TypeEditor.enter(TypeEditor.java:276)
>       at 
> org.apache.jackrabbit.oak.spi.commit.VisibleEditor.enter(VisibleEditor.java:53)
>       at 
> org.apache.jackrabbit.oak.spi.commit.CompositeEditor.enter(CompositeEditor.java:65)
>       at 
> org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeAdded(EditorDiff.java:121)
>       at 
> org.apache.jackrabbit.oak.plugins.memory.EmptyNodeState.compareAgainstEmptyState(EmptyNodeState.java:160)
>       at 
> org.apache.jackrabbit.oak.plugins.memory.MemoryNodeState.compareAgainstBaseState(MemoryNodeState.java:126)
>       at 
> org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeAdded(EditorDiff.java:124)
>       at 
> org.apache.jackrabbit.oak.plugins.memory.EmptyNodeState.compareAgainstEmptyState(EmptyNodeState.java:160)
>       at 
> org.apache.jackrabbit.oak.plugins.memory.MemoryNodeState.compareAgainstBaseState(MemoryNodeState.java:126)
>       at 
> org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeAdded(EditorDiff.java:124)
>       at 
> org.apache.jackrabbit.oak.plugins.memory.EmptyNodeState.compareAgainstEmptyState(EmptyNodeState.java:160)
>       at 
> org.apache.jackrabbit.oak.plugins.memory.MemoryNodeState.compareAgainstBaseState(MemoryNodeState.java:126)
>       at 
> org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeAdded(EditorDiff.java:124)
>       at 
> org.apache.jackrabbit.oak.plugins.memory.MemoryNodeState.compareAgainstBaseState(MemoryNodeState.java:168)
>       at 
> org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:147)
>       at 
> org.apache.jackrabbit.oak.plugins.memory.MemoryNodeState.compareAgainstBaseState(MemoryNodeState.java:161)
>       at 
> org.apache.jackrabbit.oak.spi.commit.EditorDiff.process(EditorDiff.java:51)
>       at 
> org.apache.jackrabbit.oak.spi.commit.EditorHook.processCommit(EditorHook.java:54)
>       at 
> org.apache.jackrabbit.oak.spi.commit.CompositeHook.processCommit(CompositeHook.java:60)
>       at 
> org.apache.jackrabbit.oak.spi.commit.CompositeHook.processCommit(CompositeHook.java:60)
>       at 
> org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore$MemoryNodeStoreBranch.merge(MemoryNodeStore.java:294)
>       at 
> org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore.merge(MemoryNodeStore.java:133)
>       at 
> org.apache.jackrabbit.oak.core.MutableRoot.commit(MutableRoot.java:252)
>       at 
> org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.commit(SessionDelegate.java:368)
>       at 
> org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.save(SessionDelegate.java:523)
>       ... 43 more
> {code}
> This is caused by the fact that the mandatory {{jcr:content/jcr:data}} 
> property is not part of the DocView serialization but only generated later 
> through the binary file.
> Therefore intermediate saves are known to potentially cause 
> {{ConstraintViolationException}}.
> These exceptions need to be ignored as with the next intermediate or final 
> {{Session.save()}} the repository structure is valid again.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to