Uploaded image for project: 'Jackrabbit OCM'
  1. Jackrabbit OCM
  2. OCM-64

ocm is not a registered namespace uri

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.0.0
    • None
    • jackrabbit-core 2.6.0、jackrabbit-ocm 2.0.0

    Description

      1.custom node type ,
      [decm:note]

      • decm:user (string) mandatory
      • decm:date (date) mandatory
      • decm:text (string) mandatory
        2.ocm bean
        @Node(jcrType = "decm:note")
        public class DmsNote {
        @Field(path = true)
        private String path;
        @Field(jcrName = "decm:user")
        private String user;
        @Field(jcrName = "decm:date")
        private Date date;
        @Field(jcrName = "decm:text")
        private String text;
        3.ocm insert
        List<Class> annotatedClassNames = new ArrayList<Class>();
        annotatedClassNames.add(DmsNote.class);
        annotatedClassNames.add(DmsFolder.class);
        // 2.
        Mapper mapper = new AnnotationMapperImpl(annotatedClassNames);
        // 3.
        ObjectContentManager ocm = new ObjectContentManagerImpl(ses, mapper);
        DmsNote not = (DmsNote) ocm.getObject("/decmNoteTest");
        System.out.println(not.toString());
        DmsNote f = new DmsNote();
        f.setPath("/decmNoteTest");
        f.setDate(new Date());
        f.setText("ceshiha");
        f.setUser("lucas.yue");
        ocm.insert(f);
        4.error:
        Caused by: javax.jcr.NamespaceException: ocm: is not a registered namespace prefix.

      Attachments

        Activity

          People

            Unassigned Unassigned
            fsh1281 lucas.yue
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: