You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Giota Karadimitriou <Gi...@eurodyn.com> on 2006/03/10 09:44:08 UTC

some small error found

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()) {
 
I don't know the process, whether I should report to jira/file issue
that is why I write directly to the list
 
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);
 
regards,
Giota
          
 
 
 
 
 

Re: some small error found

Posted by Stefan Guggisberg <st...@gmail.com>.
hi giota,

On 3/13/06, Giota Karadimitriou <Gi...@eurodyn.com> wrote:
> Hello Stefan,
>
> I just tried with a clean repository and it seems you are right, I do
> not get the null pointer exception any more. I had not cleaned up my
> repository after putting the new version of jackrabbit. It works fine
> for a clean repository.
>
> Sorry for the delay caused, please consider this issue closed.

no problem, thanks for the detailed bug report! keep up the good work.

cheers
stefan

>
> -----Original Message-----
> From: Stefan Guggisberg [mailto:stefan.guggisberg@gmail.com]
> Sent: Friday, March 10, 2006 4:39 PM
> To: jackrabbit-dev@incubator.apache.org
> Subject: Re: some small error found
>
> hi giota
>
> i was unable to reproduce your problem. i used the following code for
> testing:
>
> Session session1 = r.login(new SimpleCredentials("johndoe",
> "".toCharArray()), "wsp1");
> Workspace wsp1 = session1.getWorkspace();
> Node fileNode = session1.getRootNode().getNode("/foo/bar/blah.txt");
> // node of type nt:file
>
> Session session2 = r.login(new SimpleCredentials("johndoe",
> "".toCharArray()), "wsp2");
> Workspace wsp2 = session2.getWorkspace();
>
> String dstPath = "/" + fileNode.getName();
> wsp2.clone(wsp1.getName(), fileNode.getPath(), dstPath, true);
>
> did you test with a 'fresh', i.e. an initially empty repository?
> can you provide a complete test class that i can use with an empty
> jackrabbit instance?
>
> cheers
> stefan
>
>
> On 3/10/06, Giota Karadimitriou <Gi...@eurodyn.com> wrote:
> > 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()) {
> >
> > I don't know the process, whether I should report to jira/file issue
> > that is why I write directly to the list
> >
> > 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);
> >
> > regards,
> > Giota
> >
> >
> >
> >
> >
> >
> >
> >
>
>

RE: some small error found

Posted by Giota Karadimitriou <Gi...@eurodyn.com>.
Hello Stefan,

I just tried with a clean repository and it seems you are right, I do
not get the null pointer exception any more. I had not cleaned up my
repository after putting the new version of jackrabbit. It works fine
for a clean repository. 

Sorry for the delay caused, please consider this issue closed.

-----Original Message-----
From: Stefan Guggisberg [mailto:stefan.guggisberg@gmail.com] 
Sent: Friday, March 10, 2006 4:39 PM
To: jackrabbit-dev@incubator.apache.org
Subject: Re: some small error found

hi giota

i was unable to reproduce your problem. i used the following code for
testing:

Session session1 = r.login(new SimpleCredentials("johndoe",
"".toCharArray()), "wsp1");
Workspace wsp1 = session1.getWorkspace();
Node fileNode = session1.getRootNode().getNode("/foo/bar/blah.txt"); 
// node of type nt:file

Session session2 = r.login(new SimpleCredentials("johndoe",
"".toCharArray()), "wsp2");
Workspace wsp2 = session2.getWorkspace();

String dstPath = "/" + fileNode.getName();
wsp2.clone(wsp1.getName(), fileNode.getPath(), dstPath, true);

did you test with a 'fresh', i.e. an initially empty repository?
can you provide a complete test class that i can use with an empty
jackrabbit instance?

cheers
stefan


On 3/10/06, Giota Karadimitriou <Gi...@eurodyn.com> wrote:
> 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()) {
>
> I don't know the process, whether I should report to jira/file issue
> that is why I write directly to the list
>
> 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);
>
> regards,
> Giota
>
>
>
>
>
>
>
>


Re: some small error found

Posted by Stefan Guggisberg <st...@gmail.com>.
hi giota

i was unable to reproduce your problem. i used the following code for testing:

Session session1 = r.login(new SimpleCredentials("johndoe",
"".toCharArray()), "wsp1");
Workspace wsp1 = session1.getWorkspace();
Node fileNode = session1.getRootNode().getNode("/foo/bar/blah.txt"); 
// node of type nt:file

Session session2 = r.login(new SimpleCredentials("johndoe",
"".toCharArray()), "wsp2");
Workspace wsp2 = session2.getWorkspace();

String dstPath = "/" + fileNode.getName();
wsp2.clone(wsp1.getName(), fileNode.getPath(), dstPath, true);

did you test with a 'fresh', i.e. an initially empty repository?
can you provide a complete test class that i can use with an empty
jackrabbit instance?

cheers
stefan


On 3/10/06, Giota Karadimitriou <Gi...@eurodyn.com> wrote:
> 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()) {
>
> I don't know the process, whether I should report to jira/file issue
> that is why I write directly to the list
>
> 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);
>
> regards,
> Giota
>
>
>
>
>
>
>
>

Re: some small error found

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On 3/10/06, Giota Karadimitriou <Gi...@eurodyn.com> wrote:
> I have been testing my application with jackrabbit 1.0 and found a small
> error which causes a null pointer exception.

Thanks for the detailed bug report!

> I don't know the process, whether I should report to jira/file issue
> that is why I write directly to the list

Can you file the report in Jira? That way it's easier to track when
and how the bug gets fixed.

A good rule of thumb for issue tracker vs. mailing list is that clear
bugs and well defined feature requests should go to the issue tracker.
The mailing list is preferred if you're not sure if certain behaviour
is a bug or if you just want to ask questions or discuss Jackrabbit
generally.

BR,

Jukka Zitting

--
Yukatan - http://yukatan.fi/ - info@yukatan.fi
Software craftsmanship, JCR consulting, and Java development

Re: some small error found

Posted by Stefan Guggisberg <st...@gmail.com>.
hi giota,
i saw that you've already created a jira issue, thanks. i'll take care
of it asap.

cheers
stefan

On 3/10/06, Giota Karadimitriou <Gi...@eurodyn.com> wrote:
> 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()) {
>
> I don't know the process, whether I should report to jira/file issue
> that is why I write directly to the list
>
> 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);
>
> regards,
> Giota
>
>
>
>
>
>
>
>