WebDAV configuration error
thushanga Dec 6, 2011 8:22 AMHi All,
I am configuring WebDav for the first time.I build the WAR file and deployed in to tomcat7.
When i hit the url on browser i get the following error message.Please someone help me to solve this.
Thanks
Emil
Error message
1388 [http-apr-8080-exec-3] TRACE org.modeshape.repository.sequencer.SequencingService$Administrator - Starting "Sequencing Service" 1393 [http-apr-8080-exec-3] TRACE org.modeshape.repository.sequencer.SequencingService$Administrator - Started "Sequencing Service" 1395 [http-apr-8080-exec-3] TRACE org.modeshape.graph.connector.base.Connection - MapRepositoryConnection.execute(...) took 00:00:00.000,106 1401 [http-apr-8080-exec-3] TRACE org.modeshape.graph.connector.base.Connection - MapRepositoryConnection.execute(...) took 00:00:00.000,878 1407 [http-apr-8080-exec-3] TRACE org.modeshape.graph.connector.base.Connection - MapRepositoryConnection.execute(...) took 00:00:00.000,091 1413 [http-apr-8080-exec-3] TRACE org.modeshape.graph.connector.base.Connection - MapRepositoryConnection.execute(...) took 00:00:00.000,306 1415 [http-apr-8080-exec-3] TRACE org.modeshape.web.jcr.webdav.ModeShapeWebdavStore - WebDAV getStoredObject at "//gs-repository" 1416 [http-apr-8080-exec-3] DEBUG org.modeshape.web.jcr.webdav.ModeShapeWebdavStore - WebDAV getStoredObject at "//gs-repository" resolved to "//gs-repository/ " 1429 [http-apr-8080-exec-3] ERROR net.sf.webdav.WebDavServletBean - Exception: java.lang.IllegalArgumentException: The repositoryName argument may not be null or zero-length at org.modeshape.common.util.CheckArg.isNotZeroLength(CheckArg.java:356) at org.modeshape.common.util.CheckArg.isNotEmpty(CheckArg.java:369) at org.modeshape.jcr.JcrEngine.getRepository(JcrEngine.java:355) at org.modeshape.jcr.JcrEngine.getRepository(JcrEngine.java:91) at org.modeshape.web.jcr.spi.FactoryRepositoryProvider.getRepository(FactoryRepositoryProvider.java:71) at org.modeshape.web.jcr.spi.FactoryRepositoryProvider.getSession(FactoryRepositoryProvider.java:111) at org.modeshape.web.jcr.RepositoryFactory.getSession(RepositoryFactory.java:90) at org.modeshape.web.jcr.webdav.ModeShapeWebdavStore$JcrSessionTransaction.session(ModeShapeWebdavStore.java:563) at org.modeshape.web.jcr.webdav.ModeShapeWebdavStore$JcrSessionTransaction.nodeFor(ModeShapeWebdavStore.java:570) at org.modeshape.web.jcr.webdav.ModeShapeWebdavStore.nodeFor(ModeShapeWebdavStore.java:500) at org.modeshape.web.jcr.webdav.ModeShapeWebdavStore.getStoredObject(ModeShapeWebdavStore.java:321) at net.sf.webdav.methods.DoGet.folderBody(DoGet.java:141) at net.sf.webdav.methods.DoHead.execute(DoHead.java:153) at net.sf.webdav.WebDavServletBean.service(WebDavServletBean.java:129) at org.modeshape.web.jcr.webdav.ModeShapeWebdavServlet.service(ModeShapeWebdavServlet.java:125) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1824) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662)
WEB.XML
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <display-name>ModeShape JCR RESTful Interface</display-name> <!-- This parameter provides the fully-qualified name of a class that implements the o.m.web.jcr.spi.RepositoryProvider interface. It is required by the ModeShapeJcrDeployer that controls the lifecycle for the ModeShape WebDAV server. --> <context-param> <param-name>org.modeshape.web.jcr.REPOSITORY_PROVIDER</param-name> <param-value>org.modeshape.web.jcr.spi.FactoryRepositoryProvider</param-value> </context-param> <!-- This parameter, specific to the FactoryRepositoryProvider implementation, specifies the name of the configuration file to initialize the repository or repositories. This configuration file must be on the classpath and is given as a classpath-relative directory. --> <context-param> <param-name>org.modeshape.web.jcr.JCR_URL</param-name> <param-value>file:/modeshape-config.xml</param-value> </context-param> <!-- This parameter provides the fully-qualified name of a class that implements the o.m.w.jcr.webdav.ContentMapper interface. If no value is provided for this parameter, o.m.w.jcr.webdav.DefaultContentMapper will be used. --> <context-param> <param-name>org.modeshape.web.jcr.webdav.CONTENT_MAPPER_CLASS_NAME</param-name> <param-value>org.modeshape.web.jcr.webdav.DefaultContentMapper</param-value> </context-param> <!-- Nodes with any of the primary node types in this comma-delimited list will be treated by the WebDAV implementation as content nodes. The value below is the default value for this parameter. That is, if this init parameter is omitted, the value below will be used by default. --> <context-param> <param-name>org.modeshape.web.jcr.webdav.CONTENT_PRIMARY_TYPE_NAMES</param-name> <param-value>nt:resource, mode:resource</param-value> </context-param> <!-- Nodes with any of the primary node types in this comma-delimited list will be treated by the WebDAV implementation as resource (file) nodes. The value below is the default value for this parameter. That is, if this init parameter is omitted, the value below will be used by default. --> <context-param> <param-name>org.modeshape.web.jcr.webdav.RESOURCE_PRIMARY_TYPE_NAMES</param-name> <param-value>nt:file</param-value> </context-param> <!-- Each folder created through the WebDAV servlet will be created as a node with the primary node type below. The value below is the default value for this parameter. That is, if this init parameter is omitted, the value below will be used by default. --> <context-param> <param-name>org.modeshape.web.jcr.webdav.NEW_FOLDER_PRIMARY_TYPE_NAME</param-name> <param-value>nt:folder</param-value> </context-param> <!-- Each resource (file created through the WebDAV servlet will be created as a node with the primary node type below. The value below is the default value for this parameter. That is, if this init parameter is omitted, the value below will be used by default. --> <context-param> <param-name> org.modeshape.web.jcr.webdav.NEW_RESOURCE_PRIMARY_TYPE_NAME </param-name> <param-value>nt:file</param-value> </context-param> <!-- Content created through the WebDAV servlet will be created as a node with the primary node type below. The value below is the default value for this parameter. That is, if this init parameter is omitted, the value below will be used by default. --> <context-param> <param-name> org.modeshape.web.jcr.webdav.NEW_CONTENT_PRIMARY_TYPE_NAME </param-name> <param-value>nt:resource</param-value> </context-param> <!-- This optional parameter provides the name of the o.m.w.j.webdav.RequestResolver implementation class. The provided value must be the name of a class that implements the RequestResolver interface and has a public, no-arg constructor. If no value is provided, o.m.w.j.webdav.MultiRepositoryRequestResolver will be used. --> <context-param> <param-name>org.modeshape.web.jcr.webdav.REQUEST_RESOLVER_CLASS_NAME</param-name> <param-value>org.modeshape.web.jcr.webdav.MultiRepositoryRequestResolver</param-value> </context-param> <!-- Required parameter for ModeShape WebDAV - should not be modified --> <listener> <listener-class>org.modeshape.web.jcr.ModeShapeJcrDeployer</listener-class> </listener> <!-- Required WebDAV servlet - should not be modified --> <servlet> <servlet-name>WebDAV</servlet-name> <servlet-class>org.modeshape.web.jcr.webdav.ModeShapeWebdavServlet</servlet-class> <!-- The webdav library requires this parameter to be present, but does not use it. --> <init-param> <param-name>rootpath</param-name> <param-value>.</param-value> </init-param> </servlet> <!-- Required parameter for ModeShape WebDAV - should not be modified --> <servlet-mapping> <servlet-name>WebDAV</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping> <!-- The ModeShape WebDAV implementation leverages the HTTP credentials to for authentication and authorization within the JCR repository. Unless the repository provides for anonymous access, it makes no sense to try to log into the JCR repository without credentials, so this constraint helps lock down the repository. This should generally not be modified. --> <security-constraint> <display-name>ModeShape WebDAV</display-name> <web-resource-collection> <web-resource-name>WebDAV</web-resource-name> <url-pattern>/*</url-pattern> </web-resource-collection> <auth-constraint> <!-- A user must be assigned this role to connect to any JCR repository, in addition to needing the READONLY or READWRITE roles to actually read or modify the data. This is not used internally, so another role could be substituted here. --> <role-name>connect</role-name> </auth-constraint> </security-constraint> <!-- Any auth-method will work for ModeShape. BASIC is used this example for simplicity. --> <login-config> <auth-method>BASIC</auth-method> </login-config> <!-- This must match the role-name in the auth-constraint above. --> <security-role> <role-name>connect</role-name> </security-role> </web-app>
Repository Configuration File
<?xml version="1.0" encoding="UTF-8"?> <configuration xmlns:mode="http://www.modeshape.org/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"> <mode:repositories> <mode:repository jcr:name="gs-repository" mode:source="MyDB"> <mode:options jcr:primaryType="mode:options"> <mode:option jcr:name="jaasLoginConfigName" mode:value="modeshape-jcr" /> </mode:options> <mode:descriptors> <myDescriptor mode:value="foo" /> </mode:descriptors> </mode:repository> </mode:repositories> <mode:sources jcr:primaryType="nt:unstructured"> <mode:source jcr:name="MyDB" mode:classname="org.modeshape.connector.store.jpa.JpaSource" mode:model="Simple" mode:dialect="org.hibernate.dialect.MySQLDialect" mode:driverClassName="com.mysql.jdbc.Driver" mode:username="root" mode:password="root" mode:url="jdbc:mysql://localhost:3306/modeshape-db?autoReconnect=true" mode:maximumConnectionsInPool="1" mode:referentialIntegrityEnforced="true" mode:largeValueSizeInBytes="10000" mode:retryLimit="3" mode:compressData="false" mode:predefinedWorkspaceNames="workspace1" mode:showSql="true" mode:defaultWorkspaceName="workspace1" /> </mode:sources> <mode:mimeTypeDetectors> <mode:mimeTypeDetector jcr:name="Detector"> <mode:description>Standard extension-based MIME type detector </mode:description> <mode:classname>org.modeshape.graph.mimetype.ExtensionBasedMimeTypeDetector </mode:classname> <mode:classpath></mode:classpath> <mode:classpath></mode:classpath> </mode:mimeTypeDetector> </mode:mimeTypeDetectors> </configuration>