2 Replies Latest reply on Apr 6, 2016 5:03 AM by zcc39r

    WebDAV: unable to move zero-length file when using Oracle binary store

    zcc39r

      Having WildFly 8.2.0, ModeShape 4.6.0, altered sample repository definition:

      <repository name="sample" anonymous-roles="admin">
          <db-binary-storage data-source-jndi-name="java:jboss/datasources/mdsp"/>
      </repository>
      
      
      

       

      with datasource defined as:

      <datasource jta="false" jndi-name="java:jboss/datasources/mdsp" pool-name="mdsp" enabled="true" use-ccm="false">
          <connection-url>jdbc:oracle:thin:@host:1521/MDSP</connection-url>
          <driver-class>oracle.jdbc.OracleDriver</driver-class>
          <driver>ojdbc6.jar</driver>
          <security>
              <user-name>user</user-name>
              <password>password</password>
          </security>
          <validation>
              <validate-on-match>false</validate-on-match>
              <background-validation>false</background-validation>
          </validation>
          <statement>
              <share-prepared-statements>false</share-prepared-statements>
          </statement>
      </datasource>
      
      
      

       

      created zero-length file in the repository via WebDAV, I'm unable to rename it:

      2016-04-05 10:19:31,662 ERROR [io.undertow.request] (default task-50) UT005023: Exception handling request to /modeshape-webdav/sample/default/a: javax.servlet.ServletException: org.modeshape.webdav

      .exceptions.WebdavException

              at org.modeshape.webdav.WebDavServletBean.service(WebDavServletBean.java:209) [modeshape-webdav-4.6.0.Final.jar:4.6.0.Final]

              at org.modeshape.web.jcr.webdav.ModeShapeWebdavServlet.service(ModeShapeWebdavServlet.java:121) [modeshape-web-jcr-webdav-4.6.0.Final.jar:4.6.0.Final]

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]

              at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

              at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

              at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

              at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

              at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

              at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

              at io.undertow.server.handlers.DisableCacheHandler.handleRequest(DisableCacheHandler.java:33) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

              at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:51) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

              at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

              at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:63) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

              at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:56) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

              at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

              at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

              at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

              at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

              at io.undertow.servlet.handlers.SessionRestoringHandler.handleRequest(SessionRestoringHandler.java:119) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

              at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:261) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

              at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:247) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

              at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:76) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

              at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:166) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]

              at io.undertow.server.Connectors.executeRootHandler(Connectors.java:197) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

              at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:759) [undertow-core-1.1.0.Final.jar:1.1.0.Final]

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_80]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_80]

              at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_80]

      Caused by: org.modeshape.webdav.exceptions.WebdavException

              at org.modeshape.web.jcr.webdav.ModeShapeWebdavServlet.translateError(ModeShapeWebdavServlet.java:146) [modeshape-web-jcr-webdav-4.6.0.Final.jar:4.6.0.Final]

              at org.modeshape.web.jcr.webdav.ModeShapeWebdavServlet.translate(ModeShapeWebdavServlet.java:129) [modeshape-web-jcr-webdav-4.6.0.Final.jar:4.6.0.Final]

              at org.modeshape.webdav.WebDavServletBean.service(WebDavServletBean.java:197) [modeshape-webdav-4.6.0.Final.jar:4.6.0.Final]

              ... 32 more

      Caused by: java.lang.NullPointerException

              at org.modeshape.jcr.value.binary.Database$DatabaseBinaryStream.read(Database.java:537) [modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]

              at org.modeshape.common.util.SelfClosingInputStream.read(SelfClosingInputStream.java:111) [modeshape-common-4.6.0.Final.jar:4.6.0.Final]

              at org.modeshape.common.util.SecureHash$HashingInputStream.read(SecureHash.java:380) [modeshape-common-4.6.0.Final.jar:4.6.0.Final]

              at org.modeshape.common.util.IoUtil.write(IoUtil.java:331) [modeshape-common-4.6.0.Final.jar:4.6.0.Final]

              at org.modeshape.jcr.value.binary.FileSystemBinaryStore.storeValue(FileSystemBinaryStore.java:109) [modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]

              at org.modeshape.jcr.value.binary.DatabaseBinaryStore.storeValue(DatabaseBinaryStore.java:171) [modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]

              at org.modeshape.jcr.value.binary.BinaryStoreValueFactory.create(BinaryStoreValueFactory.java:244) [modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]

              at org.modeshape.jcr.value.binary.BinaryStoreValueFactory.create(BinaryStoreValueFactory.java:49) [modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]

              at org.modeshape.jcr.JcrValueFactory.createBinary(JcrValueFactory.java:141) [modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]

              at org.modeshape.jcr.JcrValueFactory.createBinary(JcrValueFactory.java:41) [modeshape-jcr-4.6.0.Final.jar:4.6.0.Final]

              at org.modeshape.web.jcr.webdav.DefaultContentMapper.setContent(DefaultContentMapper.java:203) [modeshape-web-jcr-webdav-4.6.0.Final.jar:4.6.0.Final]

              at org.modeshape.web.jcr.webdav.ModeShapeWebdavStore.setResourceContent(ModeShapeWebdavStore.java:446) [modeshape-web-jcr-webdav-4.6.0.Final.jar:4.6.0.Final]

              at org.modeshape.webdav.methods.DoCopy.copy(DoCopy.java:227) [modeshape-webdav-4.6.0.Final.jar:4.6.0.Final]

              at org.modeshape.webdav.methods.DoCopy.copyResource(DoCopy.java:173) [modeshape-webdav-4.6.0.Final.jar:4.6.0.Final]

              at org.modeshape.webdav.methods.DoMove.execute(DoMove.java:79) [modeshape-webdav-4.6.0.Final.jar:4.6.0.Final]

              at org.modeshape.webdav.WebDavServletBean.service(WebDavServletBean.java:157) [modeshape-webdav-4.6.0.Final.jar:4.6.0.Final]

              ... 32 more

       

      This problem does not affect repositories  with non-database binary store as well as with Mysql-based binary store.

      So may be I missed something with Oracle datasource config?