-
Bug
-
Resolution: Done
-
Major
-
jboss-fuse-6.1
-
%
-
-
An application that uses Hibernate and Spring-ORM in Fuse fails because Hibernate cannot load a class in the application code that models a database table. This class is defined in an XML file and is therefore, presumably, passed by name to Hibernate. A workaround is to execute "dynamic-import" on the hibernate-core bundle.
Exception in thread "SpringOsgiExtenderThread-2" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [bundle://271.0:0/META-INF/spring/bundle-context.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: entity class not found: com.blabla.hibernate.TestTable at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1512) ... Caused by: org.hibernate.MappingException: entity class not found: com.blabla.hibernate.TestTable at org.hibernate.mapping.PersistentClass.getMappedClass(PersistentClass.java:137) at org.hibernate.tuple.PropertyFactory.getGetter(PropertyFactory.java:390) at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:75) at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:145) ... Caused by: java.lang.ClassNotFoundException: com.blabla.hibernate.TestTable not found by org.hibernate.core [266] at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532) at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75) at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:190) at org.hibernate.internal.util.ReflectHelper.classForName(ReflectHelper.java:192) at org.hibernate.mapping.PersistentClass.getMappedClass(PersistentClass.java:132)