当我使用从 xml 文件importXML
导入rep:security
时,发生错误。我找不到解决方案。[我曾经exportSystemView
出口rep:security
]
InputStream input = new FileInputStream("d:\\bk.xml");
session.importXML("/", input, ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING);
input.close();
session.save();
工作区的配置:
<?xml version="1.0" encoding="UTF-8"?>
<Workspace name="security">
<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
<param name="path" value="${wsp.home}"/>
</FileSystem>
<PersistenceManager class="org.apache.jackrabbit.core.persistence.db.DerbyPersistenceManager">
<param name="url" value="jdbc:derby:${wsp.home}/db;create=true"/>
<param name="schemaObjectPrefix" value="${wsp.name}_"/>
<param name="shutdownOnClose" value="false"/>
</PersistenceManager>
<SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
<param name="path" value="${wsp.home}/index"/>
<param name="supportHighlighting" value="true"/>
</SearchIndex>
<Import>
<ProtectedNodeImporter class="org.apache.jackrabbit.core.xml.AccessControlImporter"/>
<ProtectedItemImporter class="org.apache.jackrabbit.core.security.user.UserImporter">
<param name="importBehavior" value="besteffort"/>
</ProtectedItemImporter>
</Import>
</Workspace>
抛出以下异常:
javax.jcr.nodetype.ConstraintViolationException: /rep:security/rep:authorizables
/rep:groups/U/Us/UserAdmin: mandatory property {internal}principalName does not
exist
at org.apache.jackrabbit.core.ItemImpl.validateTransientItems(ItemImpl.j
ava:464)
at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1097)
at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:920)....
我找不到解决方案,有人知道解决方案吗?提前致谢。