Announcement Announcement Module
Collapse

Spring Dynamic Modules forum decommissioned in favor of Eclipse Gemini Blueprint

With the official first release of Eclipse Gemini Blueprint shipped, the migration of the Spring Dynamic Modules code base to the Eclipse Foundation, as part of the Gemini project, has been completed.

As such, this forum has been decommissioned in favour of the Eclipse Gemini forums.
See more
See less
OSGi bundle with JPA and hibernate Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • OSGi bundle with JPA and hibernate

    I have been working to get a service using JPA with hibernate exposed as an OSGi bundle.
    I referred to springsource enterprise repository and found the library for hibernate and included the required dependencies in maven pom.xml but the maven dependecies were not included in the OSGi bundle. How to make sure all Maven dependencies are included in the OSGi bundle?
    I am using Spring Dynamic Modules and Spring DM server to test the OSGi bundle.
    I have tested the flow from junit but I am unable to deploy the bundle successfully in Spring DM server. Following is the exception trace:

    [2010-09-08 17:06:16.983] start-signalling-3 <DE0006E> Start failed for bundle 'DBServce' version '1.0.0'. org.springframework.beans.factory.CannotLoadBeanCl assException: Cannot find class [org.springframework.orm.jpa.support.PersistenceAnn otationBeanPostProcessor] for bean with name 'org.springframework.orm.jpa.support.PersistenceAn notationBeanPostProcessor#0' defined in URL [bundleentry://59.fwk7225609/META-INF/spring/module-context.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.orm.jpa.support.PersistenceAnn otationBeanPostProcessor not found from bundle [DBServce]
    at org.springframework.beans.factory.support.Abstract BeanFactory.resolveBeanClass(AbstractBeanFactory.j ava:1208)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.predictBeanType(Abstrac tAutowireCapableBeanFactory.java:568)
    at org.springframework.beans.factory.support.Abstract BeanFactory.isFactoryBean(AbstractBeanFactory.java :1277)
    at org.springframework.beans.factory.support.Abstract BeanFactory.isFactoryBean(AbstractBeanFactory.java :844)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:539)
    at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:842)
    at org.springframework.osgi.context.support.AbstractD elegatedExecutionApplicationContext.access$1600(Ab stractDelegatedExecutionApplicationContext.java:69 )
    at org.springframework.osgi.context.support.AbstractD elegatedExecutionApplicationContext$4.run(Abstract DelegatedExecutionApplicationContext.java:355)
    at org.springframework.osgi.util.internal.PrivilegedU tils.executeWithCustomTCCL(PrivilegedUtils.java:85 )
    at org.springframework.osgi.context.support.AbstractD elegatedExecutionApplicationContext.completeRefres h(AbstractDelegatedExecutionApplicationContext.jav a:320)
    at org.springframework.osgi.extender.internal.depende ncies.startup.DependencyWaiterApplicationContextEx ecutor$CompleteRefreshTask.run(DependencyWaiterApp licationContextExecutor.java:132)
    at com.springsource.kernel.agent.dm.ContextPropagatin gTaskExecutor$2.run(ContextPropagatingTaskExecutor .java:106)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.ClassNotFoundException: org.springframework.orm.jpa.support.PersistenceAnn otationBeanPostProcessor not found from bundle [DBServce]
    at org.springframework.osgi.util.BundleDelegatingClas sLoader.findClass(BundleDelegatingClassLoader.java :103)
    at org.springframework.osgi.util.BundleDelegatingClas sLoader.loadClass(BundleDelegatingClassLoader.java :156)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 48)
    at org.springframework.util.ClassUtils.forName(ClassU tils.java:258)
    at org.springframework.beans.factory.support.Abstract BeanDefinition.resolveBeanClass(AbstractBeanDefini tion.java:408)
    at org.springframework.beans.factory.support.Abstract BeanFactory.doResolveBeanClass(AbstractBeanFactory .java:1229)
    at org.springframework.beans.factory.support.Abstract BeanFactory.resolveBeanClass(AbstractBeanFactory.j ava:1200)
    ... 14 common frames omitted
    Caused by: com.springsource.kernel.osgi.framework.ExtendedCla ssNotFoundException: org.springframework.orm.jpa.support.PersistenceAnn otationBeanPostProcessor in KernelBundleClassLoader: [bundle=DBServce_1.0.0]
    at com.springsource.kernel.userregion.internal.equino x.KernelBundleClassLoader.loadClass(KernelBundleCl assLoader.java:149)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 48)
    at org.eclipse.osgi.internal.loader.BundleLoader.load Class(BundleLoader.java:326)
    at org.eclipse.osgi.framework.internal.core.BundleHos t.loadClass(BundleHost.java:231)
    at org.eclipse.osgi.framework.internal.core.AbstractB undle.loadClass(AbstractBundle.java:1193)
    at org.springframework.osgi.util.BundleDelegatingClas sLoader.findClass(BundleDelegatingClassLoader.java :99)
    ... 20 common frames omitted
    Caused by: java.lang.ClassNotFoundException: org.springframework.orm.jpa.support.PersistenceAnn otationBeanPostProcessor
    at org.eclipse.osgi.internal.loader.BundleLoader.find ClassInternal(BundleLoader.java:494)
    at org.eclipse.osgi.internal.loader.BundleLoader.find Class(BundleLoader.java:410)
    at org.eclipse.osgi.internal.loader.BundleLoader.find Class(BundleLoader.java:398)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClass Loader.loadClass(DefaultClassLoader.java:105)
    at com.springsource.kernel.userregion.internal.equino x.KernelBundleClassLoader.loadClass(KernelBundleCl assLoader.java:145)
    ... 25 common frames omitted

    I need advice as to whether I am following the right approach.
    Last edited by vineetkanwal; Sep 9th, 2010, 06:53 AM.
Working...
X