jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Guggisberg <stefan.guggisb...@gmail.com>
Subject Re: [JackRabbit 1.6] Import throws Exception when sharable node is used.
Date Fri, 20 Nov 2009 10:31:20 GMT
hi jervis

On Fri, Nov 20, 2009 at 9:09 AM, Jervis Liu <jervisliu@gmail.com> wrote:
> Hi Stefan,
>
> As far as the shareable node feature is concerned, how different is it
> between 2.0 trunk and 1.6 branch?

i had a quick look at the code and it seems like importing shared nodes
is not supported in 2.0 trunk...

could you please post a jira issue (affects 1.6 and 2.0)?

> Willl the problem with importXML
> method be fixed in next minor release of JackRabbit 1.6 or it will be
> availeable only in 2.0?

i assume that the fix to this issue will be backported to 1.6 aswell.

cheers
stefan

> I've tried shareble node feature from 1.6 in
> my project, everything works so far except the importXML.
>
> Thanks,
> Jervis
>
> 2009/11/19 Stefan Guggisberg <stefan.guggisberg@gmail.com>:
>> hi jervis,
>>
>> as thomas pointed out, shareable nodes are a jcr 2.0 feature.
>> there was some preliminary jcr 2.0 support in jackrabbit 1.6
>> but it's not officially supported.
>>
>> your problem is caused by missing sharable nodes support
>> in the importXML method.
>>
>> for more information see 14.7 and 14.8 in the JCR 2.0 spec:
>> http://www.day.com/specs/jcr/2.0/14_Shareable_Nodes.html
>>
>> jcr 2.0 (and shareable nodes) will be fully supported in the
>> upcoming jackrabbit 2.0 release. there's a beta that you can
>> use until the final 2.0 release becomes available.
>>
>> cheers
>> stefan
>>
>> On Thu, Nov 19, 2009 at 7:12 AM, Jervis Liu <jervisliu@gmail.com> wrote:
>>> Hi,
>>>
>>> I am using the sharable node feature in JackRabbit 1.6. I did an
>>> export using Session.exportSystemView() then I import back using
>>> Session.getWorkspace().importXML(). Everything work fine until I
>>> created some sharable nodes. I got exception from importXML() like
>>> below:
>>>
>>> Caused by: javax.jcr.nodetype.NoSuchNodeTypeException:
>>> {http://www.jcp.org/jcr/nt/1.0}share
>>>    at org.apache.jackrabbit.core.nodetype.NodeTypeRegistry.getEffectiveNodeType(NodeTypeRegistry.java:1024)
>>>    at org.apache.jackrabbit.core.nodetype.NodeTypeRegistry.getEffectiveNodeType(NodeTypeRegistry.java:471)
>>>    at org.apache.jackrabbit.core.nodetype.EffectiveNodeType.getApplicableChildNodeDef(EffectiveNodeType.java:682)
>>>    at org.apache.jackrabbit.core.nodetype.EffectiveNodeType.checkAddNodeConstraints(EffectiveNodeType.java:655)
>>>    at org.apache.jackrabbit.core.BatchedItemOperations.checkAddNode(BatchedItemOperations.java:732)
>>>    at org.apache.jackrabbit.core.xml.WorkspaceImporter.resolveUUIDConflict(WorkspaceImporter.java:150)
>>>    at org.apache.jackrabbit.core.xml.WorkspaceImporter.startNode(WorkspaceImporter.java:487)
>>>    at org.apache.jackrabbit.core.xml.SysViewImportHandler.processNode(SysViewImportHandler.java:86)
>>>    at org.apache.jackrabbit.core.xml.SysViewImportHandler.endElement(SysViewImportHandler.java:231)
>>>    at org.apache.jackrabbit.core.xml.ImportHandler.endElement(ImportHandler.java:183)
>>>    at org.apache.jackrabbit.commons.xml.DefaultContentHandler.endElement(DefaultContentHandler.java:83)
>>>    at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
>>>    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
>>> Source)
>>>    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
>>> Source)
>>>    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
>>> Source)
>>>    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>>>    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>>>    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>>>    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>>>    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
>>>    at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
>>>    at org.apache.jackrabbit.commons.xml.ParsingContentHandler.parse(ParsingContentHandler.java:62)
>>>    at org.apache.jackrabbit.commons.AbstractWorkspace.importXML(AbstractWorkspace.java:54)
>>>    at org.drools.repository.RulesRepository.importRulesRepositoryFromStream(RulesRepository.java:979)
>>>    ... 20 more
>>>
>>> The code snippet I used to create sharable nodes looks like below roughly:
>>>
>>>        sharableNodeA().addMixin("mix:shareable");
>>>        .....
>>>
>>>        Session session = repo.getSession();
>>>        Workspace workspace = session.getWorkspace();
>>>        String path = "/pathA/pathB/sharableNodeB";
>>>        workspace.clone(workspace.getName(), sharableNodeA.getPath(),
>>> path, false);
>>>        ..............
>>>
>>> I wonder where the schema mix:shareable is defined? Obviously it is
>>> not defined by http://www.jcp.org/jcr/nt/1.0. Did I do anything wrong
>>> or it is a bug in JackRabbit 1.6?
>>>
>>> Thanks,
>>> Jervis Liu
>>>
>>
>

Mime
View raw message