You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "lucas.yue (JIRA)" <ji...@apache.org> on 2013/03/19 06:41:16 UTC

[jira] [Created] (OCM-64) ocm is not a registered namespace uri

lucas.yue created OCM-64:
----------------------------

             Summary: ocm is not a registered namespace uri
                 Key: OCM-64
                 URL: https://issues.apache.org/jira/browse/OCM-64
             Project: Jackrabbit OCM
          Issue Type: Bug
    Affects Versions: 2.0.0
         Environment: jackrabbit-core 2.6.0、jackrabbit-ocm 2.0.0
            Reporter: lucas.yue


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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira