[ https://issues.apache.org/jira/browse/JCR-1755?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jukka Zitting resolved JCR-1755. -------------------------------- Resolution: Fixed Fix Version/s: core 1.4.6 Assignee: Jukka Zitting Fixed the issue in revision 698209 and merged the fix to the 1.4 branch in revision 698210. Thanks for reporting this! > ClassCastException when registering custom node by XML file > ----------------------------------------------------------- > > Key: JCR-1755 > URL: https://issues.apache.org/jira/browse/JCR-1755 > Project: Jackrabbit > Issue Type: Bug > Components: jackrabbit-core > Affects Versions: core 1.4.5 > Environment: Spring 2.5, Spring Modules 0.9, Firefox 3, Tomcat 6, > Ubuntu 8.10, MySql 5 > Repository is deployed as a shared J2EE resource (JNDI). > Reporter: Jakub Wozniakowski > Assignee: Jukka Zitting > Priority: Critical > Fix For: core 1.4.6 > > > When trying to register node type from XML file using following code: > JackrabbitNodeTypeManager nodeTypeManager = > (JackrabbitNodeTypeManager)workspace.getNodeTypeManager(); > for(Resource resource : nodeDefinitions){ > System.out.println("** registering node:"+resource); > > nodeTypeManager.registerNodeTypes(resource.getInputStream(), > JackrabbitNodeTypeManager.TEXT_XML); > } > we receive such surprise: > Caused by: java.lang.ClassCastException: > com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl > at > org.apache.jackrabbit.core.util.DOMWalker.iterateElements(DOMWalker.java:215) > at > org.apache.jackrabbit.core.nodetype.xml.NodeTypeReader.getNodeTypeDefs(NodeTypeReader.java:121) > at > org.apache.jackrabbit.core.nodetype.NodeTypeManagerImpl.registerNodeTypes(NodeTypeManagerImpl.java:257) > at > org.apache.jackrabbit.core.nodetype.NodeTypeManagerImpl.registerNodeTypes(NodeTypeManagerImpl.java:499) > at > pl.codeservice.jcr.JcrCustomNodeRegister.registerNodes(JcrCustomNodeRegister.java:41) > at > pl.codeservice.jcr.JcrCustomNodeRegister.init(JcrCustomNodeRegister.java:27) > ... > Registering nodes by .cnd files works fine. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.