[ https://issues.apache.org/jira/browse/JCR-1852?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12648721#action_12648721 ]
Alex Lukin commented on JCR-1852: --------------------------------- Thak you very much, my app works as it should. I just moved file from trunk to 1.5 branch, compiled commons and replaced in my app libs. Everything works fine. Pleas include this fix in 1.5 release. > session.exportDocumentView() does not work with jaxb 2.1.x > UnmarshallerHandler > ------------------------------------------------------------------------------- > > Key: JCR-1852 > URL: https://issues.apache.org/jira/browse/JCR-1852 > Project: Jackrabbit > Issue Type: Bug > Components: jackrabbit-jcr-commons > Affects Versions: 1.5.0 > Environment: jdk 1.6.10 Linux > Reporter: Alex Lukin > Assignee: Jukka Zitting > Fix For: 1.5.0 > > Original Estimate: 3h > Remaining Estimate: 3h > > I tried to update my project from Jackrabbit 1.4 to 1.5 and found following > error, that is critical for my app. > Project uses Import/Export features of JCR and JAXB to map XML from JCR to > java objects. > exportDocumentView() works with streams when I call it like this: > Unmarshaller umr = getUnmarshaller(); > ... > fo = new FileOutputStream("/tmp/export-node.xml"); > jcrs.exportDocumentView(path,fo , false, false); > fi = new FileInputStream("/tmp/export-node.xml"); > umr.unmarshal(new InputSource(fi)); > But it does not work when I call it using SAX event handler: > UnmarshallerHandler ctxh = umr.getUnmarshallerHandler(); > jcrs.exportDocumentView(path, ctxh, false, false); > giving following exception: > java.lang.NullPointerException > at > org.xml.sax.helpers.AttributesImpl.getIndex(AttributesImpl.java:203) > at > com.sun.xml.bind.v2.runtime.unmarshaller.InterningXmlVisitor$AttributesImpl.getIndex(InterningXmlVisitor.java:112) > at > com.sun.xml.bind.v2.runtime.unmarshaller.XsiNilLoader.selectLoader(XsiNilLoader.java:62) > at > com.sun.xml.bind.v2.runtime.unmarshaller.ProxyLoader.startElement(ProxyLoader.java:53) > at > com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:449) > at > com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:427) > at > com.sun.xml.bind.v2.runtime.unmarshaller.InterningXmlVisitor.startElement(InterningXmlVisitor.java:71) > at > com.sun.xml.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:137) > at > org.apache.jackrabbit.commons.xml.Exporter.startElement(Exporter.java:438) > at > org.apache.jackrabbit.commons.xml.DocumentViewExporter.exportNode(DocumentViewExporter.java:76) > at > org.apache.jackrabbit.commons.xml.Exporter.exportNode(Exporter.java:298) > at > org.apache.jackrabbit.commons.xml.Exporter.exportNodes(Exporter.java:214) > at > org.apache.jackrabbit.commons.xml.DocumentViewExporter.exportNode(DocumentViewExporter.java:77) > at > org.apache.jackrabbit.commons.xml.Exporter.exportNode(Exporter.java:298) > at > org.apache.jackrabbit.commons.xml.Exporter.exportNodes(Exporter.java:214) > at > org.apache.jackrabbit.commons.xml.DocumentViewExporter.exportNode(DocumentViewExporter.java:77) > at > org.apache.jackrabbit.commons.xml.Exporter.exportNode(Exporter.java:298) > at > org.apache.jackrabbit.commons.xml.Exporter.export(Exporter.java:144) > at > org.apache.jackrabbit.commons.AbstractSession.export(AbstractSession.java:461) > at > org.apache.jackrabbit.commons.AbstractSession.exportDocumentView(AbstractSession.java:241) > at > ua.org.dg.semaril.helpers.AbstractTypeResolver.getContent(AbstractTypeResolver.java:31 > Version 1.4. works fine. > Jukka, please check your changes to > org.apache.jackrabbit.commons.xml.Exporter. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.