Announcement Announcement Module
No announcement yet.
Unable to load POJO class when using hibernate in dm server v2 Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unable to load POJO class when using hibernate in dm server v2

    I have configured JPA to use Hibernate as ORM provider. I have a POJO class mapped in orm.xml file. My application is deployed as OSGi bundle in dm server v2. When hibernate tries to read persistence unit, it tries to create instance of my POJO class and it gives ClassNotFoundException. My application OSGi bundle manifest has dependency to hibernate bundle hence, my application bundle can access the Hibernate classes but other way is not possible since Hibernate OSGi bundle will not have dependency to my application jar file. Is idea how to resolve this ClassLoader problem?

    	... 17 common frames omitted
    Caused by: com.springsource.kernel.osgi.framework.ExtendedClassNotFoundException: com.mycompany.platform.dms.jpa.DBMSDocument in KernelBundleClassLoader: []
    	at com.springsource.kernel.osgi.framework.equinox.KernelBundleClassLoader.loadClass(
    	at java.lang.ClassLoader.loadClass(
    	at java.lang.ClassLoader.loadClassInternal(
    	at java.lang.Class.forName0(Native Method)
    	at java.lang.Class.forName(
    	at org.hibernate.util.ReflectHelper.classForName(
    	at org.hibernate.ejb.Ejb3Configuration.classForName(
    	at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(
    	... 25 common frames omitted
    Caused by: java.lang.ClassNotFoundException: com.mycompany.platform.dms.jpa.DBMSDocument
    	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(
    	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(
    	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(
    	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(
    	at com.springsource.kernel.osgi.framework.equinox.KernelBundleClassLoader.loadClass(
    	... 32 common frames omitted

  • #2
    Moved thread to dmServer forum.


    • #3
      Have you used the import-scope:=application directive on your import of Hibernate? There's some info about this in the programmer guide:


      • #4
        Any luck?

        Did you ever get around this? I'm struggling with the same issue, and none of the suggestions I've found through google or this forum seem to have made any difference.