0

Hibernate and ZK

asked 2011-02-28 05:34:24 +0800

PhilipPeinsold gravatar image PhilipPeinsold
70 2

Hello @ all!
I really need your help!

I want to combine Hibernate and ZK in my project. First I tried hibernate in a normal java project, and that works perfectly!
Then I tried to do the same with ZK. I got a lot of errors, but I solved them by including several .jars. In the end I get this error I couldn't cope:

SCHWERWIEGEND: >>org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
>>java.lang.reflect.InvocationTargetException: null
>>java.lang.NoClassDefFoundError: javassist/util/proxy/MethodFilter
>>java.lang.ClassNotFoundException: javassist.util.proxy.MethodFilter
>> at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)
>> at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1493)
>> at org.hibernate.bytecode.javassist.BytecodeProviderImpl.getProxyFactoryFactory(BytecodeProviderImpl.java:49)
>> at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactoryInternal(PojoEntityTuplizer.java:205)
>> at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:183)
>> at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:167)
>>...


I included javassist and still get this error. I copied the javassist.jar to the lib-directory of my project and I added the .jar to my Classpath (rightclick on the project -> java build path -> Add external jars ...)


What am I doing wrong???? please help me!
greetings!

delete flag offensive retag edit

6 Replies

Sort by ยป oldest newest

answered 2011-02-28 06:16:09 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

First, try to do an EXPORT as war file and look if there are TWO javassist.jar's in the lib folder.

Which version of hibernate you use?

best
Stephan

link publish delete flag offensive edit

answered 2011-02-28 06:25:00 +0800

PhilipPeinsold gravatar image PhilipPeinsold
70 2

Ok, I exported the project as .war ... how could I look now if there are two javassists???

I use now javassist 3.4 (because 3.14 didn't work, I tried 3.4) and hibernate version 3.6

thx so far...

link publish delete flag offensive edit

answered 2011-02-28 06:27:32 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

open the war-file with the winRar compression tool and look for the WEB-INF/lib folder

link publish delete flag offensive edit

answered 2011-02-28 06:42:57 +0800

PhilipPeinsold gravatar image PhilipPeinsold
70 2

Alright, sorry... I opended it, and there is only one javassist.

link publish delete flag offensive edit

answered 2011-02-28 06:53:19 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

updated 2011-02-28 07:00:18 +0800

Try to use the 'cglib' instead of 'javassist'

https://forum.hibernate.org/viewtopic.php?t=990648&highlight=&sid=a7711178e036eb618cd1485dc7fd5793
http://entwickler.de/zonen/portale/psecom,id,99,news,34959,.html
http://forum.springsource.org/showthread.php?t=86330

link publish delete flag offensive edit

answered 2011-02-28 07:44:00 +0800

PhilipPeinsold gravatar image PhilipPeinsold
70 2

Great!!! It works now!

I only had to create a hibernate.properties file and add this line:
hibernate.bytecode.provider = cglib

in addition I needed to inlcude the jta.jar to my lib path:
http://www.java2s.com/Code/Jar/JKL/Downloadjtajar.htm


Thanks again!
All the best!

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2011-02-28 05:34:24 +0800

Seen: 697 times

Last updated: Feb 28 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More