java.lang.ClassCastException: org.infinispan.container.entries.ImmortalCacheEntry cannot be cast to java.util.Collection

hivmr.com | 5 months ago
  1. 0

    db:: 4.23::Infinispan error as "org.infinispan.commons.CacheException" ka

    hivmr.com | 5 months ago
    java.lang.ClassCastException: org.infinispan.container.entries.ImmortalCacheEntry cannot be cast to java.util.Collection
  2. 0

    db:: 2.89::Stackoverflow error in org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject 9a

    hivmr.com | 5 months ago
    java.lang.ClassCastException: org.infinispan.container.entries.ImmortalCacheEntry cannot be cast to java.util.Collection
  3. 0

    Bug with intersect() and empty/1-element collections

    GitHub | 4 years ago | Volune
    java.lang.ClassCastException: java.lang.Integer cannot be cast to java.util.Collection
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Re: [bpmn2-modeler-dev] Custom task with extensionElements

    eclipse.org | 1 year ago
    java.lang.ClassCastException: org.eclipse.emf.ecore.impl.EObjectImpl cannot be cast to java.util.Collection
  6. 0

    FULL PRODUCT VERSION : ADDITIONAL OS VERSION INFORMATION : Microsoft Windows [Version 6.1.7601] A DESCRIPTION OF THE PROBLEM : Java selects the wrong method during type inference with generic-type returning objects. See source code below. The "get" method in class "A" returns a type that extends "A". The main method then tries to assign the return value to a Collection, an interface. This compiles but will obviously throw a ClassCastException at run time. Any interface can be chosen, List, Map, anything. It will still compile. Basically the type inference mechanism is not checking if the return type can actually be assigned when an interface is concerned. This would have caused a compile-time error in JDK 1.6 and below: C:\Users\gendrok\Documents\NetBeansProjects\temp\src\Test.java:18: type parameters of <T>T cannot be determined; no unique maximal instance exists for type variable T with upper bounds java.util.Collection,Test.A Collection c1 = new A().get(); STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : Compile the source code and run it. EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - The source code should be prevented from being compiled. ACTUAL - The source code is compiled successfully. ERROR MESSAGES/STACK TRACES THAT OCCUR : Exception in thread "main" java.lang.ClassCastException: Test$A cannot be cast to java.util.Collection at Test.main(Test.java) REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Set; public class Test { public static class A { public A() { } public <T extends A> T get() { return (T)this; } } public static void main(String[] args) { Collection c1 = new A().get(); List l1 = new A().get(); Set s1 = new A().get(); Map m1 = new A().get(); } } ---------- END SOURCE ---------- CUSTOMER SUBMITTED WORKAROUND : Do not use generic-type returning methods.

    JDK Bug System | 9 months ago | Webbug Group
    java.lang.ClassCastException: Test$A cannot be cast to java.util.Collection

    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

      org.infinispan.container.entries.ImmortalCacheEntry cannot be cast to java.util.Collection

      at org.infinispan.commands.control.StateTransferControlCommand.setParameters()
    2. Infinispan Core
      CacheRpcCommandExternalizer.readObject
      1. org.infinispan.commands.control.StateTransferControlCommand.setParameters(StateTransferControlCommand.java:153)[infinispan-core.jar:5.1.7.Final]
      2. org.infinispan.commands.RemoteCommandsFactory.fromStream(RemoteCommandsFactory.java:231)[infinispan-core.jar:5.1.7.Final]
      3. org.infinispan.marshall.exts.ReplicableCommandExternalizer.fromStream(ReplicableCommandExternalizer.java:125)[infinispan-core.jar:5.1.7.Final]
      4. org.infinispan.marshall.exts.CacheRpcCommandExternalizer.readObject(CacheRpcCommandExternalizer.java:163)[infinispan-core.jar:5.1.7.Final]
      5. org.infinispan.marshall.exts.CacheRpcCommandExternalizer.readObject(CacheRpcCommandExternalizer.java:66)[infinispan-core.jar:5.1.7.Final]
      5 frames
    3. org.infinispan.marshall
      ExternalizerTable.readObject
      1. org.infinispan.marshall.jboss.ExternalizerTable$ExternalizerAdapter.readObject(ExternalizerTable.java:395)[infinispan-core.jar:5.1.7.Final]
      2. org.infinispan.marshall.jboss.ExternalizerTable.readObject(ExternalizerTable.java:224)[infinispan-core.jar:5.1.7.Final]
      2 frames
    4. JBoss Marshalling River
      RiverUnmarshaller.doReadObject
      1. org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:355)[jboss-marshalling-river-1.3.18.GA-redhat-1.jar:1.3.18.GA-redhat-1]
      2. org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:213)[jboss-marshalling-river-1.3.18.GA-redhat-1.jar:1.3.18.GA-redhat-1]
      2 frames
    5. JBoss Marshalling API
      AbstractObjectInput.readObject
      1. org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:37)[jboss-marshalling-1.3.18.GA-redhat-1.jar:1.3.18.GA-redhat-1]
      1 frame
    6. org.infinispan.marshall
      AbstractDelegatingMarshaller.objectFromByteBuffer
      1. org.infinispan.marshall.jboss.AbstractJBossMarshaller.objectFromObjectStream(AbstractJBossMarshaller.java:163)[infinispan-core.jar:5.1.7.Final]
      2. org.infinispan.marshall.VersionAwareMarshaller.objectFromByteBuffer(VersionAwareMarshaller.java:114)[infinispan-core.jar:5.1.7.Final]
      3. org.infinispan.marshall.AbstractDelegatingMarshaller.objectFromByteBuffer(AbstractDelegatingMarshaller.java:104)[infinispan-core.jar:5.1.7.Final]
      3 frames
    7. Infinispan Core
      CommandAwareRpcDispatcher.handle
      1. org.infinispan.remoting.transport.jgroups.MarshallerAdapter.objectFromBuffer(MarshallerAdapter.java:50)[infinispan-core.jar:5.1.7.Final]
      2. org.infinispan.remoting.transport.jgroups.CommandAwareRpcDispatcher.handle(CommandAwareRpcDispatcher.java:200)[infinispan-core.jar:5.1.7.Final]
      2 frames
    8. JGroups
      TP$IncomingPacket.run
      1. org.jgroups.blocks.RequestCorrelator.handleRequest(RequestCorrelator.java:456)[jgroups.jar:3.0.13.Final]
      2. org.jgroups.blocks.RequestCorrelator.receiveMessage(RequestCorrelator.java:363)[jgroups.jar:3.0.13.Final]
      3. org.jgroups.blocks.RequestCorrelator.receive(RequestCorrelator.java:238)[jgroups.jar:3.0.13.Final]
      4. org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:601)[jgroups.jar:3.0.13.Final]
      5. org.jgroups.JChannel.up(JChannel.java:716)[jgroups.jar:3.0.13.Final]
      6. org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:1026)[jgroups.jar:3.0.13.Final]
      7. org.jgroups.protocols.RSVP.up(RSVP.java:172)[jgroups.jar:3.0.13.Final]
      8. org.jgroups.protocols.FRAG2.unfragment(FRAG2.java:302)[jgroups.jar:3.0.13.Final]
      9. org.jgroups.protocols.FRAG2.up(FRAG2.java:162)[jgroups.jar:3.0.13.Final]
      10. org.jgroups.protocols.FlowControl.up(FlowControl.java:418)[jgroups.jar:3.0.13.Final]
      11. org.jgroups.protocols.FlowControl.up(FlowControl.java:400)[jgroups.jar:3.0.13.Final]
      12. org.jgroups.protocols.pbcast.GMS.up(GMS.java:889)[jgroups.jar:3.0.13.Final]
      13. org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:244)[jgroups.jar:3.0.13.Final]
      14. org.jgroups.protocols.UNICAST2.handleDataReceived(UNICAST2.java:759)[jgroups.jar:3.0.13.Final]
      15. org.jgroups.protocols.UNICAST2.up(UNICAST2.java:365)[jgroups.jar:3.0.13.Final]
      16. org.jgroups.protocols.pbcast.NAKACK.up(NAKACK.java:602)[jgroups.jar:3.0.13.Final]
      17. org.jgroups.protocols.VERIFY_SUSPECT.up(VERIFY_SUSPECT.java:143)[jgroups.jar:3.0.13.Final]
      18. org.jgroups.protocols.FD.up(FD.java:273)[jgroups.jar:3.0.13.Final]
      19. org.jgroups.protocols.FD_SOCK.up(FD_SOCK.java:288)[jgroups.jar:3.0.13.Final]
      20. org.jgroups.protocols.MERGE2.up(MERGE2.java:205)[jgroups.jar:3.0.13.Final]
      21. org.jgroups.protocols.Discovery.up(Discovery.java:359)[jgroups.jar:3.0.13.Final]
      22. org.jgroups.protocols.TP.passMessageUp(TP.java:1185)[jgroups.jar:3.0.13.Final]
      23. org.jgroups.protocols.TP$IncomingPacket.handleMyMessage(TP.java:1733)[jgroups.jar:3.0.13.Final]
      24. org.jgroups.protocols.TP$IncomingPacket.run(TP.java:1715)[jgroups.jar:3.0.13.Final]
      24 frames
    9. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[rt.jar:1.7.0_25]
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[rt.jar:1.7.0_25]
      3. java.lang.Thread.run(Thread.java:724)[rt.jar:1.7.0_25]
      3 frames