readthefuckingmanual.net

[SOLVED] Initial SessionFactory creation failed.org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]

Error added: 2009-09-30T07:43:30Z

1 people waiting for the answer...

18 answers found.

Answer 1491 (73.33333% helpful)

the problem was solved for me when I went from cglib-2.2.jar to cglib-2.1.jar
Permalink

Answer 1566 (69.23077% helpful)

The “Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer” is a generic error message, it may caused by many reasons. So, you have to look at the last line that caused the error.

Advice from <a href="http://www.google.co.uk/url?sa=t&source=web&cd=6&sqi=2&ved=0CFAQFjAF&url=http%3A%2F%2Fwww.mkyong.com%2Fhibernate%2Fjava-lang-nosuchmethoderror-org-objectweb-asm-classwriter%2F&rct=j&q=Unable%20to%20instantiate%20default%20tuplizer%20%5Borg.hibernate.tuple.entity.PojoEntityTuplizer%5D&ei=dgXkTJ9TjoOFB-zG0ZIN&usg=AFQjCNFeQTA_xu6c9_PBiu3HSWspmd1_Og&sig2=-E6muGqwuNzlt5QNzzZFdw&cad=rja">here</a>
Permalink

Answer 1781 (67.391304% helpful)

<dependency>
	<groupId>javassist</groupId>
	<artifactId>javassist</artifactId>
	<version>3.12.0.GA</version>
	<type>jar</type>
	<scope>compile</scope>
</dependency>
Permalink

Answer 1469 (50.0% helpful)

		<dependency>
			<groupId>jboss</groupId>
			<artifactId>javassist</artifactId>
			<version>3.8.0.GA</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
Permalink

Answer 1794 (50.0% helpful)

Answer 1365 helped me find the error.  In my case my id field was an "int" but the class.hbm.xml listed it as java.lang.Integer.  I changed the type to "Integer" and it worked.  
Permalink

Answer 1104 (50.0% helpful)

Ensure that the getter and setter functions are in the format: getVariablename, and setVariablename. The variable names will have to be the same as the ones listed inside the bean. E.g. if the variable is username, the getter and setter will be getUsername and setUsername.
Permalink

Answer 1324 (55.172413% helpful)

If you add a getter method not on a variable you need to annotate it with @Transient (hibernate will leave that getter out)
Permalink

Answer 1576 (46.153847% helpful)

problem is resolved when I added javaassist3.8.0.GA jar 
Permalink

Answer 1584 (46.666664% helpful)

thank you so much guys !
the problem was solved for me when I went from cglib-2.2.jar to cglib-2.1.jar saved me.
i used full-hibernate plugin in it.
Permalink

Answer 1590 (46.666664% helpful)

In my case there were errors in my mapping files. Classes were not referenced by their full package names. I did this mistake because I generated the mappings when my bean classes belonged to the default package (hence no package name; e.g.: "Order" instead of "com.mypackage.Order") and then I moved my bean classes to package (in the example "com.mypackage"). Unfortunately mapping files did not changed accordingly with the new package definition.

My hint is redo Hibernate reverse engineering and see what it produces.
Permalink

Answer 1269 (52.941177% helpful)

Add javassist.jar
Permalink

Answer 1743 (33.333332% helpful)

In my case, this was caused by running out of permgen space.  I was running my junit test from eclipse, and the permgen error was scrolled up farther than the console buffer, so I couldn't see it.  I added this to my run configuration vm arguments to fix it: -XX:MaxPermSize=256m
Permalink

Answer 1365 (28.571428% helpful)

Answer 7
Sometimes if you use composite PRIMARY key. H&#305;bernate tool generate for example abc.java and abcId.java . The abcId.java is geeratd for compos&#305;te Pk and this cause such error.

Answer 8
I your table does not have an Pk. like abc.java and abcId.java classes are generated via Hibernate tool. And this cause such error.

Answer 9

For example in your xml file 
there exist an entry like
   <property name=\"definitionId\" type=\"string\">
      <column name=\"definition_id\"  />
   </property>
But your column type is actually integer in your DB. Such mistakes may cause  such errors.
Permalink

Answer 1579 (28.571428% helpful)

Fantastic work is done here..i really appreciate it from my bottom of heart..

cglib2.1 is replaced with 2.2...and worked....
Permalink

Answer 1323 (0.0% helpful)

U\'ll get this error if you dont have the getter and the setter of a variable.
Permalink

Answer 1350 (0.0% helpful)

Maybe the cause are jar files you have added to classpath.
Permalink

Answer 1408 (0.0% helpful)

A derivative of #1 worth mentioning.
I happened to name a boolean field \"isPrimaryOwner\" and the \"get\" method name was \"isPrimaryOwner()\".  This caused the problem and was difficult to notice.  I should have named the field \"primaryOwner\".
Permalink

Answer 1731 (0.0% helpful)

I'm Working with flex 4 using BlaseDS for services so when generating service call
from "Data/Services" identical classes of my java classes will be created with actionScript code in objectValues folder, changing/removing/adding new attributes on your java classes would cause this error...
Just delete the service and generate it again that would fix the issue.
Hope that helps someone
Permalink

Add an answer/solution

If you know the answer, please add your own solution below.
If you don't know, but find out later, please come back and share your answer - there will be other people struggling with this too.


Please enter 61948 here

If you want to be notified via email when this is solved, enter your email address here: