{"id":12675,"date":"2013-08-09T23:06:00","date_gmt":"2013-08-09T22:06:00","guid":{"rendered":"https:\/\/touk.pl\/blog\/?guid=df150009de5601800dfddc089fb63298"},"modified":"2022-08-02T12:44:08","modified_gmt":"2022-08-02T10:44:08","slug":"unable-to-instantiate-default-tuplizer","status":"publish","type":"post","link":"https:\/\/touk.pl\/blog\/2013\/08\/09\/unable-to-instantiate-default-tuplizer\/","title":{"rendered":"Unable to instantiate default tuplizer"},"content":{"rendered":"<p>I wrote few hbm mappings for domain classes in my recent project, and I got exception like that:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]<\/pre>\n<p>Of course my first thought was googling for it and I found interesting answers. Most commons causes of this exception are:<\/p>\n<ul>\n<li>missing getters or setters, what\u2019s more, even a typo or wrong letter case (like getParentproject instead of getParentProject when field in class and mapping file is defined as parentProject)<\/li>\n<li>missing default constructor<\/li>\n<li>missing dependency for javassist library<\/li>\n<\/ul>\n<div>My files seemed to be correctly defined, so it had to be missing dependency.<\/div>\n<div>\n<p>To fix it I\u2019ve added these lines to my pom.xml:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"xml\"><dependency>\r\n    <groupId>org.javassist<\/groupId>\r\n    <artifactId>javassist<\/artifactId>\r\n    <version>3.18.0-GA<\/version>\r\n<\/dependency>\r\n<\/pre>\n<\/div>\n<p>Well, it shouldn\u2019t be a surprise because in full stacktrafe from this error there is an entry:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">java.lang.ClassNotFoundException: javassist.util.proxy.MethodFilter<\/pre>\n<p>What explicitly indicates where is the root of this problem ;)<\/p>\n<p>(And BTW: in my recent project I\u2019m stuck with quite old version of Hibernate \u2013 3.6.3)<\/p>\n","protected":false},"excerpt":{"rendered":"I wrote few hbm mappings for domain classes in my recent project, and I got exception like that:org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]Of course my first thought was googl&#8230;\n","protected":false},"author":48,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[43,68,107],"class_list":{"0":"post-12675","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-development-design","7":"tag-hibernate","8":"tag-java","9":"tag-xml"},"_links":{"self":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/12675","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/users\/48"}],"replies":[{"embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/comments?post=12675"}],"version-history":[{"count":3,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/12675\/revisions"}],"predecessor-version":[{"id":14826,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/12675\/revisions\/14826"}],"wp:attachment":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/media?parent=12675"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/categories?post=12675"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/tags?post=12675"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}