org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.service.test.Consumer#0' defined in class path resource [dubbo-consumer.xml]: Invocation of init method failed; nested exception is java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to com.service.test.bo.TestBO [01/08/14 01:13:12:012 CST] DubboSharedHandler-thread-1 INFO dubbo.DubboProtocol: [DUBBO] disconected from /10.1.4.130:20880,url:dubbo://10.1.4.130:20880/com.service.test.service.TestService?anyhost=true&application=consumer-of-helloworld-app&check=false&codec=dubbo&dubbo=2.4.9&heartbeat=60000&interface=com.service.test.service.TestService&methods=addValue,findAllTest,delTest,addTest&pid=1740&serialization=hessian2&side=consumer&timestamp=1406869991616, dubbo version: 2.4.9, current host: 10.1.4.130

Google Groups | j | 3 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    dubbo序列化和反序列化

    Google Groups | 3 years ago | j
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.service.test.Consumer#0' defined in class path resource [dubbo-consumer.xml]: Invocation of init method failed; nested exception is java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to com.service.test.bo.TestBO [01/08/14 01:13:12:012 CST] DubboSharedHandler-thread-1 INFO dubbo.DubboProtocol: [DUBBO] disconected from /10.1.4.130:20880,url:dubbo://10.1.4.130:20880/com.service.test.service.TestService?anyhost=true&application=consumer-of-helloworld-app&check=false&codec=dubbo&dubbo=2.4.9&heartbeat=60000&interface=com.service.test.service.TestService&methods=addValue,findAllTest,delTest,addTest&pid=1740&serialization=hessian2&side=consumer&timestamp=1406869991616, dubbo version: 2.4.9, current host: 10.1.4.130
  2. 0

    当pojo中存在orm注解时,会导致序列化失败

    GitHub | 3 years ago | ppkppk
    dubbo.DubboProtocol: [DUBBO] disconected from /10.1.4.130:20880,url:dubbo://10.1.4.130:20880/com.service.test.service.TestService?anyhost=true&application=consumer-of-helloworld-app&check=false&codec=dubbo&dubbo=2.4.9&heartbeat=60000&interface=com.service.test.service.TestService&methods=addValue,findAllTest,delTest,addTest&pid=1740&serialization=hessian2&side=consumer&timestamp=1406869991616, dubbo version: 2.4.9, current host: 10.1.4.130

    Root Cause Analysis

    1. java.lang.ClassCastException

      [Ljava.lang.Object; cannot be cast to com.service.test.bo.TestBO

      at com.service.test.Consumer.start()
    2. com.service.test
      Consumer.start
      1. com.service.test.Consumer.start(Consumer.java:23)
      1 frame
    3. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:606)
      4 frames
    4. Spring Beans
      DefaultListableBeanFactory.preInstantiateSingletons
      1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1638)
      2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1579)
      3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)
      4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
      5. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
      6. org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
      7. org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
      8. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
      9. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
      10. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)
      10 frames
    5. Spring Context
      ClassPathXmlApplicationContext.<init>
      1. org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
      2. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
      3. org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
      4. org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
      4 frames
    6. com.alibaba.dubbo
      Main.main
      1. com.alibaba.dubbo.container.spring.SpringContainer.start(SpringContainer.java:50)
      2. com.alibaba.dubbo.container.Main.main(Main.java:80)
      2 frames
    7. Unknown
      ConsumerLaunch.main
      1. ConsumerLaunch.main(ConsumerLaunch.java:23)
      1 frame