java.lang.ClassCastException: [B cannot be cast to org.sharrissf.sample.Person

Terracotta Project Issue Tracker | David Dai | 4 years ago
  1. 0

    Terracotta Project Issue Tracker

    terracotta.org | 11 months ago
    java.lang.ClassCastException: [B cannot be cast to org.sharrissf.sample.Person
  2. 0

    When copyOnRead and copyOnWrite are both set, search by value attribute fails with ClassCastException in AtributeExtractor, Exception in thread "main" java.lang.ClassCastException: [B cannot be cast to org.sharrissf.sample.Person at org.sharrissf.sample.EhcacheSearchPlaying$NameAttributeExtractor.attributeFor(EhcacheSearchPlaying.java:200) at org.sharrissf.sample.EhcacheSearchPlaying$NameAttributeExtractor.attributeFor(EhcacheSearchPlaying.java:206) at net.sf.ehcache.search.expression.ILike.execute(ILike.java:145) at net.sf.ehcache.search.expression.And.execute(And.java:69) at net.sf.ehcache.store.MemoryOnlyStore$BruteForceSearchManager.executeQuery(MemoryOnlyStore.java:151) at net.sf.ehcache.store.AbstractStore.executeQuery(AbstractStore.java:174) at net.sf.ehcache.store.ElementIdAssigningStore.executeQuery(ElementIdAssigningStore.java:449) at net.sf.ehcache.Cache.executeQuery(Cache.java:4015) at net.sf.ehcache.CacheQuery.execute(CacheQuery.java:181) at org.sharrissf.sample.EhcacheSearchPlaying.runTests(EhcacheSearchPlaying.java:109) at org.sharrissf.sample.EhcacheSearchPlaying.main(EhcacheSearchPlaying.java:188) To reproduce it, just take the sample code at https://github.com/sharrissf/Ehcache-Search-Sample and set CacheConfiguration cacheConfig.copyOnRead(true).copyOnWrite(true). It seems Element.getValue() or getObjectValue() always returns byte[] instead of the original value type. It works fine if either copyOnRead or copyOnWrite is not set.

    Terracotta Project Issue Tracker | 4 years ago | David Dai
    java.lang.ClassCastException: [B cannot be cast to org.sharrissf.sample.Person
  3. 0

    When copyOnRead and copyOnWrite are both set, search by value attribute fails with ClassCastException in AtributeExtractor, Exception in thread "main" java.lang.ClassCastException: [B cannot be cast to org.sharrissf.sample.Person at org.sharrissf.sample.EhcacheSearchPlaying$NameAttributeExtractor.attributeFor(EhcacheSearchPlaying.java:200) at org.sharrissf.sample.EhcacheSearchPlaying$NameAttributeExtractor.attributeFor(EhcacheSearchPlaying.java:206) at net.sf.ehcache.search.expression.ILike.execute(ILike.java:145) at net.sf.ehcache.search.expression.And.execute(And.java:69) at net.sf.ehcache.store.MemoryOnlyStore$BruteForceSearchManager.executeQuery(MemoryOnlyStore.java:151) at net.sf.ehcache.store.AbstractStore.executeQuery(AbstractStore.java:174) at net.sf.ehcache.store.ElementIdAssigningStore.executeQuery(ElementIdAssigningStore.java:449) at net.sf.ehcache.Cache.executeQuery(Cache.java:4015) at net.sf.ehcache.CacheQuery.execute(CacheQuery.java:181) at org.sharrissf.sample.EhcacheSearchPlaying.runTests(EhcacheSearchPlaying.java:109) at org.sharrissf.sample.EhcacheSearchPlaying.main(EhcacheSearchPlaying.java:188) To reproduce it, just take the sample code at https://github.com/sharrissf/Ehcache-Search-Sample and set CacheConfiguration cacheConfig.copyOnRead(true).copyOnWrite(true). It seems Element.getValue() or getObjectValue() always returns byte[] instead of the original value type. It works fine if either copyOnRead or copyOnWrite is not set.

    Terracotta Project Issue Tracker | 4 years ago | David Dai
    java.lang.ClassCastException: [B cannot be cast to org.sharrissf.sample.Person
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Maxwell Schema Issues after 'ALTER TABLE foo MODIFY bar bartype AFTER baz;' like commands

    GitHub | 1 month ago | Bradyta
    java.lang.ClassCastException: [B cannot be cast to java.lang.Integer
  6. 0

    Test fails except when run in isolation

    GitHub | 1 year ago | tpj
    java.lang.ClassCastException: [B cannot be cast to [Ljava.math.BigInteger;

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassCastException

      [B cannot be cast to org.sharrissf.sample.Person

      at org.sharrissf.sample.EhcacheSearchPlaying$NameAttributeExtractor.attributeFor()
    2. org.sharrissf.sample
      EhcacheSearchPlaying$NameAttributeExtractor.attributeFor
      1. org.sharrissf.sample.EhcacheSearchPlaying$NameAttributeExtractor.attributeFor(EhcacheSearchPlaying.java:200)
      2. org.sharrissf.sample.EhcacheSearchPlaying$NameAttributeExtractor.attributeFor(EhcacheSearchPlaying.java:206)
      2 frames
    3. Ehcache
      CacheQuery.execute
      1. net.sf.ehcache.search.expression.ILike.execute(ILike.java:145)
      2. net.sf.ehcache.search.expression.And.execute(And.java:69)
      3. net.sf.ehcache.store.MemoryOnlyStore$BruteForceSearchManager.executeQuery(MemoryOnlyStore.java:151)
      4. net.sf.ehcache.store.AbstractStore.executeQuery(AbstractStore.java:174)
      5. net.sf.ehcache.store.ElementIdAssigningStore.executeQuery(ElementIdAssigningStore.java:449)
      6. net.sf.ehcache.Cache.executeQuery(Cache.java:4015)
      7. net.sf.ehcache.CacheQuery.execute(CacheQuery.java:181)
      7 frames
    4. org.sharrissf.sample
      EhcacheSearchPlaying.main
      1. org.sharrissf.sample.EhcacheSearchPlaying.runTests(EhcacheSearchPlaying.java:109)
      2. org.sharrissf.sample.EhcacheSearchPlaying.main(EhcacheSearchPlaying.java:188)
      2 frames