2 Replies Latest reply on Sep 29, 2014 3:21 AM by dalbani

    Can't set a STRING property more than 4096  bytes long

    dalbani Newbie

      Hello,

       

      To begin with, here's my environment: ModeShape 4.0.0.Beta1, storage on Infinispan, using a LevelDB backend.

       

      Here's the exception that I get when I set a value of 4096+ bytes to a STRING property:

       

      21:01:18,790 DEBUG [org.modeshape.jcr.value.binary.infinispan.InfinispanBinaryStore]  Binary value already exist.
      21:01:21,820 DEBUG [org.modeshape.jcr.value.binary.infinispan.InfinispanBinaryStore]  Store binary value into chunks.
      21:01:21,821 DEBUG [org.modeshape.jcr.value.binary.infinispan.ChunkOutputStream]  Close. Buffer size at close: 5127
      21:01:21,822 DEBUG [org.modeshape.jcr.value.binary.infinispan.ChunkOutputStream]  Store chunk 69b0c6dbf78e0eabaf558075f47f80c3debe5aad-data-0
      21:01:21,839 INFO [stdout] java.lang.ClassCastException: [B cannot be cast to [Ljava.lang.Object;
      21:01:21,839 INFO [stdout]  javax.jcr.RepositoryException: java.lang.ClassCastException: [B cannot be cast to [Ljava.lang.Object;
      21:01:21,839 INFO [stdout]         at org.modeshape.jcr.JcrSession.save(JcrSession.java:1184)
      ...
      21:01:21,844 INFO  [stdout]  Caused by: java.lang.ClassCastException: [B cannot be cast to [Ljava.lang.Object;
      21:01:21,844 INFO  [stdout]         at org.modeshape.common.util.StringUtil.createString(StringUtil.java:169)
      21:01:21,844 INFO  [stdout]         at org.modeshape.common.i18n.I18n.text(I18n.java:412)
      21:01:21,844 INFO  [stdout]         at org.modeshape.common.i18n.I18n.text(I18n.java:397)
      21:01:21,844 INFO  [stdout]         at org.modeshape.jcr.value.binary.BinaryStoreValueFactory.create(BinaryStoreValueFactory.java:232)
      21:01:21,845 INFO  [stdout]         at org.modeshape.jcr.value.binary.BinaryStoreValueFactory.create(BinaryStoreValueFactory.java:104)
      21:01:21,845 INFO  [stdout]         at org.modeshape.jcr.value.binary.BinaryStoreValueFactory.create(BinaryStoreValueFactory.java:49)
      21:01:21,845 INFO  [stdout]         at org.modeshape.jcr.cache.document.DocumentTranslator.valueToDocument(DocumentTranslator.java:1090)
      21:01:21,845 INFO  [stdout]         at org.modeshape.jcr.cache.document.DocumentTranslator.setProperty(DocumentTranslator.java:421)
      21:01:21,846 INFO  [stdout]         at org.modeshape.jcr.cache.document.WritableSessionCache.persistChanges(WritableSessionCache.java:1006)
      21:01:21,846 INFO  [stdout]         at org.modeshape.jcr.cache.document.WritableSessionCache.save(WritableSessionCache.java:587)
      21:01:21,846 INFO  [stdout]         at org.modeshape.jcr.JcrSession.save(JcrSession.java:1165)
      21:01:21,846 INFO  [stdout]         ... 19 more
      
      

       

      There's a BinaryStoreException that is thrown in BinaryStoreValueFactory.create(BinaryStoreValueFactory.java:232) but I don't know its content as the creation of the ValueFormatException just below... throws an exception too!

       

      I suppose that what I'm seeing is somewhat related to the ModeShape optimization feature mentioned in MODE-2155.

      Indeed, setting <cache-binary-storage ... min-string-size="2147483647"/> made my problem disappear.

      But that's more of a workaround that a proper solution.


      Before opening a bug report in JIRA, I wanted to be sure that it's not due to an incorrect configuration of mine.


      Thanks.