jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boni Gopalan \(BioImagene\)" <Bon...@bioimagene.com>
Subject RE: OCM Annotations constraint error
Date Fri, 14 Nov 2008 08:39:28 GMT

Try adding this code to the place where you are creating the session.

        NamespaceRegistry nsr =
session.getWorkspace().getNamespaceRegistry();

        try {
            String uri = nsr.getURI("ocm");

            if (uri == null) {
                nsr.registerNamespace("ocm",
"http://jackrabbit.apache.org/ocm");
            }
        } catch (javax.jcr.NamespaceException e) {
        	logger.debug("\n Exception in
JcrDataSource_registerNodeTypes:=>"+e.getMessage());
            nsr.registerNamespace("ocm",
"http://jackrabbit.apache.org/ocm");
        }

To me it looks like this name space registration is missing.



-----Original Message-----
From: majohnst [mailto:matt@lattaoutdoors.com] 
Sent: 14 November 2008 08:03
To: users@jackrabbit.apache.org
Subject: OCM Annotations constraint error


I am trying to use the OCM annotations in my project. I have setup
everything
to be run through Spring 2.5. Everything works correctly, but then I
converted my code to use OCM annotations and I am starting to have
problems.

I am using the sample POJO entities from the junit tests: HierarchyNode,
File, Folder, Resource. When I try to create a new File node, I get an
error
about: 

javax.jcr.nodetype.ConstraintViolationException: no matching property
definition found for {}ocm_classname

I have checked and the custom_nodetypes.xml file is being loaded, but I
don't think it is actually doing anything. I have tried editing the
custom_nodetypes.xml to name the ocm:classname something else and I have
even tried not loading the custom_nodetypes.xml. Everytime I get the
same
error about the missing ocm_classname.

Has anyone seen this? I haven't been able to find anything about how to
set
the ocm:classname.
-- 
View this message in context:
http://www.nabble.com/OCM-Annotations-constraint-error-tp20493710p204937
10.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Mime
View raw message