What you probably want is to have the repository (of which there should be only one instance in your server) handled by Spring and provide access to it via the webdav servlets. The "repository" bean gives you a single repository already. Now you should turn of the RepositoryStartupServlet, which tries to start another repository (all the servlets in your current config have no knowledge about the Spring config) with the same settings (repository.xml and home directory). To access the repository created by Spring, you can put the the repository instance returned from the RepositoryFactoryBean "repository" into the servlet context attribute "javax.jcr.Repository". This way the RepositoryAccessServlet finds them (you can configure the name of the context attribute in the servlet config for this servlet).
Regards, Alex On Thu, Jul 31, 2008 at 1:36 AM, Martin Pietsch <[EMAIL PROTECTED]> wrote: > Hi, > > i am using Appfuse (Spring 2.5) and tried to set up a Jackrabbit > repository which should be available as a bean in the > applicationContext. I used springmodules and the following configuration > in the applicationContext.xml: > > <bean id="repository" > class="org.springmodules.jcr.jackrabbit.RepositoryFactoryBean"> > <property name="configuration" value="/WEB-INF/repository.xml" /> > <property name="homeDir" value="/tmp/repo"/> </bean> > > <bean id="jcrSessionFactory" > class="org.springmodules.jcr.jackrabbit.JackrabbitSessionFactory"> > <property name="repository" ref="repository" /> </bean> > > <bean id="jcrTemplate" class="org.springmodules.jcr.JcrTemplate"> > <property name="sessionFactory" ref="jcrSessionFactory" /> <property > name="allowCreate" value="true" /> </bean> > > Exactly the same repository should be available via WebDAV to store > files on it. Thus I tried to set up the Jackrabbit WebDavServlet > (web.xml) without success. It just gives me an empty page but no error > messages / exceptions. Thus it seems not to be connected to the > repository. I think my repository.xml is OK so far because I am able to > store data in the repository via the bean. > > Has anyone configuration suggestions for that purpose? On the web I've > found examples for Spring integration as well as for WebDAV access, but > not for both of them working together. > > I know the description of my error is vague, but I think my concern is > clear. > > Find below the relevant part of the web.xml. > > Thanks in advance, > > Martin > > > > <!-- W E B D A V S E R V L E T --> > > <servlet> <servlet-name>Webdav</servlet-name> > > <servlet-class>org.apache.jackrabbit.j2ee.SimpleWebdavServlet</servlet- > class> > > <init-param> <param-name>resource-path-prefix</param-name> > <param-value>/repository</param-value> </init-param> > > <init-param> <param-name>missing-auth-mapping</param-name> > <param-value>anonymous:anonymous</param-value> </init-param> > > <init-param> <param-name>resource-config</param-name> > <param-value>/WEB-INF/webdav-config.xml</param-value> </init-param> > <load-on-startup>4</load-on-startup> </servlet> > > <!-- R E P O S I T O R Y S T A R T U P S E R V L E T --> > > <servlet> <servlet-name>RepositoryStartup</servlet-name> > > <servlet-class>org.apache.jackrabbit.j2ee.RepositoryStartupServlet</ > servlet-class> > > <init-param> <param-name>repository-config</param-name> > <param-value>/WEB-INF/repository.xml</param-value> </init-param> > > <load-on-startup>2</load-on-startup> </servlet> > > <!-- R E P O S I T O R Y S E R V L E T --> > > <servlet> <servlet-name>Repository</servlet-name> > > <servlet-class>org.apache.jackrabbit.j2ee.RepositoryAccessServlet</ > servlet-class> > > <init-param> <param-name>repository.context.attribute.name</param-name> > <param-value>javax.jcr.Repository</param-value> </init-param> > > <load-on-startup>3</load-on-startup> </servlet> > > <!-- W E B D A V S E R V E R S E R V L E T --> > > <servlet> <servlet-name>JCRWebdavServer</servlet-name> > > <servlet-class>org.apache.jackrabbit.j2ee.JCRWebdavServerServlet</ > servlet-class> > > <init-param> <param-name>resource-path-prefix</param-name> > <param-value>/server</param-value> </init-param> > <load-on-startup>5</load-on-startup> </servlet> > > <!-- R M I B I N D I N G S E R V L E T --> > > <servlet> <servlet-name>RMI</servlet-name> > > <servlet-class>org.apache.jackrabbit.servlet.remote.RemoteBindingServlet > </servlet-class> </servlet> > > <servlet-mapping> <servlet-name>dwr-invoker</servlet-name> > <url-pattern>/dwr/*</url-pattern> </servlet-mapping> > > <servlet-mapping> <servlet-name>xfire</servlet-name> > <url-pattern>/services/*</url-pattern> </servlet-mapping> > > <!-- S E R V L E T M A P P I N G --> > > <servlet-mapping> <servlet-name>Webdav</servlet-name> > <url-pattern>/repository/*</url-pattern> </servlet-mapping> > <servlet-mapping> <servlet-name>JCRWebdavServer</servlet-name> > <url-pattern>/server/*</url-pattern> </servlet-mapping> > <servlet-mapping> <servlet-name>RMI</servlet-name> > <url-pattern>/rmi</url-pattern> </servlet-mapping> > > > > > > > > -- Alexander Klimetschek [EMAIL PROTECTED]
