Announcement Announcement Module

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
Conversation Detail Module
  • 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 [ otationBeanPostProcessor] for bean with name ' notationBeanPostProcessor#0' defined in URL [bundleentry://59.fwk7225609/META-INF/spring/module-context.xml]; nested exception is java.lang.ClassNotFoundException: otationBeanPostProcessor not found from bundle [DBServce]
    at BeanFactory.resolveBeanClass(AbstractBeanFactory.j ava:1208)
    at AutowireCapableBeanFactory.predictBeanType(Abstrac
    at BeanFactory.isFactoryBean( :1277)
    at BeanFactory.isFactoryBean( :844)
    at istableBeanFactory.preInstantiateSingletons(Defaul
    at ationContext.finishBeanFactoryInitialization(Abstr
    at elegatedExecutionApplicationContext.access$1600(Ab )
    at elegatedExecutionApplicationContext$
    at org.springframework.osgi.util.internal.PrivilegedU tils.executeWithCustomTCCL( )
    at elegatedExecutionApplicationContext.completeRefres h(AbstractDelegatedExecutionApplicationContext.jav a:320)
    at org.springframework.osgi.extender.internal.depende ncies.startup.DependencyWaiterApplicationContextEx ecutor$
    at gTaskExecutor$ .java:106)
    at java.util.concurrent.ThreadPoolExecutor$ Task(
    at java.util.concurrent.ThreadPoolExecutor$ (
    Caused by: java.lang.ClassNotFoundException: otationBeanPostProcessor not found from bundle [DBServce]
    at org.springframework.osgi.util.BundleDelegatingClas sLoader.findClass( :103)
    at org.springframework.osgi.util.BundleDelegatingClas sLoader.loadClass( :156)
    at java.lang.ClassLoader.loadClass( 48)
    at org.springframework.util.ClassUtils.forName(ClassU
    at BeanDefinition.resolveBeanClass(AbstractBeanDefini
    at BeanFactory.doResolveBeanClass(AbstractBeanFactory .java:1229)
    at BeanFactory.resolveBeanClass(AbstractBeanFactory.j ava:1200)
    ... 14 common frames omitted
    Caused by: com.springsource.kernel.osgi.framework.ExtendedCla ssNotFoundException: otationBeanPostProcessor in KernelBundleClassLoader: [bundle=DBServce_1.0.0]
    at com.springsource.kernel.userregion.internal.equino x.KernelBundleClassLoader.loadClass(KernelBundleCl
    at java.lang.ClassLoader.loadClass( 48)
    at org.eclipse.osgi.internal.loader.BundleLoader.load Class(
    at org.eclipse.osgi.framework.internal.core.BundleHos t.loadClass(
    at org.eclipse.osgi.framework.internal.core.AbstractB undle.loadClass(
    at org.springframework.osgi.util.BundleDelegatingClas sLoader.findClass( :99)
    ... 20 common frames omitted
    Caused by: java.lang.ClassNotFoundException: otationBeanPostProcessor
    at org.eclipse.osgi.internal.loader.BundleLoader.find ClassInternal(
    at org.eclipse.osgi.internal.loader.BundleLoader.find Class(
    at org.eclipse.osgi.internal.loader.BundleLoader.find Class(
    at org.eclipse.osgi.internal.baseadaptor.DefaultClass Loader.loadClass(
    at com.springsource.kernel.userregion.internal.equino x.KernelBundleClassLoader.loadClass(KernelBundleCl
    ... 25 common frames omitted

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