You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by amsmota <am...@gmail.com> on 2008/04/29 11:50:49 UTC

SimpleWevdavServlet with Spring DispatcherServlet/ServletWrappingController

Hello:

I'm trying unsuccessfully for 3 days now to put up a test case for
Jackrabbit and my boss just told me to kill the project if I can't solve
this today. Which of course I don't want to do (kill the project, not solve
the thing :)

What I'm trying to do is using SimpleWevdavServlet wrapped in a
DispatcherServlet/ServletWrappingController, "injecting" a bean configured
repository in my SimpleWevdavServlet using the Spring WebApplicationContext.
But whatever I do I allways get

<D:error>
   <dcr:exception>
      <dcr:class>javax.jcr.NoSuchWorkspaceException</dcr:class>
      <dcr:message>jackrabbit</dcr:message>
   </dcr:exception>
</D:error>

Basically what I have is:

	<bean id="strutsWrappingController"
		class="org.springframework.web.servlet.mvc.ServletWrappingController">
		<property name="servletClass">
			<value>com.meridianp2p.stf.kb.jcr.webdav.JcrConnector</value>
		</property>
		<property name="initParameters">
			<props>
				<prop key="resource-path-prefix">/repotest</prop>
				<prop key="resource-config">/WEB-INF/config.xml</prop>
				<prop key="missing-auth-mapping">anonymous:anonymous</prop>
				<prop key="authenticate-header">Basic realm="Jackrabbit Webdav
Server"</prop>
			</props>			
		</property>		
	</bean>

and

	<bean id="repository"
		class="org.springmodules.jcr.jackrabbit.RepositoryFactoryBean">
		<property name="configuration" value="WEB-INF/jackrabbit.xml"/>
		<property name="homeDir" value="repo2"/>
	</bean>

and in my extended SimpleWevdavServlet

	public void init(ServletConfig config) throws ServletException {
		super.init(config);
		final WebApplicationContext context = WebApplicationContextUtils
				.getWebApplicationContext(config.getServletContext());
		Repository repository = (Repository) context.getBean("repository");
		setRepository(repository);
	}

Can someone please help?

Thanks.
-- 
View this message in context: http://www.nabble.com/SimpleWevdavServlet-with-Spring-DispatcherServlet-ServletWrappingController-tp16957017p16957017.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: SimpleWevdavServlet with Spring DispatcherServlet/ServletWrappingController

Posted by amsmota <am...@gmail.com>.
I finally seem to get it... Look 
http://forum.springframework.org/showthread.php?p=178514#post178514 here 
:-D


amsmota wrote:
> 
> I  http://forum.springframework.org/showthread.php?p=178328#post178328
> posted in the other forum  about this problem between JackRabbit and
> Spring...
> 
> 
> 
> amsmota wrote:
>> 
>> 
>> 501 Method PROPFIND is not defined in RFC 2068 and is not supported by
>> the Servlet API
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/SimpleWevdavServlet-with-Spring-DispatcherServlet-ServletWrappingController-tp16957017p17020968.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: SimpleWevdavServlet with Spring DispatcherServlet/ServletWrappingController

Posted by amsmota <am...@gmail.com>.
I  http://forum.springframework.org/showthread.php?p=178328#post178328 posted
in the other forum  about this problem between JackRabbit and Spring...



amsmota wrote:
> 
> 
> 501 Method PROPFIND is not defined in RFC 2068 and is not supported by the
> Servlet API
> 
> 

-- 
View this message in context: http://www.nabble.com/SimpleWevdavServlet-with-Spring-DispatcherServlet-ServletWrappingController-tp16957017p16993311.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: SimpleWevdavServlet with Spring DispatcherServlet/ServletWrappingController

Posted by amsmota <am...@gmail.com>.
How I love this profession... After banging my head against 
http://forum.springframework.org/showthread.php?t=53472 several walls , I
finally have the OPTIONS getting through, but now I got this one from my
extended SimpleWebdavServlet:

501 Method PROPFIND is not defined in RFC 2068 and is not supported by the
Servlet API

which I can't understand, because if I tested a "unwrapped" version of my
extended SimpleWebdavServlet and it was working like a charm...

Any clues on that one?

Cheers.



amsmota wrote:
> 
> You are right. The OPTIONS is getting handled somewhere by Spring
> (Dispatcher or HandlerMapping or ServletWrappingController, one of then)
> and never reaches my extended SimpleWebdavServlet. Actually not even
> methods like PUT and DELETE get through.
> 
> So I think I'm bother the Spring guys now :wistle:.
> 
> 

-- 
View this message in context: http://www.nabble.com/SimpleWevdavServlet-with-Spring-DispatcherServlet-ServletWrappingController-tp16957017p16987994.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: SimpleWevdavServlet with Spring DispatcherServlet/ServletWrappingController

Posted by amsmota <am...@gmail.com>.
You are right. The OPTIONS is getting handled somewhere by Spring (Dispatcher
or HandlerMapping or ServletWrappingController, one of then) and never
reaches my extended SimpleWebdavServlet. Actually not even methods like PUT
and DELETE get through.

So I think I'm bother the Spring guys now :wistle:.

Many thanks for your rightful and prompt answers.


Angela Schreiber wrote:
> 
> 
> are you sure, the OPTIONS request is handled by the
> dav-servlet? the AbstractWebdavServlet adds the DAV/Allow
> header to every single OPTION response, as far as i know.
> 
> angela
> 
> 

-- 
View this message in context: http://www.nabble.com/SimpleWevdavServlet-with-Spring-DispatcherServlet-ServletWrappingController-tp16957017p16961252.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: SimpleWevdavServlet with Spring DispatcherServlet/ServletWrappingController

Posted by Angela Schreiber <an...@day.com>.
amsmota wrote:
> They aren't. I have no DAV header and I only got the 7 http methods in Allow. 
> I'm using JBoss 4.x and didn't configured nothing, maybe is that?

i'm not familiar with JBoss. sorry.

are you sure, the OPTIONS request is handled by the
dav-servlet? the AbstractWebdavServlet adds the DAV/Allow
header to every single OPTION response, as far as i know.

angela

Re: SimpleWevdavServlet with Spring DispatcherServlet/ServletWrappingController

Posted by amsmota <am...@gmail.com>.
They aren't. I have no DAV header and I only got the 7 http methods in Allow. 

I'm using JBoss 4.x and didn't configured nothing, maybe is that?

Thanks again.



Angela Schreiber wrote:
> 
> 
> without having the http conversation at hand, i suppose
> that you don't have a proper response upon the initial
> OPTIONS request from the DAV-client to your resource.
> 
> can you please check if the DAV header (value 1 or 1,2) and
> the Allow header (listing the various dav specific methods)
> are corrct in response to OPTIONS request?
> 
> regards
> angela
> 
> 

-- 
View this message in context: http://www.nabble.com/SimpleWevdavServlet-with-Spring-DispatcherServlet-ServletWrappingController-tp16957017p16958998.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: SimpleWevdavServlet with Spring DispatcherServlet/ServletWrappingController

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

> However I have another problem now. I can use the browser to do some GET's
> and I'm using RESTClient to do some POST's and it's OK. However I'm not
> capable of connecting using Web Folders, or DAVExplorer, for example
> DAVExplorer says "The server does not supoport DAV at resource
> /webdav/repotest/archive".

without having the http conversation at hand, i suppose
that you don't have a proper response upon the initial
OPTIONS request from the DAV-client to your resource.

can you please check if the DAV header (value 1 or 1,2) and
the Allow header (listing the various dav specific methods)
are corrct in response to OPTIONS request?

regards
angela

Re: SimpleWevdavServlet with Spring DispatcherServlet/ServletWrappingController

Posted by amsmota <am...@gmail.com>.
So nice, it's working now... It was probably more than one error, but one of
then was what you pointed out, I was not using context/repository/workspace,
only context/workspace ...

However I have another problem now. I can use the browser to do some GET's
and I'm using RESTClient to do some POST's and it's OK. However I'm not
capable of connecting using Web Folders, or DAVExplorer, for example
DAVExplorer says "The server does not supoport DAV at resource
/webdav/repotest/archive".

(I'm using http://localhost:8080/webdav/repotest/archive/)

I saw in this forum that other people already done that, but I found no
explanation how.

Many thanks for your help.




Angela Schreiber wrote:
> 
> hi
> 
> i'm not sure, if i understand what you try to achieve.
> but the exception you get
> 
>> <D:error>
>>    <dcr:exception>
>>       <dcr:class>javax.jcr.NoSuchWorkspaceException</dcr:class>
>>       <dcr:message>jackrabbit</dcr:message>
>>    </dcr:exception>
>> </D:error>
> 
> indicates that you probably try to access a workspace (or login
> with a workspace name) that does not exist in the JCR repository.
> 
> if i am not mistaken 'jackrabbit' is the context name in the
> default installation , which is the followed by a prefix (by
> default: 'repository') and finally the workspace name (by
> default: 'default')... this is the kind of href structure
> the simple dav servlet expects.
> 
> see also:
> o.a.j.webdav.server.AbstractWebdavServlet.java  line 182
> o.a.j.webdav.simple.DavSessionProviderImpl.java line 79
> 
> hope that helps
> angela
> 
> 

-- 
View this message in context: http://www.nabble.com/SimpleWevdavServlet-with-Spring-DispatcherServlet-ServletWrappingController-tp16957017p16958296.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Re: SimpleWevdavServlet with Spring DispatcherServlet/ServletWrappingController

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

i'm not sure, if i understand what you try to achieve.
but the exception you get

> <D:error>
>    <dcr:exception>
>       <dcr:class>javax.jcr.NoSuchWorkspaceException</dcr:class>
>       <dcr:message>jackrabbit</dcr:message>
>    </dcr:exception>
> </D:error>

indicates that you probably try to access a workspace (or login
with a workspace name) that does not exist in the JCR repository.

if i am not mistaken 'jackrabbit' is the context name in the
default installation , which is the followed by a prefix (by
default: 'repository') and finally the workspace name (by
default: 'default')... this is the kind of href structure
the simple dav servlet expects.

see also:
o.a.j.webdav.server.AbstractWebdavServlet.java  line 182
o.a.j.webdav.simple.DavSessionProviderImpl.java line 79

hope that helps
angela