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: FW: Custom Node Types XML
Date Thu, 24 Aug 2006 13:39:58 GMT
On 8/24/06, Shanmugam Gopal <haishanmugam@hotmail.com> wrote:
> Hi,
>
> I am trying to create a custom node by extending nt:resource so that I can
> add some custom properties to that node.
>
> Following is the Custom_nodetypes.xml configuration.

did you edit custom_nodetypes.xml manually?

custom_nodetypes.xml is used internally for persisting node types
registered through the api. it's *not* meant to be user-provided/manipulated
and therefore *not* supported.

you should use the approproate api (e.g.
org.apache.jackrabbit.api.JackrabbitNodeTypeManager) for registering
custom node types.

cheers
stefan

>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
> xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:rep="internal"
> xmlns:sv="http://www.jcp.org/jcr/sv/1.0"
> xmlns:plateau="http://www.apache.org/jackrabbit/plateau"
> xmlns:mix="http://www.jcp.org/jcr/mix/1.0">
> <nodeType name="plateau:resource" isMixin="false"
> hasOrderableChildNodes="false" primaryItemName="jcr:data">
>
>      <supertypes>
>
>              <supertype>nt:resource</supertype>
>
>      </supertypes>
>
>      <propertyDefinition name="plateau:username" requiredType="String"
> autoCreated="false" mandatory="false" onParentVersion="COPY"
> protected="false" multiple="false"/>
>
>      <propertyDefinition name="plateau:Author" requiredType="String"
> autoCreated="false" mandatory="false" onParentVersion="COPY"
> protected="false" multiple="false"/>
>
> </nodeType>
> </nodeTypes>
>
> But I am getting the Following ClassCastException while registering this
> custom node.
>
>
> >java.lang.ClassCastException
> >
> >         at
> >org.apache.jackrabbit.core.util.DOMWalker.iterateElements(DOMWalker.java
> >:219)
> >
> >         at
> >org.apache.jackrabbit.core.nodetype.xml.NodeTypeReader.getNodeTypeDefs(N
> >odeTypeReader.java:118)
> >
> >         at
> >org.apache.jackrabbit.core.nodetype.xml.NodeTypeReader.read(NodeTypeRead
> >er.java:64)
> >
> >         at
> >org.apache.jackrabbit.core.nodetype.NodeTypeDefStore.load(NodeTypeDefSto
> >re.java:54)
> >
> >         at
> >org.apache.jackrabbit.core.nodetype.NodeTypeRegistry.loadCustomNodeTypeD
> >efs(NodeTypeRegistry.java:1681)
> >
> >         at
> >org.apache.jackrabbit.core.nodetype.NodeTypeRegistry.<init>(NodeTypeRegi
> >stry.java:210)
> >
> >         at
> >org.apache.jackrabbit.core.nodetype.NodeTypeRegistry.create(NodeTypeRegi
> >stry.java:123)
> >
> >         at
> >org.apache.jackrabbit.core.RepositoryImpl.createNodeTypeRegistry(Reposit
> >oryImpl.java:501)
> >
> >         at
> >org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:238
> >)
> >
> >         at
> >org.apache.jackrabbit.core.RepositoryImpl.create(RepositoryImpl.java:514
> >)
> >
> >         at
> >org.apache.jackrabbit.j2ee.RepositoryStartupServlet.createRepository(Rep
> >ositoryStartupServlet.java:301)
> >
> >         at
> >org.apache.jackrabbit.j2ee.RepositoryStartupServlet.initRepository(Repos
> >itoryStartupServlet.java:272)
> >
> >         at
> >org.apache.jackrabbit.j2ee.RepositoryStartupServlet.init(RepositoryStart
> >upServlet.java:189)
> >
> >         at javax.servlet.GenericServlet.init(GenericServlet.java:211)
>
>
>
> Is there any wrong with the custom node definition ??
>
> Regards,
> Shanmugam G
>
> _________________________________________________________________
> Shah Rukh fan? Know all about the Baadshah of Bollywood. On MSN Search
> http://server1.msn.co.in/profile/shahrukh.asp
>
>

Mime
View raw message