0 Replies - 2178 Views - Last Post: 22 April 2014 - 07:06 AM

#1 ken2010   User is offline

  • D.I.C Head

Reputation: -2
  • View blog
  • Posts: 58
  • Joined: 05-December 10

Javassist ClassCastException in Hibernate and Netbeans

Posted 22 April 2014 - 07:06 AM

Could somebody help me look into this, what could have happened that is making this application generate this error. I am following this tutorial on using Hibernate in Netbeans. After getting to this line "from Film", that according to the tutorial it is to be executed to test to read the records of the Film table but the result is the error below. I googled to find what to do, all I have seen so far is that it's reported to be that the javassist jar file could be existing in different directories. One, in the Hibernate (Hibernate 4.x-javassist-3.15.0.GA) directory, which I found out to be true, and the other in the glassfish (Glassfish Server 4) directory. I tried searching for this in the glassfish lib directory, nothing like that seems to exist.

java.lang.ClassCastException: dvdstore.Language_$$_javassist_4 cannot be cast to javassist.util.proxy.ProxyObject
    at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.getProxy(JavassistLazyInitializer.java:147)
    at org.hibernate.proxy.pojo.javassist.JavassistProxyFactory.getProxy(JavassistProxyFactory.java:71)
    at org.hibernate.tuple.entity.AbstractEntityTuplizer.createProxy(AbstractEntityTuplizer.java:631)
    at org.hibernate.persister.entity.AbstractEntityPersister.createProxy(AbstractEntityPersister.java:3737)
    at org.hibernate.event.def.DefaultLoadEventListener.createProxyIfNecessary(DefaultLoadEventListener.java:360)
    at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:281)
    at org.hibernate.event.def.DefaultLoadEventListener.onload(DefaultLoadEventListener.java:152)
    at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1090)
    at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:1038)
    at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:630)
    at org.hibernate.type.EntityType.resolve(EntityType.java:438)
    at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:139)
    at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:982)
    at org.hibernate.loader.Loader.doQuery(Loader.java:857)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
    at org.hibernate.loader.Loader.doList(Loader.java:2542)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
    at org.hibernate.loader.Loader.list(Loader.java:2271)
    at org.hibernate.hql.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:940)
    at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
    at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268)
    at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)


Is This A Good Question/Topic? 0
  • +

Page 1 of 1