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

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

    Hi,
    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?

    Code:
    	... 17 common frames omitted
    Caused by: com.springsource.kernel.osgi.framework.ExtendedClassNotFoundException: com.mycompany.platform.dms.jpa.DBMSDocument in KernelBundleClassLoader: [bundle=com.springsource.org.hibernate_3.3.2.GA]
    	at com.springsource.kernel.osgi.framework.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:145)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    	at java.lang.Class.forName0(Native Method)
    	at java.lang.Class.forName(Class.java:247)
    	at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:170)
    	at org.hibernate.ejb.Ejb3Configuration.classForName(Ejb3Configuration.java:1009)
    	at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1081)
    	... 25 common frames omitted
    Caused by: java.lang.ClassNotFoundException: com.mycompany.platform.dms.jpa.DBMSDocument
    	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:494)
    	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
    	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:398)
    	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105)
    	at com.springsource.kernel.osgi.framework.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:141)
    	... 32 common frames omitted

  • #2
    Moved thread to dmServer forum.

    Comment


    • #3
      Have you used the import-scope:=application directive on your import of Hibernate? There's some info about this in the programmer guide: http://static.springsource.org/s2-dm...l/ch04s06.html

      Comment


      • #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.

        Comment

        Working...
        X