jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Lustig <tho...@futuredesign.at>
Subject Re: ClientNodeTypeManager cannot be cast to JackrabbitNodeTypeManager
Date Mon, 16 Aug 2010 11:11:41 GMT
hi alex,

If i am not able to register new nodes via RMI and also not via DavEx, 
whatelse could i do
to register my new nodetypes directly on server?

I also tried it with the XML file alternative:
----------------- my custom_nodetypes.xml in folder 
\repository\nodetypes -------------
<nodeTypes xmlns:myns="my-namespace"
          xmlns:nt="http://www.jcp.org/jcr/nt/1.0">

 <nodeType name="myns:javaobject"
           isMixin="true" hasOrderableChildNodes="false" primaryItemName=""
           isAbstract="false">
   <supertypes>
     <supertype>nt:base</supertype>
   </supertypes>

    <propertyDefinition name="myns:hibernateid"
                       requiredType="String"
                       autoCreated="false"
                       mandatory="false"
                       onParentVersion="COPY"
                       protected="false"
                       multiple="false"/>

    <propertyDefinition name="myns:javaclass"
                       requiredType="String"
                       autoCreated="false"
                       mandatory="false"
                       onParentVersion="COPY"
                       protected="false"
                       multiple="false"/>

 </nodeType>
</nodeTypes>
------------------------------------------------------------------------------------- 

in Java i used it this way:
..........
filenode.addMixin("myns:javaobject");
            filenode.setProperty("myns:javaclass", myclass);
            filenode.setProperty("myns:hibernateid", myuuid);
.........

Here everthing works fine until i restart the jackrabbit server. After 
this my new nodetypes are not
accessible on old nodes, only on new created nodes.

Is there any working alternative for me to register my nodetypes?
Maybe programmatically or via Configuration files?

best regards,
Thomas


Alexander Klimetschek schrieb:
> I think node type management is not yet supported in
> jackrabbit-jcr-rmi for JCR 2.0. See also
> https://issues.apache.org/jira/browse/JCRRMI-26
>
> Regards,
> Alex
>
> On Mon, Aug 16, 2010 at 10:42, Thomas Lustig <thomas@futuredesign.at> wrote:
>   
>> Hi all,
>>
>> I am using Jackrabbit 2.1 connecting to server via RMI:
>>
>> ........ snippet ....
>> repository = new RMIRemoteRepository("//localhost/jackrabbit.repository");
>> ........
>>
>> I used this example directly from Jackrabbit site:
>> http://jackrabbit.apache.org/node-types.html#NodeTypes-RegisteringNodeTypes
>>
>> ........ snippet ....
>> JackrabbitNodeTypeManager manager = (JackrabbitNodeTypeManager)
>>               session.getWorkspace().getNodeTypeManager();
>>        // Register the custom node types defined in the CND file
>>        manager.registerNodeTypes(new FileInputStream(cndFileName),
>>               JackrabbitNodeTypeManager.TEXT_X_JCR_CND);
>> ........
>>
>> when i run this, i get the following Error:
>> java.lang.ClassCastException:
>> org.apache.jackrabbit.rmi.client.ClientNodeTypeManager cannot be cast to
>> org.apache.jackrabbit.api.JackrabbitNodeTypeManager
>>
>> I read that it is important to use ServerAdapterFactory and
>> ClientAdapterFactory classes, but i do not know how.
>> Can anyone tell me how to get the ebove code working?
>>
>> Please help me, its very important for me to register new node types
>>
>> best regards
>> thomas
>>
>>
>>
>>     
>
>
>
>   


Mime
View raw message