jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "angela (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-1571) JCR Webdav Server doesn't support node.hasNode() method
Date Thu, 08 May 2008 08:36:57 GMT

    [ https://issues.apache.org/jira/browse/JCR-1571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12595148#action_12595148
] 

angela commented on JCR-1571:
-----------------------------

hi julio

first of all: i don't think that the <HR> is sent by the JCR-server.

i quickly tried it out having the attached test cases:

test 1) creating a 'myTest' node -> save -> new session -> parent.hasNode should
return true
test 2) same as 1) by trying parent.hasNode without the node being created before.

both work for me as expected... did i misunderstand your test? please let me know.

test 1) log

C-2-#022602 -> [PROPFIND /mytest/server/default/jcr%3aroot/testroot/myTest HTTP/1.1 ]
C-2-#022671 -> [Depth: 1 ]
C-2-#022681 -> [Authorization: Basic YWRtaW46YWRtaW4= ]
C-2-#022720 -> [User-Agent: Jakarta Commons-HttpClient/3.0 ]
C-2-#022764 -> [Host: localhost:5502 ]
C-2-#022786 -> [Content-Length: 599 ]
C-2-#022807 -> [Content-Type: text/xml; charset=UTF-8 ]
C-2-#022846 -> [ ]
C-2-#022848 -> [<?xml version="1.0" encoding="UTF-8"?>]
C-2-#022887 -> [<D:propfind xmlns:D="DAV:"><D:prop><dcr:name xmlns:dcr="http://www.day.com/jcr/webdav/1.0"/><dcr:referen
ces xmlns:dcr="http://www.day.com/jcr/]
C-2-#023028 -> [webdav/1.0"/><dcr:index xmlns:dcr="http://www.day.com/jcr/webdav/1.0"/><dcr:path
xmlns:dcr="http://www.d
ay.com/jcr/webdav/1.0"/><dcr:mixinnod]
C-2-#023169 -> [etypes xmlns:dcr="http://www.day.com/jcr/webdav/1.0"/><dcr:parent
xmlns:dcr="http://www.day.com/jcr/webd
av/1.0"/><dcr:primarynodetype xmlns:d]
C-2-#023310 -> [cr="http://www.day.com/jcr/webdav/1.0"/><D:resourcetype/><dcr:uuid
xmlns:dcr="http://www.day.com/jcr/web
dav/1.0"/></D:prop></D:propfind>]
S-2-#117910 -> [HTTP/1.1 207 Code 207 ]
[...]


test 2) log

C-0-#013648 -> [PROPFIND /mytest/server/default/jcr%3aroot/testroot/myTest HTTP/1.1 ]
C-0-#013717 -> [Depth: 1 ]
C-0-#013727 -> [Authorization: Basic YW5vbnltb3VzOg== ]
C-0-#013766 -> [User-Agent: Jakarta Commons-HttpClient/3.0 ]
C-0-#013810 -> [Host: localhost:5502 ]
C-0-#013832 -> [Content-Length: 599 ]
C-0-#013853 -> [Content-Type: text/xml; charset=UTF-8 ]
C-0-#013892 -> [ ]
C-0-#013894 -> [<?xml version="1.0" encoding="UTF-8"?>]
C-0-#013933 -> [<D:propfind xmlns:D="DAV:"><D:prop><dcr:name xmlns:dcr="http://www.day.com/jcr/webdav/1.0"/><dcr:referen
ces xmlns:dcr="http://www.day.com/jcr/]
C-0-#014074 -> [webdav/1.0"/><dcr:index xmlns:dcr="http://www.day.com/jcr/webdav/1.0"/><dcr:path
xmlns:dcr="http://www.d
ay.com/jcr/webdav/1.0"/><dcr:mixinnod]
C-0-#014215 -> [etypes xmlns:dcr="http://www.day.com/jcr/webdav/1.0"/><dcr:parent
xmlns:dcr="http://www.day.com/jcr/webd
av/1.0"/><dcr:primarynodetype xmlns:d]
C-0-#014356 -> [cr="http://www.day.com/jcr/webdav/1.0"/><D:resourcetype/><dcr:uuid
xmlns:dcr="http://www.day.com/jcr/web
dav/1.0"/></D:prop></D:propfind>]
S-0-#077856 -> [HTTP/1.1 404 Not Found ]
S-0-#077880 -> [Host: localhost:4302 ]
S-0-#077902 -> [Connection: Close ]
S-0-#077921 -> [Server: Communique Servlet Engine/4.0.2 ]
S-0-#077962 -> [Content-Type: text/html ]
S-0-#077987 -> [Date: Thu, 08 May 2008 08:26:54 GMT ]
S-0-#078024 -> [Transfer-Encoding: chunked ]
S-0-#078052 -> [ ]
S-0-#078054 -> [65 ]
S-0-#078058 -> [<html><head><title> ]
S-0-#078079 -> [404 ]
S-0-#078084 -> [  ]
S-0-#078087 -> [Not Found ]
S-0-#078098 -> [</title></head><body><h1> ]
S-0-#078125 -> [Not Found ]
S-0-#078136 -> [</h1> ]
S-0-#078143 -> [</body></html> ]
S-0-#078159 -> [ ]
S-0-#078161 -> [0 ]
S-0-#078164 -> [ ]
S-0-Finished: 78166 bytes (3.0 kb/s)
C-0-Finished: 14493 bytes (0.0 kb/s)



> JCR Webdav Server doesn't support node.hasNode() method
> -------------------------------------------------------
>
>                 Key: JCR-1571
>                 URL: https://issues.apache.org/jira/browse/JCR-1571
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: sandbox
>    Affects Versions: core 1.4.2
>         Environment: JDK 1.6; Tomcat 6; Windows 2003
>            Reporter: Julio Castillo
>            Assignee: angela
>         Attachments: trace_JCR-1571.txt
>
>
> I have a set up that uses the JCR Webdav Server from a custom remote client.
> I've noticed one thing, anytime I request a node that doesn't exist the error that comes
back from the server is as follows:
> [Fatal Error] :1:941: The element type "HR" must be terminated by the matching end-tag
"</HR>".
> javax.jcr.RepositoryException: The element type "HR" must be terminated by the matching
end-tag "</HR>".: The element type "HR" must be terminated by the matching end-tag "</HR>".
> Doesn't really make sense, but that is OK, I can handle that.
> My problem:
> I have a partially populated repository that at the root has a few nodes like
> /edu/....
> /com/ibm/..
> So, I want to create a few nodes of type nt:folder under
> com/myCompany/folder1
> I have no problem creating them, but since "com" already exists I end up with
> com[2]/myCompany/folder1.
> So, I went ahead and used the parentNode.hasNode("folderName") method.
> This method returns true for the "com" portion, but when I test for the "myCompany" folder
which should return false I get the error response shown above from the server.
> The webdav request looks as follows:
> PROPFIND /jackrabbit/server/default/jcr%3aroot/com/myCompany
> The snippet of code looks as follows:
>   private Node createFolders (Session session, Node parentNode, List <String> folders)
> 	  throws RepositoryException {
>     Node folderNode = null;
>     for (String folder : folders) {
> 	if (parentNode.hasNode(folder))
> 	    folderNode = parentNode.getNode(folder);
> 	else
> 	    folderNode = parentNode.addNode(folder, "nt:folder");
> 	parentNode = folderNode;
>     }
>     session.save();
>     return (folderNode);
>   }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message