java.lang.ClassCastException: com.fnst.group03.dom

java.lang.ClassCastException: com.fnst.group03.domain.Flag_$$_javassist_2 cannot be cast to javassist.util.proxy.Proxy
 at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.getProxy(JavassistLazyInitializer.java:147)
 at org.hibernate.proxy.pojo.javassist.JavassistProxyFactory.getProxy(JavassistProxyFactory.java:75)
 at org.hibernate.tuple.entity.AbstractEntityTuplizer.createProxy(AbstractEntityTuplizer.java:771)
 at org.hibernate.persister.entity.AbstractEntityPersister.createProxy(AbstractEntityPersister.java:4613)
 at org.hibernate.event.internal.DefaultLoadEventListener.createProxyIfNecessary(DefaultLoadEventListener.java:349)
 at org.hibernate.event.internal.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:270)
 at org.hibernate.event.internal.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:150)
 at org.hibernate.internal.SessionImpl.fireLoad(SessionImpl.java:1070)
 at org.hibernate.internal.SessionImpl.internalLoad(SessionImpl.java:989)
 at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:716)
 at org.hibernate.type.EntityType.resolve(EntityType.java:502)
 at org.hibernate.engine.internal.TwoPhaseLoad.doInitializeEntity(TwoPhaseLoad.java:170)
 at org.hibernate.engine.internal.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:144)
 at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:1114)
 at org.hibernate.loader.Loader.processResultSet(Loader.java:972)
 at org.hibernate.loader.Loader.doQuery(Loader.java:920)
 at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:354)
 at org.hibernate.loader.Loader.doList(Loader.java:2553)
 at org.hibernate.loader.Loader.doList(Loader.java:2539)
 at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2369)
 at org.hibernate.loader.Loader.list(Loader.java:2364)
 at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:496)
 at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:387)
 at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:231)
 at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1264)
 at org.hibernate.internal.QueryImpl.list(QueryImpl.java:103)
 at org.hibernate.internal.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:966)
 at com.fnst.group03.dao.Impl.UserDaoImpl.getUserName(UserDaoImpl.java:69)
 at com.fnst.group03.service.Impl.UserServiceImpl.checkUserName(UserServiceImpl.java:33)
 at com.fnst.group03.service.JUserService.testCheckUserName(JUserService.java:14)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:606)
 at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
 at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
 at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
 at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
 at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
 at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
 at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
 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)


解决方法:Flag.hbm.xml 中加入()  <class name="com.fnst.group03.domain.Flag" table="flag" lazy="false" >

你可能感兴趣的:(java.lang.ClassCastException: com.fnst.group03.dom)