On Fri, Aug 28, 2009 at 4:07 PM, Paul
Skinner<[email protected]> wrote:
>
> Hi,
>
> The version of JackRabbit is the released version of 1.6.0
> I have not tried the workspace importXML.
> It is the same system used and there are no changes to the node types between 
> export and import.
>
> It is probably worth mentioning that the mixins were all added to the nodes 
> at runtime, and are therefore not actually specified within the node type 
> definitions.

what do you mean by "not actually specified within the node type definitions"?

all node types need to be registered beforehand once.

if you add a mixin by calling Node.addMixin(String), you have to call
save() in order to persist the change.

if you can provide a simple test case (.cnd file with your custom node
types and a java test case) i'll have a look.

cheers
stefan

> Is this a problem? As I originally said the mixins are correctly specified in 
> the node's jcr:mixinTypes property.
>
>
> The stacktrace:
>
> Caused by: org.springframework.dao.DataIntegrityViolationException: 
> Constraint has been violated; nested exception is 
> javax.jcr.nodetype.ConstraintViolationException: no matching property 
> definition found for {http://MyNamespaceUri}Owner
>    at 
> org.springmodules.jcr.SessionFactoryUtils.translateException(SessionFactoryUtils.java:182)
>    at 
> org.springmodules.jcr.JcrAccessor.convertJcrAccessException(JcrAccessor.java:58)
>    at org.springmodules.jcr.JcrTemplate.execute(JcrTemplate.java:82)
>    at org.springmodules.jcr.JcrTemplate.execute(JcrTemplate.java:108)
>    at 
> com.gossinteractive.dataaccessor.dal.JcrTemplateDao.executeAction(JcrTemplateDao.java:88)
>    ... 3 more
> Caused by: javax.jcr.nodetype.ConstraintViolationException: no matching 
> property definition found for {MyNamespaceUri}Owner
>    at 
> org.apache.jackrabbit.core.nodetype.EffectiveNodeType.getApplicablePropertyDef(EffectiveNodeType.java:808)
>    at 
> org.apache.jackrabbit.core.xml.PropInfo.getApplicablePropertyDef(PropInfo.java:110)
>    at org.apache.jackrabbit.core.xml.PropInfo.apply(PropInfo.java:121)
>    at 
> org.apache.jackrabbit.core.xml.SessionImporter.startNode(SessionImporter.java:260)
>    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 javax.xml.parsers.SAXParser.parse(Unknown Source)
>    at 
> org.apache.jackrabbit.commons.xml.ParsingContentHandler.parse(ParsingContentHandler.java:62)
>    at 
> org.apache.jackrabbit.commons.AbstractSession.importXML(AbstractSession.java:343)
>    at 
> com.gossinteractive.schedule.dal.ImportAction.doInJcr(ImportAction.java:71)
>    at org.springmodules.jcr.JcrTemplate.execute(JcrTemplate.java:76)
>    ... 5 more
>
>
>> From: [email protected]
>> To: [email protected]
>> Subject: Re: Unable to import content using mixins
>> Date: Fri, 28 Aug 2009 15:34:30 +0200
>>
>> hi paul,
>>
>> On 28.08.2009, at 14:00, Paul Skinner <[email protected]>
>> wrote:
>>
>> >
>> > Hi all,
>> >
>> > I am using the following code snippet to import nodes into the
>> > repository.
>> >
>> >    InputStream in = new FileInputStream(importFile);
>> >    session.importXML("/", in,
>> > ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING);
>> >    session.save();
>> >
>> > The import file had previously been generated using this code snippet:
>> >
>> >    OutputStream out = new FileOutputStream(exportFile);
>> >    session.exportSystemView("/MyPrefix:MyRoot", out, false, false);
>> >    out.close();
>> >
>> >
>> > My
>> > problem is when I import nodes that were created in the repository
>> > using mixins. Errors are recieved when I try and import them:
>> >
>> >    "no matching property definition found"
>> > or
>> >    "no definition found in parent node's node type for new node: no
>> > matching child node definition found"
>> >
>> > depending
>> > on whether the mixin added extra properties or child nodes. The export
>> > file contains the mixins in the jcr:mixinTypes property as well as any
>> > properties and child nodes that were added by the mixin.
>>
>> has the export been done on a different system or have there been any
>> node type modifications/manipulations in between? the error msg seems
>> to indicate a problem related to incompatible node types.
>>
>> mixin's should not cause any problems for system view xml roundtripping.
>>
>> cheers
>> stefan
>>
>> >
>> >
>> > How do I import content created using mixins?
>> >
>> > Regards
>> > Paul
>> > _________________________________________________________________
>> > Windows Live Messenger: Celebrate 10 amazing years with free winks
>> > and emoticons.
>> > http://clk.atdmt.com/UKM/go/157562755/direct/01/
>
> _________________________________________________________________
> Windows Live Messenger: Thanks for 10 great years—enjoy free winks and 
> emoticons.
> http://clk.atdmt.com/UKM/go/157562755/direct/01/

Reply via email to