这是什么错呀?java.lang.ClassCastException:$Proxy14 cannot be cast to com.wen.service.basjava.lang.ClassCastException:$Proxy14 cannot be cast to com.wen.service.base.impl.BuyerServiceBeanat com.wen.service.UserServiceTest.setUpBeforeClass(UserSe
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/21 01:33:15
这是什么错呀?java.lang.ClassCastException:$Proxy14 cannot be cast to com.wen.service.basjava.lang.ClassCastException:$Proxy14 cannot be cast to com.wen.service.base.impl.BuyerServiceBeanat com.wen.service.UserServiceTest.setUpBeforeClass(UserSe
这是什么错呀?java.lang.ClassCastException:$Proxy14 cannot be cast to com.wen.service.bas
java.lang.ClassCastException:$Proxy14 cannot be cast to com.wen.service.base.impl.BuyerServiceBean
at com.wen.service.UserServiceTest.setUpBeforeClass(UserServiceTest.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
这是什么错呀?java.lang.ClassCastException:$Proxy14 cannot be cast to com.wen.service.basjava.lang.ClassCastException:$Proxy14 cannot be cast to com.wen.service.base.impl.BuyerServiceBeanat com.wen.service.UserServiceTest.setUpBeforeClass(UserSe
你在UserServiceTest.java:21行转换BuyerServiceBean类时出错,应该是你定义的接口比如
ITestSerivce it = new BuyerServiceBean();这种情况报错,因为BuyerServiceBean不是ITestSerivce的实现类,或者其它类转换错误?