Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-2369

Setting a STRING property longer than "min-string-size" fails when using InfinispanBinaryStore

    XMLWordPrintable

Details

    Description

      Setting a STRING property with a length of 4096+ characters (i.e. "min-string-size") generates an error:

      2014-11-19 16:14:10,570 ERROR [org.modeshape.web.jcr.rest.ModeShapeExceptionMapper] (default task-13) Server error: javax.jcr.RepositoryException: org.modeshape.jcr.value.ValueFormatException: Error converting "[117, 114, (xxx), 49, 50, 51]" from byte[] to a BinaryValue
      	at org.modeshape.jcr.JcrSession.save(JcrSession.java:1184) [modeshape-jcr-4.0.0.Final.jar:4.0.0.Final]
      	at org.modeshape.web.jcr.rest.handler.RestItemHandler.addItem(RestItemHandler.java:101) [modeshape-web-jcr-rest-4.0.0.Final.jar:4.0.0.Final]
      	at org.modeshape.web.jcr.rest.ModeShapeRestService.postItem(ModeShapeRestService.java:331) [modeshape-web-jcr-rest-4.0.0.Final.jar:4.0.0.Final]
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_65]
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_65]
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_65]
      	at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_65]
      	at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:137) [resteasy-jaxrs-3.0.8.Final.jar:]
      	at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:296) [resteasy-jaxrs-3.0.8.Final.jar:]
      	at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:250) [resteasy-jaxrs-3.0.8.Final.jar:]
      	at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:237) [resteasy-jaxrs-3.0.8.Final.jar:]
      	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356) [resteasy-jaxrs-3.0.8.Final.jar:]
      	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:179) [resteasy-jaxrs-3.0.8.Final.jar:]
      	at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:220) [resteasy-jaxrs-3.0.8.Final.jar:]
      	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56) [resteasy-jaxrs-3.0.8.Final.jar:]
      	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51) [resteasy-jaxrs-3.0.8.Final.jar:]
      	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.0.15.Final.jar:1.0.15.Final]
      	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
      	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
      	at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
      	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
      	at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
      	at io.undertow.server.handlers.DisableCacheHandler.handleRequest(DisableCacheHandler.java:27) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
      	at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:51) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
      	at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
      	at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
      	at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:56) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
      	at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
      	at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
      	at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
      	at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
      	at org.wildfly.mod_cluster.undertow.metric.RunningRequestsHttpHandler.handleRequest(RunningRequestsHttpHandler.java:68)
      	at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
      	at io.undertow.servlet.handlers.SessionRestoringHandler.handleRequest(SessionRestoringHandler.java:101) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
      	at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
      	at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
      	at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
      	at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
      	at io.undertow.server.Connectors.executeRootHandler(Connectors.java:177) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
      	at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:727) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_65]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_65]
      	at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_65]
      Caused by: org.modeshape.jcr.value.ValueFormatException: Error converting "[117, 114, (xxx), 49, 50, 51]" from byte[] to a BinaryValue
      	at org.modeshape.jcr.value.binary.BinaryStoreValueFactory.create(BinaryStoreValueFactory.java:232) [modeshape-jcr-4.0.0.Final.jar:4.0.0.Final]
      	at org.modeshape.jcr.value.binary.BinaryStoreValueFactory.create(BinaryStoreValueFactory.java:104) [modeshape-jcr-4.0.0.Final.jar:4.0.0.Final]
      	at org.modeshape.jcr.value.binary.BinaryStoreValueFactory.create(BinaryStoreValueFactory.java:49) [modeshape-jcr-4.0.0.Final.jar:4.0.0.Final]
      	at org.modeshape.jcr.cache.document.DocumentTranslator.valueToDocument(DocumentTranslator.java:1123) [modeshape-jcr-4.0.0.Final.jar:4.0.0.Final]
      	at org.modeshape.jcr.cache.document.DocumentTranslator.setProperty(DocumentTranslator.java:422) [modeshape-jcr-4.0.0.Final.jar:4.0.0.Final]
      	at org.modeshape.jcr.cache.document.WritableSessionCache.persistChanges(WritableSessionCache.java:1032) [modeshape-jcr-4.0.0.Final.jar:4.0.0.Final]
      	at org.modeshape.jcr.cache.document.WritableSessionCache.save(WritableSessionCache.java:596) [modeshape-jcr-4.0.0.Final.jar:4.0.0.Final]
      	at org.modeshape.jcr.JcrSession.save(JcrSession.java:1165) [modeshape-jcr-4.0.0.Final.jar:4.0.0.Final]
      	... 47 more
      Caused by: org.modeshape.jcr.value.binary.BinaryStoreException: Error at storing of binary value: aa7a5f7ba94ce08cc34fa9af94d1fccac3102d4b
      	at org.modeshape.jcr.value.binary.infinispan.InfinispanBinaryStore$LockFactory$ISPNLock.<init>(InfinispanBinaryStore.java:690) [modeshape-jcr-4.0.0.Final.jar:4.0.0.Final]
      	at org.modeshape.jcr.value.binary.infinispan.InfinispanBinaryStore$LockFactory.writeLock(InfinispanBinaryStore.java:652) [modeshape-jcr-4.0.0.Final.jar:4.0.0.Final]
      	at org.modeshape.jcr.value.binary.infinispan.InfinispanBinaryStore.storeValue(InfinispanBinaryStore.java:252) [modeshape-jcr-4.0.0.Final.jar:4.0.0.Final]
      	at org.modeshape.jcr.value.binary.BinaryStoreValueFactory.create(BinaryStoreValueFactory.java:230) [modeshape-jcr-4.0.0.Final.jar:4.0.0.Final]
      	... 54 more
      Caused by: javax.transaction.NotSupportedException: BaseTransaction.checkTransactionState - ARJUNA016051: thread is already associated with a transaction!
      	at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.begin(BaseTransaction.java:72)
      	at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.begin(BaseTransactionManagerDelegate.java:65)
      	at org.modeshape.jcr.value.binary.infinispan.InfinispanBinaryStore$LockFactory$ISPNLock.<init>(InfinispanBinaryStore.java:682) [modeshape-jcr-4.0.0.Final.jar:4.0.0.Final]
      	... 57 more
      Caused by: java.lang.IllegalStateException: BaseTransaction.checkTransactionState - ARJUNA016051: thread is already associated with a transaction!
      	at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.checkTransactionState(BaseTransaction.java:262)
      	at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.begin(BaseTransaction.java:68)
      	... 59 more
      

      The message is quite verbose (all bytes are individually shown) so it might be a good idea to fix that by the way.

      I could trigger the error using either modeshape-explorer or modeshape-rest, e.g.:

      curl -u admin:admin -H "Content-Type: application/json" -d @payload.json "http://172.17.0.59:8080/modeshape-rest/acme/default/items/acme:node"
      

      Attachments

        Activity

          People

            hchiorean Horia Chiorean (Inactive)
            dalbani Damiano Albani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: