java.lang.ClassCastException: [Ljava.lang.Enum; cannot be cast to [Lhex.glrm.GLRMModel$GLRMParameters$Loss;

JIRA | Anqi Fu | 1 year ago
  1. 0

    I am passing an array of enums, which is a GLRM input parameter, to different nodes and get the following error: onExCompletion for water.FJPacket@c7a5487 java.lang.ClassCastException: [Ljava.lang.Enum; cannot be cast to [Lhex.glrm.GLRMModel$GLRMParameters$Loss; at hex.glrm.GLRMModel$GLRMParameters$Icer.read77(GLRMModel$GLRMParameters$Icer.java) at hex.glrm.GLRMModel$GLRMParameters$Icer.read(GLRMModel$GLRMParameters$Icer.java) at water.Iced.read(Iced.java:55) at water.Iced.read(Iced.java:33) at water.AutoBuffer.get(AutoBuffer.java:799) at hex.ModelBuilder$Icer.read75(ModelBuilder$Icer.java) at hex.glrm.GLRM$Icer.read74(GLRM$Icer.java) at hex.glrm.GLRM$Icer.read(GLRM$Icer.java) at water.Iced.read(Iced.java:55) at water.Iced.read(Iced.java:33) at water.AutoBuffer.get(AutoBuffer.java:799) at water.Job$3$Icer.read56(Job$3$Icer.java) at water.Job$3$Icer.read(Job$3$Icer.java) at water.H2O$H2OCountedCompleter.read(H2O.java:1047) at water.H2O$H2OCountedCompleter.read(H2O.java:967) at water.AutoBuffer.get(AutoBuffer.java:799) at water.RPC.remote_exec(RPC.java:489) at water.FJPacket.compute2(FJPacket.java:28) at water.H2O$H2OCountedCompleter.compute(H2O.java:1005) at jsr166y.CountedCompleter.exec(CountedCompleter.java:429) at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263) at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974) at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477) at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)

    JIRA | 1 year ago | Anqi Fu
    java.lang.ClassCastException: [Ljava.lang.Enum; cannot be cast to [Lhex.glrm.GLRMModel$GLRMParameters$Loss;
  2. 0

    I am passing an array of enums, which is a GLRM input parameter, to different nodes and get the following error: onExCompletion for water.FJPacket@c7a5487 java.lang.ClassCastException: [Ljava.lang.Enum; cannot be cast to [Lhex.glrm.GLRMModel$GLRMParameters$Loss; at hex.glrm.GLRMModel$GLRMParameters$Icer.read77(GLRMModel$GLRMParameters$Icer.java) at hex.glrm.GLRMModel$GLRMParameters$Icer.read(GLRMModel$GLRMParameters$Icer.java) at water.Iced.read(Iced.java:55) at water.Iced.read(Iced.java:33) at water.AutoBuffer.get(AutoBuffer.java:799) at hex.ModelBuilder$Icer.read75(ModelBuilder$Icer.java) at hex.glrm.GLRM$Icer.read74(GLRM$Icer.java) at hex.glrm.GLRM$Icer.read(GLRM$Icer.java) at water.Iced.read(Iced.java:55) at water.Iced.read(Iced.java:33) at water.AutoBuffer.get(AutoBuffer.java:799) at water.Job$3$Icer.read56(Job$3$Icer.java) at water.Job$3$Icer.read(Job$3$Icer.java) at water.H2O$H2OCountedCompleter.read(H2O.java:1047) at water.H2O$H2OCountedCompleter.read(H2O.java:967) at water.AutoBuffer.get(AutoBuffer.java:799) at water.RPC.remote_exec(RPC.java:489) at water.FJPacket.compute2(FJPacket.java:28) at water.H2O$H2OCountedCompleter.compute(H2O.java:1005) at jsr166y.CountedCompleter.exec(CountedCompleter.java:429) at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263) at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974) at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477) at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)

    JIRA | 1 year ago | Anqi Fu
    java.lang.ClassCastException: [Ljava.lang.Enum; cannot be cast to [Lhex.glrm.GLRMModel$GLRMParameters$Loss;
  3. 0

    This was raised against AspectJ but I'm thinking (from the stack trace) it may be Spring AOP. The AJ bug is : https://bugs.eclipse.org/bugs/show_bug.cgi?id=474266 and the text from that is: The method I used AspectJ+SpringAOP to intercept is declared as below: {code}public <V extends IMessage> void getMessageValue(V... messages){code} And the arguments passed into this method are actually enums declared like below: {code}public enum CustomMessage implements IMessage { WELCOME("Hello"), GOODBYE("Bye"); ... }{code} The method call of getMessageValue() is like: {code}getMessageValue(CustomMessage.WELCOME, CustomMessage.GOODBYE);{code} And there will be an exception thrown: {code}java.lang.ClassCastException: [Ljava.lang.Enum; cannot be cast to [Lcom.read.maventest.interface.IMessage; at com.read.maventest.bean.TestEnumList$$FastClassBySpringCGLIB$$21d778f3.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:717) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85) at com.read.maventest.bean.TimingAspect.timeStats(TimingAspect.java:25) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497){code}

    Spring JIRA | 1 year ago | Andy Clement
    java.lang.ClassCastException: [Ljava.lang.Enum; cannot be cast to [Lcom.read.maventest.interface.IMessage;
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    fj.data.Java#EnumSet_List throws ClassCastException

    GitHub | 3 years ago | cedriessen
    java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.Enum;
  6. 0

    This was raised against AspectJ but I'm thinking (from the stack trace) it may be Spring AOP. The AJ bug is : https://bugs.eclipse.org/bugs/show_bug.cgi?id=474266 and the text from that is: The method I used AspectJ+SpringAOP to intercept is declared as below: {code}public <V extends IMessage> void getMessageValue(V... messages){code} And the arguments passed into this method are actually enums declared like below: {code}public enum CustomMessage implements IMessage { WELCOME("Hello"), GOODBYE("Bye"); ... }{code} The method call of getMessageValue() is like: {code}getMessageValue(CustomMessage.WELCOME, CustomMessage.GOODBYE);{code} And there will be an exception thrown: {code}java.lang.ClassCastException: [Ljava.lang.Enum; cannot be cast to [Lcom.read.maventest.interface.IMessage; at com.read.maventest.bean.TestEnumList$$FastClassBySpringCGLIB$$21d778f3.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:717) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85) at com.read.maventest.bean.TimingAspect.timeStats(TimingAspect.java:25) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497){code}

    Spring JIRA | 1 year ago | Andy Clement
    java.lang.ClassCastException: [Ljava.lang.Enum; cannot be cast to [Lcom.read.maventest.interface.IMessage;

    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

      [Ljava.lang.Enum; cannot be cast to [Lhex.glrm.GLRMModel$GLRMParameters$Loss;

      at hex.glrm.GLRMModel$GLRMParameters$Icer.read77()
    2. hex.glrm
      GLRMModel$GLRMParameters$Icer.read
      1. hex.glrm.GLRMModel$GLRMParameters$Icer.read77(GLRMModel$GLRMParameters$Icer.java)
      2. hex.glrm.GLRMModel$GLRMParameters$Icer.read(GLRMModel$GLRMParameters$Icer.java)
      2 frames
    3. water
      AutoBuffer.get
      1. water.Iced.read(Iced.java:55)
      2. water.Iced.read(Iced.java:33)
      3. water.AutoBuffer.get(AutoBuffer.java:799)
      3 frames
    4. hex
      ModelBuilder$Icer.read75
      1. hex.ModelBuilder$Icer.read75(ModelBuilder$Icer.java)
      1 frame
    5. hex.glrm
      GLRM$Icer.read
      1. hex.glrm.GLRM$Icer.read74(GLRM$Icer.java)
      2. hex.glrm.GLRM$Icer.read(GLRM$Icer.java)
      2 frames
    6. water
      H2O$H2OCountedCompleter.compute
      1. water.Iced.read(Iced.java:55)
      2. water.Iced.read(Iced.java:33)
      3. water.AutoBuffer.get(AutoBuffer.java:799)
      4. water.Job$3$Icer.read56(Job$3$Icer.java)
      5. water.Job$3$Icer.read(Job$3$Icer.java)
      6. water.H2O$H2OCountedCompleter.read(H2O.java:1047)
      7. water.H2O$H2OCountedCompleter.read(H2O.java:967)
      8. water.AutoBuffer.get(AutoBuffer.java:799)
      9. water.RPC.remote_exec(RPC.java:489)
      10. water.FJPacket.compute2(FJPacket.java:28)
      11. water.H2O$H2OCountedCompleter.compute(H2O.java:1005)
      11 frames
    7. jsr166y
      ForkJoinWorkerThread.run
      1. jsr166y.CountedCompleter.exec(CountedCompleter.java:429)
      2. jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263)
      3. jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974)
      4. jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477)
      5. jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)
      5 frames