-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Problem with Hibernate's javaassist
PostPosted: Wed Sep 10, 2014 4:13 am 
Newbie

Joined: Wed Sep 10, 2014 3:53 am
Posts: 3
Ok, so I recently started learning hibernate, and I got Netbeans 8.0 and started going through the official Netbeans hibernate tutorial: https://netbeans.org/kb/docs/web/hibernate-webapp.html

However, when I arrived at the bit where I was to test my HQL ("from Film" - the query I ran), I got this error:

Code:
java.lang.ClassCastException: dvdrental.Language_$$_javassist_60 cannot be cast to javassist.util.proxy.ProxyObject


There's a bunch of other stuff that follows that line, but that's not where I'm getting at.

The hibernate library I'm using came with Netbeans 8.0. So I went online, got the official Hibernate 4.3.6. I configured it on my netbeans, used it and got the same error.

Then I removed the javassist-3.18.1-GA.jar, and the error disappeared. I was able to run my HQL with no problems. Same with removing the javassist-3.15.0-GA.jar that comes with my netbeans - that took care of all my problems.

Which brings me to my question: is this supposed to happen? javassist-3.18.1-GA.jar is in the required folder. Why on earth would I get errors when using it and not get any errors when omitting it?

And why am I getting this error in the first place?

The full error is below. Thanks for your help, guys.

Code:
java.lang.ClassCastException: dvdrental.Language_$$_javassist_60 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)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.