You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Thomas Mueller (JIRA)" <ji...@apache.org> on 2013/02/19 15:37:12 UTC

[jira] [Created] (OAK-642) NPE trying to add a node to an nt:folder node

Thomas Mueller created OAK-642:
----------------------------------

             Summary: NPE trying to add a node to an nt:folder node
                 Key: OAK-642
                 URL: https://issues.apache.org/jira/browse/OAK-642
             Project: Jackrabbit Oak
          Issue Type: Bug
          Components: jcr
            Reporter: Thomas Mueller
            Priority: Minor


The following code throws a NPE:

{code}
Session s = getAdminSession();
s.getRootNode().addNode("a", "nt:folder").addNode("b");
s.save();        
{code}

Stack trace:
{code}
java.lang.NullPointerException
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:191)
at org.apache.jackrabbit.oak.namepath.LocalNameMapper.getOakNameOrNull(LocalNameMapper.java:82)
at org.apache.jackrabbit.oak.namepath.GlobalNameMapper.getOakName(GlobalNameMapper.java:64)
at org.apache.jackrabbit.oak.namepath.NamePathMapperImpl.getOakName(NamePathMapperImpl.java:62)
at org.apache.jackrabbit.oak.plugins.nodetype.ReadOnlyNodeTypeManager.getOakName(ReadOnlyNodeTypeManager.java:92)
at org.apache.jackrabbit.oak.plugins.nodetype.ReadOnlyNodeTypeManager.getNodeType(ReadOnlyNodeTypeManager.java:186)
at org.apache.jackrabbit.oak.jcr.NodeImpl$5.perform(NodeImpl.java:265)
at org.apache.jackrabbit.oak.jcr.NodeImpl$5.perform(NodeImpl.java:1)
at org.apache.jackrabbit.oak.jcr.SessionDelegate.perform(SessionDelegate.java:136)
at org.apache.jackrabbit.oak.jcr.NodeImpl.addNode(NodeImpl.java:219)
at org.apache.jackrabbit.oak.jcr.NodeImpl.addNode(NodeImpl.java:210)
at org.apache.jackrabbit.oak.jcr.CRUDTest.nodeType(CRUDTest.java:122)
{code}


--
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