You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Julio Castillo <jc...@edgenuity.com> on 2008/03/18 21:48:10 UTC

JCR Webdav Server -1.4.1 -looking for a client

What does it actually mean to use this servlet (JCRWebdavServerServlet) to
"remote JCR170 calls"?
Does it mean that the WebDav interface was "extended" to support specific
JCR calls?

Per the online documentation a corresponding JCR client refers to the "JCR
to SPI" and "SPI to WebDAV" in the sandbox. I found the following: a package
called: jackrabbit-jcr2spi/* on the regular release and spi2dav/* on the
sandbox.

Any preference on either approach? How do I bootstrap a client?

On a brief look at the spi2dav files I believe this is the path to follow:
Instantiate a copy of JCR2SPIRepositoryStub which in turn will instantiate a
copy of RepositoryServiceImpl.
The starting point for my code would then start with the
JCR2SPIRepositoryStub.

I couldn't not find a starting point however with just the code in the main
trunk within the jackrabbit-jcr2spi/*. Any ideas?

Julio Castillo
Edgenuity Inc.


Re: JCR Webdav Server -1.4.1 -looking for a client

Posted by Angela Schreiber <an...@day.com>.
hi julio

> As I single step through it, the following file has a relevant role in the
> process:
> The problems (actually warnings). The current settings for authentication
> generates the following warnings while trying to get execute the
> JCR2SPIRepositoryStub.getRepository() method.
> "0     [main] WARN  org.apache.commons.httpclient.HttpMethodDirector  -
> Required credentials not available for BASIC <any realm>@localhost:2455"
> "39125 [main] WARN  org.apache.commons.httpclient.HttpMethodDirector  -
> Preemptive authentication requested but no default credentials available"
> 
> On the server side I get the fact that "anonymous" logs in and out.

good.

> Any idea what exactly the warning messages refer to? Or how to address them?

no... i noticed them as well, but never investigated
on that. i guess that you can get more information about
this from one of the httpclient-lists.

angela




RE: JCR Webdav Server -1.4.1 -looking for a client

Posted by Julio Castillo <jc...@edgenuity.com>.
Angela,
I tried to put together a JCR WebDav client from various test programs in
the sources. I enabled in the jackrabbit's web.xml the init-parm entries
under JCRWebdavServlet (missing-auth-mapping and authenticate-header).
I picked up a the file repositoryStubImpl.properties and made the following
modification:
javax.jcr.tck.repository_stub_impl=com.myCompany.contentMgmt.stub.JCR2SPIRep
ositoryStub
org.apache.jackrabbit.jcr2spi.repository.url=http://localhost:2455/jackrabbi
t/server/

Where the JCR2SPIRepositoryStub is a ported module based on
 org/apache/jackrabbit/jcr2spi/JCR2SPIRepositoryStub.java

My starting point was the following file:
 org/apache/jackrabbit/test/RepositoryHelper.java

As I single step through it, the following file has a relevant role in the
process:
 org/apache/jackrabbit/jcr2spi/RepositoryImpl.java

The problems (actually warnings). The current settings for authentication
generates the following warnings while trying to get execute the
JCR2SPIRepositoryStub.getRepository() method.
"0     [main] WARN  org.apache.commons.httpclient.HttpMethodDirector  -
Required credentials not available for BASIC <any realm>@localhost:2455"
"39125 [main] WARN  org.apache.commons.httpclient.HttpMethodDirector  -
Preemptive authentication requested but no default credentials available"

On the server side I get the fact that "anonymous" logs in and out.
Any idea what exactly the warning messages refer to? Or how to address them?

Thanks

** julio

-----Original Message-----
From: Angela Schreiber [mailto:anchela@day.com] 
Sent: Wednesday, March 26, 2008 2:49 AM
To: users@jackrabbit.apache.org
Subject: Re: JCR Webdav Server -1.4.1 -looking for a client

hi julio

> 1) When you say, "make sure your jcr2spi is started with spi2dav", 
> where exactly is this configured?

see o.a.j.jcr2spi.config.RepositoryConfig#getRepositoryService

> Are you talking on the servlet side? 

no. the client.

> Or are you
> talking of whatever package I put together for the client side?

yes. if you want to use JCR2SPI you have to define, which SPI implementation
should be used.

> 2) Related to the above question. I did find several references to the 
> repositoryStubImpl.properties file in the main trunk and sandbox
directory.

yes... that's a bit confusing. the following are present to my
knowledge:
- jackrabbit-core -> run tests for jackrabbit-core
- jackrabbit-jcr2spi -> run test for jcr2spi (by default with spi2jcr)
- sandbox -> that's mainly a leftover from the times where jcr2spi was
              in the sandbox.

if you want to use jcr2spi with some spi impl, you can focus on the
properties present with jcr2spi. if you want to run your custom spi
implementation you have to add a corresponding entry.

> Somehow I have to make sure that is read by the client package that I 
> put together?

correct.
regards
angela


RE: JCR Webdav Server -1.4.1 -Exception found

Posted by Julio Castillo <jc...@edgenuity.com>.
Angela,
While trying to run the JCR Webdav client I got an exception (see stack
trace below). My test program (again modeled after the RepositoryHelper that
uses jcr2spi/JCR2SPIRepositoryStub.java) does in summary the following:
	session = helper.getSuperuserSession();
	root = session.getRootNode();

I get the exception while attempting to get the root node. I get several
exceptions on the server side, but those are different from the exception I
get on the client side.

Using the latest RepositoryServiceImpl file I get the Null pointer exception
because the DavPropertySet.map variable contains only the following entries
in the map:
"{http://www.day.com/jcr/webdav/1.0}path"
"{DAV:}resourcetype"
"{http://www.day.com/jcr/webdav/1.0}parent"

And the code is looking for the following key:
"{http://www.day.com/jcr/webdav/1.0}name"

Of course this is not in the DavPropertySet.map and when trying to
dereference it in URIResolverImpl.buildPropertyId:201 I get a null pointer
exception while attempting to getValue from a null value. Should I create
bug report?

Exception in thread "main" java.lang.NullPointerException
	at
org.apache.jackrabbit.spi2dav.URIResolverImpl.buildPropertyId(URIResolverImp
l.java:201)
	at
org.apache.jackrabbit.spi2dav.RepositoryServiceImpl.getNodeInfo(RepositorySe
rviceImpl.java:808)
	at
org.apache.jackrabbit.spi2dav.RepositoryServiceImpl.getItemInfos(RepositoryS
erviceImpl.java:834)
	at
org.apache.jackrabbit.jcr2spi.state.WorkspaceItemStateFactory.createNodeStat
e(WorkspaceItemStateFactory.java:88)
	at
org.apache.jackrabbit.jcr2spi.state.TransientISFactory.createNodeState(Trans
ientISFactory.java:99)
	at
org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntryImpl.doResolve(NodeEntryImp
l.java:959)
	at
org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntryImpl.resolve(Hierarchy
EntryImpl.java:95)
	at
org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntryImpl.getItemState(Hier
archyEntryImpl.java:212)
	at
org.apache.jackrabbit.jcr2spi.ItemManagerImpl.getItem(ItemManagerImpl.java:1
57)
	at
org.apache.jackrabbit.jcr2spi.SessionImpl.getRootNode(SessionImpl.java:225)
	at
com.edgenuity.contentMgmt.test.RepositoryTest.main(RepositoryTest.java:193)

General question. The Stub in effect simulates a repository? The Node,
Session and other objects appear to be real objects on the client side?


Exception/trace on the server side in response to the requests above:

26.04.2008 17:38:20 *INFO * JCRWebdavServer: login: User 'admin' logged in.
(JCRWebdavServer.java, line 188)
26.04.2008 17:38:20 *INFO * JCRWebdavServer: Removed reference
org.apache.jackrabbit.webdav.WebdavRequestImpl@56d6cf to session
org.apache.jackrabbit.server.jcr.JCRWebdavServer$DavSessionImpl@1662250
(JCRWebdavServer.java, line 222)
26.04.2008 17:38:20 *INFO * JCRWebdavServer: No more references present on
webdav session -> clean up. (JCRWebdavServer.java, line 228)
26.04.2008 17:38:20 *INFO * JCRWebdavServer: Login: User 'admin' logged out
(JCRWebdavServer.java, line 234)
26.04.2008 17:38:47 *DEBUG* IfHeader: IfHeader: No If header in request
(IfHeader.java, line 247)
26.04.2008 17:38:47 *DEBUG* IfHeader: IfHeader: No If header in request
(IfHeader.java, line 247)
26.04.2008 17:38:47 *DEBUG* MLRUItemStateCache:
org.apache.jackrabbit.core.state.MLRUItemStateCache@e9c592 size=1,
664/4194304 (MLRUItemStateCache.java, line 148)
26.04.2008 17:38:47 *INFO * JCRWebdavServer: login: User 'admin' logged in.
(JCRWebdavServer.java, line 188)
26.04.2008 17:38:47 *DEBUG* MLRUItemStateCache:
org.apache.jackrabbit.core.state.MLRUItemStateCache@18ec029 size=1,
4864/4194304 (MLRUItemStateCache.java, line 148)
26.04.2008 17:38:47 *DEBUG* ItemManager: created item
cafebabe-cafe-babe-cafe-babecafebabe (ItemManager.java, line 750)
26.04.2008 17:38:47 *DEBUG* ItemManager: caching item
cafebabe-cafe-babe-cafe-babecafebabe (ItemManager.java, line 689)
26.04.2008 17:38:48 *DEBUG* NodeImpl: Unable to perform versioning operation
on non versionable node: / (NodeImpl.java, line 3214)
26.04.2008 17:38:48 *DEBUG* DavException: DavException: (501) Unable to
perform versioning operation on non versionable node: / (DavException.java,
line 101)
26.04.2008 17:38:48 *DEBUG* JcrDavException: Handling exception with error
code 501 (JcrDavException.java, line 98)
javax.jcr.UnsupportedRepositoryOperationException: Unable to perform
versioning operation on non versionable node: /
        at
org.apache.jackrabbit.core.NodeImpl.checkVersionable(NodeImpl.java:3215)
        at
org.apache.jackrabbit.core.NodeImpl.getVersionHistory(NodeImpl.java:3177)
        at
org.apache.jackrabbit.webdav.jcr.VersionControlledItemCollection.getVersionH
istory(VersionControlledItemCollection.java:486)
        at
org.apache.jackrabbit.webdav.jcr.DavResourceFactoryImpl.isVersionControlled(
DavResourceFactoryImpl.java:220)
        at
org.apache.jackrabbit.webdav.jcr.DavResourceFactoryImpl.createResource(DavRe
sourceFactoryImpl.java:104)
        at
org.apache.jackrabbit.webdav.server.AbstractWebdavServlet.service(AbstractWe
bdavServlet.java:187)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:290)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:206)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:233)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:175)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128
)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102
)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:109)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
        at
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:
856)
        at
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(H
ttp11AprProtocol.java:565)
        at
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1509)
        at java.lang.Thread.run(Thread.java:619)
26.04.2008 17:38:48 *DEBUG* DavResourceFactoryImpl: Resource
'http://localhost:2455/jackrabbit/server/default/jcr%3aroot/' is not
version-controlled. (DavResourceFactoryImpl.java, line 222)
26.04.2008 17:38:48 *DEBUG* AbstractItemResource:
http://localhost:2455/jackrabbit/server/default/ (AbstractItemResource.java,
line 391)
26.04.2008 17:38:48 *DEBUG* AbstractItemResource:
javax.jcr.PathNotFoundException: no such ancestor path of degree 1
(AbstractItemResource.java, line 371)
26.04.2008 17:38:48 *DEBUG* DefaultItemCollection: No primary item present
on this node '/default/jcr:root' (DefaultItemCollection.java, line 872)


-----Original Message-----
From: Julio Castillo [mailto:jcastillo@edgenuity.com] 
Sent: Thursday, April 24, 2008 3:04 PM
To: 'users@jackrabbit.apache.org'
Subject: RE: JCR Webdav Server -1.4.1 -looking for a client

Angela,
I tried to put together a JCR WebDav client from various test programs in
the sources. I enabled in the jackrabbit's web.xml the init-parm entries
under JCRWebdavServlet (missing-auth-mapping and authenticate-header).
I picked up a the file repositoryStubImpl.properties and made the following
modification:
javax.jcr.tck.repository_stub_impl=com.myCompany.contentMgmt.stub.JCR2SPIRep
ositoryStub
org.apache.jackrabbit.jcr2spi.repository.url=http://localhost:2455/jackrabbi
t/server/

Where the JCR2SPIRepositoryStub is a ported module based on
org/apache/jackrabbit/jcr2spi/JCR2SPIRepositoryStub.java

My starting point was the following file:
 org/apache/jackrabbit/test/RepositoryHelper.java

As I single step through it, the following file has a relevant role in the
process:
 org/apache/jackrabbit/jcr2spi/RepositoryImpl.java

The problems (actually warnings). The current settings for authentication
generates the following warnings while trying to get execute the
JCR2SPIRepositoryStub.getRepository() method.
"0     [main] WARN  org.apache.commons.httpclient.HttpMethodDirector  -
Required credentials not available for BASIC <any realm>@localhost:2455"
"39125 [main] WARN  org.apache.commons.httpclient.HttpMethodDirector  -
Preemptive authentication requested but no default credentials available"

On the server side I get the fact that "anonymous" logs in and out.
Any idea what exactly the warning messages refer to? Or how to address them?

Thanks

** julio


Re: JCR Webdav Server -1.4.1 -looking for a client

Posted by Angela Schreiber <an...@day.com>.
hi julio

> 1) When you say, "make sure your jcr2spi is started with spi2dav", where
> exactly is this configured? 

see o.a.j.jcr2spi.config.RepositoryConfig#getRepositoryService

> Are you talking on the servlet side? 

no. the client.

> Or are you
> talking of whatever package I put together for the client side?

yes. if you want to use JCR2SPI you have to define, which
SPI implementation should be used.

> 2) Related to the above question. I did find several references to the
> repositoryStubImpl.properties file in the main trunk and sandbox directory.

yes... that's a bit confusing. the following are present to my
knowledge:
- jackrabbit-core -> run tests for jackrabbit-core
- jackrabbit-jcr2spi -> run test for jcr2spi (by default with spi2jcr)
- sandbox -> that's mainly a leftover from the times where jcr2spi was
              in the sandbox.

if you want to use jcr2spi with some spi impl, you can focus
on the properties present with jcr2spi. if you want to run your
custom spi implementation you have to add a corresponding entry.

> Somehow I have to make sure that is read by the client package that I put
> together?

correct.
regards
angela

RE: JCR Webdav Server -1.4.1 -looking for a client

Posted by ja...@indiatimes.com.
Hi,

I want to know how to configure jcr-explorer to view the containe of repository.
Errror:-JNDI lookup not in this context.



RE: JCR Webdav Server -1.4.1 -looking for a client

Posted by Julio Castillo <jc...@edgenuity.com>.
Thank you Angela,
I have a couple of questions regarding your last statement:

"if you have jcr2spi configured to use the spi2dav SPI implementation, you
must make sure you have the corresponding webdav server running. spi2dav is
still part of the client side.

steps to go there:
- deploy the JCRWebdavServerServlet (part of the jackrabbit webapp)
- make sure your jcr2spi is started with spi2dav
- configuration properties of spi2dav are (see
repositoryStubImpl.properties):
   > location of the server
   > default workspace name"

1) When you say, "make sure your jcr2spi is started with spi2dav", where
exactly is this configured? Are you talking on the servlet side? Or are you
talking of whatever package I put together for the client side?

2) Related to the above question. I did find several references to the
repositoryStubImpl.properties file in the main trunk and sandbox directory.
Somehow I have to make sure that is read by the client package that I put
together?

Thanks for your feedback

Julio Castillo 

-----Original Message-----
From: Angela Schreiber [mailto:anchela@day.com] 
Sent: Wednesday, March 19, 2008 1:13 AM
To: users@jackrabbit.apache.org
Subject: Re: JCR Webdav Server -1.4.1 -looking for a client

hi julio

> What does it actually mean to use this servlet 
> (JCRWebdavServerServlet) to "remote JCR170 calls"?

it means, that you have a JCR client that communicates with the persistent
layer (server) using the webdav protocol.

> Does it mean that the WebDav interface was "extended" to support 
> specific JCR calls?

the JCR API maps pretty well (and surprisingly natural) to WebDAV. there
were only a couple of areas that were are not covered by any of the WebDAV
RFCs. This includes:

- observation
   -> extension
- clone
   -> unresolved
- series of transient modifications (everything between
   2 Session.save() calls).
   -> custom Lock type/scope.

the mapping is described in
http://jackrabbit.apache.org/JCR_Webdav_Protocol.doc

> Per the online documentation a corresponding JCR client refers to the 
> "JCR to SPI" and "SPI to WebDAV" in the sandbox. I found the 
> following: a package
> called: jackrabbit-jcr2spi/* on the regular release and spi2dav/* on 
> the sandbox.

that's it. jcr2spi represents the JCR API and it requires an SPI
implementation. spi2dav is one example.

> Any preference on either approach? 
> How do I bootstrap a client?

which approach? you lost me here... sorry.

> On a brief look at the spi2dav files I believe this is the path to follow:
> Instantiate a copy of JCR2SPIRepositoryStub which in turn will 
> instantiate a copy of RepositoryServiceImpl.
> The starting point for my code would then start with the 
> JCR2SPIRepositoryStub.

> I couldn't not find a starting point however with just the code in the 
> main trunk within the jackrabbit-jcr2spi/*. Any ideas?

if you have jcr2spi configured to use the spi2dav SPI implementation, you
must make sure you have the corresponding webdav server running. spi2dav is
still part of the client side.

steps to go there:
- deploy the JCRWebdavServerServlet (by default its
   part of the jackrabbit webapp).
- make sure your jcr2spi is started with spi2dav
- configuration properties of spi2dav are (see
   repositoryStubImpl.properties):
   > location of the server
   > default workspace name

hope that helps
regards
angela

> Julio Castillo


Re: JCR Webdav Server -1.4.1 -looking for a client

Posted by Angela Schreiber <an...@day.com>.
hi julio

> What does it actually mean to use this servlet (JCRWebdavServerServlet) to
> "remote JCR170 calls"?

it means, that you have a JCR client that communicates
with the persistent layer (server) using the webdav
protocol.

> Does it mean that the WebDav interface was "extended" to support specific
> JCR calls?

the JCR API maps pretty well (and surprisingly natural)
to WebDAV. there were only a couple of areas that were
are not covered by any of the WebDAV RFCs. This includes:

- observation
   -> extension
- clone
   -> unresolved
- series of transient modifications (everything between
   2 Session.save() calls).
   -> custom Lock type/scope.

the mapping is described in 
http://jackrabbit.apache.org/JCR_Webdav_Protocol.doc

> Per the online documentation a corresponding JCR client refers to the "JCR
> to SPI" and "SPI to WebDAV" in the sandbox. I found the following: a package
> called: jackrabbit-jcr2spi/* on the regular release and spi2dav/* on the
> sandbox.

that's it. jcr2spi represents the JCR API and it requires
an SPI implementation. spi2dav is one example.

> Any preference on either approach? 
> How do I bootstrap a client?

which approach? you lost me here... sorry.

> On a brief look at the spi2dav files I believe this is the path to follow:
> Instantiate a copy of JCR2SPIRepositoryStub which in turn will instantiate a
> copy of RepositoryServiceImpl.
> The starting point for my code would then start with the
> JCR2SPIRepositoryStub.

> I couldn't not find a starting point however with just the code in the main
> trunk within the jackrabbit-jcr2spi/*. Any ideas?

if you have jcr2spi configured to use the spi2dav
SPI implementation, you must make sure you have the
corresponding webdav server running. spi2dav is still part
of the client side.

steps to go there:
- deploy the JCRWebdavServerServlet (by default its
   part of the jackrabbit webapp).
- make sure your jcr2spi is started with spi2dav
- configuration properties of spi2dav are (see
   repositoryStubImpl.properties):
   > location of the server
   > default workspace name

hope that helps
regards
angela

> Julio Castillo
> Edgenuity Inc.
> 
>