You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Jukka Zitting (JIRA)" <ji...@apache.org> on 2007/04/05 14:16:33 UTC
[jira] Resolved: (JCR-339) null pointer when cloning to different
workspace under the root node
[ https://issues.apache.org/jira/browse/JCR-339?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jukka Zitting resolved JCR-339.
-------------------------------
Resolution: Cannot Reproduce
Re-resolving with the correct "Cannot Reproduce" tag.
> null pointer when cloning to different workspace under the root node
> --------------------------------------------------------------------
>
> Key: JCR-339
> URL: https://issues.apache.org/jira/browse/JCR-339
> Project: Jackrabbit
> Issue Type: Bug
> Components: core
> Environment: Microsoft Windows 2000, Service pack 4
> Reporter: Giota Karadimitriou
> Assigned To: Stefan Guggisberg
> Attachments: BatchedItemOperations.java
>
>
> I have been testing my application with jackrabbit 1.0 and found a small error which causes a null pointer exception.
> Class org.apache.jackrabbit.core.BatchedItemOperations
> public void checkAddNode(...
> //line 576
> // make sure parent node is not protected
> < if (parentDef.isProtected()) {
> > if (parentDef!=null && parentDef.isProtected()) { //proposed solution
> The code that tested that is this below .
> One must have 2 workspaces to run this and try to clone a node of the first workspace under the root of the second:
> String originalWorkspace = entry.getWorkspace();
> String originalPath = entry.getAbsolutePath();
> Session originalSession = getSession(originalWorkspace);
> Session session = getSession(secondWorkspace);
> log.debug("originalSession=" + originalSession);
> Node rnOriginal=originalSession.getRootNode();
> Node node=rnOriginal.getNode(originalPath.substring(1));
> log.debug("node=" + node);
> log.debug("session=" + session);
> Workspace ws = session.getWorkspace();
> log.debug("ws=" + ws.getName());
> String name=Util.getName(originalPath); //gets just the file name
> log.debug("name=" + name);
> ws.clone(originalWorkspace, originalPath, Constants.PATH_SEPARATOR_CHAR + name, true);
> Node rn = session.getRootNode();
> log.debug("rn=" + rn);
> Node movedNode = rn.getNode(name);
> log.debug("movedNode=" + movedNode);
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.