[
https://issues.apache.org/jira/browse/JCR-2678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12889796#action_12889796
]
Sascha Theves commented on JCR-2678:
------------------------------------
I was now able to reproduce the problem in a unit test. Attached you will find
a zip archive containing the unit test and 2 configuration files which must be
put directly on to the classpath of the unit test to get it working. You will
also need a derby database running for the unit test. I used derby 10.4.2.0 for
my tests.
The test uses a source configuration based on a derby database, then copies the
repository content to filesystem using a filesystem configuration and then
reads the copy back again into a derby database. This is exactly how the
problem occurs in my app. Maybe I do misunderstand something or my
configuration is wrong? But the test doesn`t fail with jackrabbit 1.6.1.
My test doesn`t clears the database before copying the filesystem content to
the database again. Is that a mistake? Must the target directory for the
RepositoryCopier be empty before copying the repository?
Thanks for your help.
> RepositoryCopier has problems with multi-valued properties
> ----------------------------------------------------------
>
> Key: JCR-2678
> URL: https://issues.apache.org/jira/browse/JCR-2678
> Project: Jackrabbit Content Repository
> Issue Type: Bug
> Components: jackrabbit-core
> Affects Versions: 1.6.2
> Environment: Jackrabbit 1.6.2
> Reporter: Sascha Theves
> Fix For: 1.6.3
>
> Attachments: JCR-2678.zip, RepositoryCopierTest.java
>
>
> When using the RepositoryCopier to backup and restore your repository you run
> into problems with multi-valued properties where you have only one value
> assigned.
> The backup works fine but when you try to restore the backup and want to get
> the values of a multi-valued property you get:
> java.lang.RuntimeException: property /ns:someNode/ns:multiValued is a
> single-valued property, so it's value can not be retrieved as an array
> at
> org.apache.jackrabbit.core.PropertyImpl.internalGetValues(PropertyImpl.java:441)
> at
> org.apache.jackrabbit.core.PropertyImpl.getValues(PropertyImpl.java:475)
> at xxx.MyClass.getProperty(MyClass.java:274)
> You can reproduce that by using the RepositoryCopier to copy your repository
> and then read it back again. You must have a node with a multi-valued
> property in it where you have only _one_ value contained in the property to
> the time the backup is created.
> The node type definition looks like:
> // The namespace declaration
> <ns='http://noPlaceLikeHome/'>
> <nt='http://www.jcp.org/jcr/nt/1.0'>
> // Node type name
> [ns:myNodeType]
> - ns:multiValued (string)
> multiple
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.