[ https://issues.apache.org/jira/browse/JCRVLT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17825367#comment-17825367 ]
Julian Reschke edited comment on JCRVLT-747 at 6/20/24 1:26 PM: ---------------------------------------------------------------- Ok, I *believe* I have a test (ugly). See https://github.com/apache/jackrabbit-filevault/pull/333 To run: {noformat} mvn clean install -Dit.test=BinaryPropertiesIT {noformat} Result: {noformat} 16:53:18.286 [main] ERROR o.a.j.v.p.impl.ZipVaultPackage - Error during install. javax.jcr.RepositoryException: org.apache.jackrabbit.vault.fs.io.DocViewParser$XmlParseException: specified data is not base64 encoded at org.apache.jackrabbit.vault.fs.impl.io.AbstractArtifactHandler.importDocView(AbstractArtifactHandler.java:187) at org.apache.jackrabbit.vault.fs.impl.io.GenericArtifactHandler.accept(GenericArtifactHandler.java:88) at org.apache.jackrabbit.vault.fs.io.Importer.commit(Importer.java:1115) at org.apache.jackrabbit.vault.fs.io.Importer.commit(Importer.java:976) at org.apache.jackrabbit.vault.fs.io.Importer.commit(Importer.java:1018) at org.apache.jackrabbit.vault.fs.io.Importer.run(Importer.java:531) at org.apache.jackrabbit.vault.packaging.impl.ZipVaultPackage.extract(ZipVaultPackage.java:284) at org.apache.jackrabbit.vault.packaging.impl.ZipVaultPackage.extract(ZipVaultPackage.java:168) at org.apache.jackrabbit.vault.packaging.impl.ZipVaultPackage.extract(ZipVaultPackage.java:175) at org.apache.jackrabbit.vault.packaging.integration.BinaryPropertiesIT.exportBinary(BinaryPropertiesIT.java:246) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) 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.rules.ExternalResource$1.evaluate(ExternalResource.java:54) 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.runners.ParentRunner.run(ParentRunner.java:413) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) 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.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:316) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:240) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:214) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:155) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) Caused by: org.apache.jackrabbit.vault.fs.io.DocViewParser$XmlParseException: specified data is not base64 encoded at org.apache.jackrabbit.vault.fs.io.DocViewParser.parse(DocViewParser.java:256) at org.apache.jackrabbit.vault.fs.impl.io.AbstractArtifactHandler.importDocView(AbstractArtifactHandler.java:177) ... 52 common frames omitted Caused by: java.lang.IllegalArgumentException: specified data is not base64 encoded at org.apache.jackrabbit.util.Base64.decode(Base64.java:376) at org.apache.jackrabbit.oak.jcr.xml.BufferedStringValue$Base64ReaderInputStream.fillBuffer(BufferedStringValue.java:329) at org.apache.jackrabbit.oak.jcr.xml.BufferedStringValue$Base64ReaderInputStream.read(BufferedStringValue.java:339) at java.base/java.io.InputStream.read(InputStream.java:271) at org.apache.jackrabbit.guava.common.io.ByteStreams.read(ByteStreams.java:942) at org.apache.jackrabbit.oak.segment.DefaultSegmentWriter$SegmentWriteOperation.internalWriteStream(DefaultSegmentWriter.java:653) at org.apache.jackrabbit.oak.segment.DefaultSegmentWriter$SegmentWriteOperation.writeStream(DefaultSegmentWriter.java:629) at org.apache.jackrabbit.oak.segment.DefaultSegmentWriter.writeStream(DefaultSegmentWriter.java:193) at org.apache.jackrabbit.oak.segment.SegmentNodeStore.createBlob(SegmentNodeStore.java:247) at org.apache.jackrabbit.oak.core.MutableRoot.createBlob(MutableRoot.java:337) at org.apache.jackrabbit.oak.plugins.value.jcr.ValueFactoryImpl.createBinaryValue(ValueFactoryImpl.java:188) at org.apache.jackrabbit.oak.plugins.value.jcr.ValueFactoryImpl.createValue(ValueFactoryImpl.java:94) at org.apache.jackrabbit.oak.jcr.xml.BufferedStringValue.getValue(BufferedStringValue.java:270) at org.apache.jackrabbit.oak.spi.xml.PropInfo.getValues(PropInfo.java:168) at org.apache.jackrabbit.oak.spi.xml.PropInfo.asPropertyState(PropInfo.java:175) at org.apache.jackrabbit.oak.jcr.xml.ImporterImpl.createProperty(ImporterImpl.java:195) at org.apache.jackrabbit.oak.jcr.xml.ImporterImpl.importProperties(ImporterImpl.java:293) at org.apache.jackrabbit.oak.jcr.xml.ImporterImpl.startNode(ImporterImpl.java:468) at org.apache.jackrabbit.oak.jcr.xml.SysViewImportHandler.processNode(SysViewImportHandler.java:81) at org.apache.jackrabbit.oak.jcr.xml.SysViewImportHandler.endElement(SysViewImportHandler.java:221) at org.apache.jackrabbit.oak.jcr.xml.ImportHandler.endElement(ImportHandler.java:197) at org.apache.jackrabbit.vault.fs.impl.io.JcrSysViewTransformer.endNode(JcrSysViewTransformer.java:224) at org.apache.jackrabbit.vault.fs.impl.io.DocViewImporter.endDocViewNode(DocViewImporter.java:433) at org.apache.jackrabbit.vault.fs.impl.io.DocViewSAXHandler.endElement(DocViewSAXHandler.java:359) at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:610) at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:184) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:351) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2710) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534) at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888) at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824) at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1216) at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:635) at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:324) at org.apache.jackrabbit.vault.fs.io.DocViewParser.parse(DocViewParser.java:254) ... 53 common frames omitted {noformat} So it seems that the code path taken for authorizables breaks binary-less replication. Note that the modified test passes when the "root" of the export is the actual node *below* the authorizable. Exporting the actual authorizable (one node up) makes it fail (this is the reason why the change in the test class is particularly ugly). was (Author: reschke): Ok, I *believe* I have a test (ugly). See https://github.com/apache/jackrabbit-filevault/pull/333 To run: {noformat} mvn clean install -Dit.test=BinaryPropertiesIT -DtestAuthorizables=true {noformat} Result: {noformat} 16:53:18.286 [main] ERROR o.a.j.v.p.impl.ZipVaultPackage - Error during install. javax.jcr.RepositoryException: org.apache.jackrabbit.vault.fs.io.DocViewParser$XmlParseException: specified data is not base64 encoded at org.apache.jackrabbit.vault.fs.impl.io.AbstractArtifactHandler.importDocView(AbstractArtifactHandler.java:187) at org.apache.jackrabbit.vault.fs.impl.io.GenericArtifactHandler.accept(GenericArtifactHandler.java:88) at org.apache.jackrabbit.vault.fs.io.Importer.commit(Importer.java:1115) at org.apache.jackrabbit.vault.fs.io.Importer.commit(Importer.java:976) at org.apache.jackrabbit.vault.fs.io.Importer.commit(Importer.java:1018) at org.apache.jackrabbit.vault.fs.io.Importer.run(Importer.java:531) at org.apache.jackrabbit.vault.packaging.impl.ZipVaultPackage.extract(ZipVaultPackage.java:284) at org.apache.jackrabbit.vault.packaging.impl.ZipVaultPackage.extract(ZipVaultPackage.java:168) at org.apache.jackrabbit.vault.packaging.impl.ZipVaultPackage.extract(ZipVaultPackage.java:175) at org.apache.jackrabbit.vault.packaging.integration.BinaryPropertiesIT.exportBinary(BinaryPropertiesIT.java:246) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) 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.rules.ExternalResource$1.evaluate(ExternalResource.java:54) 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.runners.ParentRunner.run(ParentRunner.java:413) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) 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.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:316) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:240) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:214) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:155) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) Caused by: org.apache.jackrabbit.vault.fs.io.DocViewParser$XmlParseException: specified data is not base64 encoded at org.apache.jackrabbit.vault.fs.io.DocViewParser.parse(DocViewParser.java:256) at org.apache.jackrabbit.vault.fs.impl.io.AbstractArtifactHandler.importDocView(AbstractArtifactHandler.java:177) ... 52 common frames omitted Caused by: java.lang.IllegalArgumentException: specified data is not base64 encoded at org.apache.jackrabbit.util.Base64.decode(Base64.java:376) at org.apache.jackrabbit.oak.jcr.xml.BufferedStringValue$Base64ReaderInputStream.fillBuffer(BufferedStringValue.java:329) at org.apache.jackrabbit.oak.jcr.xml.BufferedStringValue$Base64ReaderInputStream.read(BufferedStringValue.java:339) at java.base/java.io.InputStream.read(InputStream.java:271) at org.apache.jackrabbit.guava.common.io.ByteStreams.read(ByteStreams.java:942) at org.apache.jackrabbit.oak.segment.DefaultSegmentWriter$SegmentWriteOperation.internalWriteStream(DefaultSegmentWriter.java:653) at org.apache.jackrabbit.oak.segment.DefaultSegmentWriter$SegmentWriteOperation.writeStream(DefaultSegmentWriter.java:629) at org.apache.jackrabbit.oak.segment.DefaultSegmentWriter.writeStream(DefaultSegmentWriter.java:193) at org.apache.jackrabbit.oak.segment.SegmentNodeStore.createBlob(SegmentNodeStore.java:247) at org.apache.jackrabbit.oak.core.MutableRoot.createBlob(MutableRoot.java:337) at org.apache.jackrabbit.oak.plugins.value.jcr.ValueFactoryImpl.createBinaryValue(ValueFactoryImpl.java:188) at org.apache.jackrabbit.oak.plugins.value.jcr.ValueFactoryImpl.createValue(ValueFactoryImpl.java:94) at org.apache.jackrabbit.oak.jcr.xml.BufferedStringValue.getValue(BufferedStringValue.java:270) at org.apache.jackrabbit.oak.spi.xml.PropInfo.getValues(PropInfo.java:168) at org.apache.jackrabbit.oak.spi.xml.PropInfo.asPropertyState(PropInfo.java:175) at org.apache.jackrabbit.oak.jcr.xml.ImporterImpl.createProperty(ImporterImpl.java:195) at org.apache.jackrabbit.oak.jcr.xml.ImporterImpl.importProperties(ImporterImpl.java:293) at org.apache.jackrabbit.oak.jcr.xml.ImporterImpl.startNode(ImporterImpl.java:468) at org.apache.jackrabbit.oak.jcr.xml.SysViewImportHandler.processNode(SysViewImportHandler.java:81) at org.apache.jackrabbit.oak.jcr.xml.SysViewImportHandler.endElement(SysViewImportHandler.java:221) at org.apache.jackrabbit.oak.jcr.xml.ImportHandler.endElement(ImportHandler.java:197) at org.apache.jackrabbit.vault.fs.impl.io.JcrSysViewTransformer.endNode(JcrSysViewTransformer.java:224) at org.apache.jackrabbit.vault.fs.impl.io.DocViewImporter.endDocViewNode(DocViewImporter.java:433) at org.apache.jackrabbit.vault.fs.impl.io.DocViewSAXHandler.endElement(DocViewSAXHandler.java:359) at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:610) at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:184) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:351) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2710) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534) at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888) at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824) at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1216) at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:635) at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:324) at org.apache.jackrabbit.vault.fs.io.DocViewParser.parse(DocViewParser.java:254) ... 53 common frames omitted {noformat} So it seems that the code path taken for authorizables breaks binary-less replication. Note that the modified test passes when the "root" of the export is the actual node *below* the authorizable. Exporting the actual authorizable (one node up) makes it fail (this is the reason why the change in the test class is particularly ugly). > Import of authorizable nodes appears not to process "{BinaryRef}" property > values > --------------------------------------------------------------------------------- > > Key: JCRVLT-747 > URL: https://issues.apache.org/jira/browse/JCRVLT-747 > Project: Jackrabbit FileVault > Issue Type: Bug > Components: vlt > Reporter: Julian Reschke > Assignee: Julian Reschke > Priority: Major > > It appears that import of authorizable nodes will not process binary > properties using the '\{BinaryRef}' format. Instead, their values are passed > to the JCR's XML import handler, which then complains about the value not > being base64-encoded. -- This message was sent by Atlassian Jira (v8.20.10#820010)