[hibernate-dev] hiberntae 4.1.6 / spring 3.1.3 upgrade issue

Vikas Bali vikas_bali at calypso.com
Thu Nov 29 15:42:50 EST 2012


Hi, I had recently upgraded hibernate version to 4.1.6 with that I also had to upgrade spring too to version 3.1.3.Release which is compatible to hibernate 4, but I am getting following issue with this change:

In my hibernate.cfg.xml, I load a mapping file e.g, "<mapping resource="com/test/x.hbm.xml" />" and

x.hbn.xml:
<hibernate-mapping package="com.test.packA">
                <class entity-name="DummyEntityName" table="DEN">
                                <component name="compA" class="com.test.PackA.ClassA">
                                </component>
</class>
</ hibernate-mapping >

.. When I call LocalSessionFactoryBean.afterPropertiesSet(), I get following exception. Please note class "ClassA" is part of some other jar which may or may not be included at the runtime. It was working fine with earlier version but getting following exception with this upgrade ... Any idea ?

org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.component.PojoComponentTuplizer]

                at org.hibernate.tuple.component.ComponentTuplizerFactory.constructTuplizer(ComponentTuplizerFactory.java:101)

                at org.hibernate.tuple.component.ComponentTuplizerFactory.constructDefaultTuplizer(ComponentTuplizerFactory.java:122)

                at org.hibernate.tuple.component.ComponentMetamodel.<init>(ComponentMetamodel.java:80)

                at org.hibernate.mapping.Component.getType(Component.java:172)

                at org.hibernate.mapping.SimpleValue.isValid(SimpleValue.java:294)

                at org.hibernate.mapping.Property.isValid(Property.java:238)

                at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:469)

                at org.hibernate.mapping.RootClass.validate(RootClass.java:270)

                at org.hibernate.cfg.Configuration.validate(Configuration.java:1294)

                at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1738)

                at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1784)

                at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:251)

                at org.springframework.orm.hibernate4.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:372)

                at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:357)

                at com.test.tk.service.persistence.hbm.SessionManager.getSessionFactoryBean(SessionManager.java:252)

                ...

Caused by: java.lang.reflect.InvocationTargetException

                at sun.reflect.GeneratedConstructorAccessor30.newInstance(Unknown Source)

                at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

                at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

                at org.hibernate.tuple.component.ComponentTuplizerFactory.constructTuplizer(ComponentTuplizerFactory.java:98)

                ... 145 more

Caused by: org.hibernate.MappingException: component class not found: com.test.packA.ClassA

                at org.hibernate.mapping.Component.getComponentClass(Component.java:134)

                at org.hibernate.tuple.component.PojoComponentTuplizer.buildGetter(PojoComponentTuplizer.java:155)

                at org.hibernate.tuple.component.AbstractComponentTuplizer.<init>(AbstractComponentTuplizer.java:64)

                at org.hibernate.tuple.component.PojoComponentTuplizer.<init>(PojoComponentTuplizer.java:59)

                ... 149 more

Caused by: java.lang.ClassNotFoundException: com.test.packA.ClassA from [Module "deployment.test.war:main" from Service Module Loader]

                at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

                at java.lang.Class.forName0(Native Method)

                at java.lang.Class.forName(Class.java:169)

                at org.hibernate.internal.util.ReflectHelper.classForName(ReflectHelper.java:192)

                at org.hibernate.mapping.Component.getComponentClass(Component.java:131)

                ... 152 more


More information about the hibernate-dev mailing list