[ 
https://issues.apache.org/jira/browse/JCR-1755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12633719#action_12633719
 ] 

Jakub Wozniakowski commented on JCR-1755:
-----------------------------------------

Confirmed. 
Surrounding node definitions by <nodeTypes></nodeTypes> is successfull 
workaround.

> 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
>            Priority: Critical
>
> 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.

Reply via email to