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
HIbernate/JPA OSGi integration test problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • HIbernate/JPA OSGi integration test problem

    Hello,
    I'm unit testing a hibernate/jpa Spring DM bundle. I'm able to successfully "UNIT" test the bundle. But I'm running into some issues when I try to "Integration Test" the same bundle inside an Equinox embedded container.

    I'm running the Unit test by overriding the <CODE>AbstractConfigurableBundleCreatorTests</CODE> class.

    for the overridden method :
    <CODE>
    @Override
    protected String[] getTestBundlesNames() {
    return new String [] {
    "com.hcsc.itf.osgi.sample.person, com.hcsc.itf.osgi.sample.person.datasource, 1.0.0",
    "com.hcsc.itf.osgi.sample.person, com.hcsc.itf.osgi.sample.person.domain, 1.0.0",
    "com.hcsc.itf.osgi.sample.person, com.hcsc.itf.osgi.sample.person.dao, 1.0.0",
    "com.hcsc.itf.osgi.sample.person, com.hcsc.itf.osgi.sample.person.hibdao, 1.0.0",

    "javax.persistence, com.springsource.javax.persistence, 2.0.0",
    "org.springframework, org.springframework.transaction, 3.0.2.RELEASE",
    "org.springframework, org.springframework.jdbc, 3.0.2.RELEASE",
    "org.springframework, org.springframework.orm, 3.0.2.RELEASE",

    "org.hibernate, com.springsource.org.hibernate.ejb, 3.4.0.GA",
    "org.hibernate, com.springsource.org.hibernate.annotations.common, 3.3.0.ga",
    "org.hibernate, com.springsource.org.hibernate.annotations, 3.4.0.GA",
    "org.hibernate, com.springsource.org.hibernate, 3.3.2.GA",

    ....
    </CODE>

    When I run the test I'm getting the following exception:

    <CODE>
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'entityManagerFactory' defined in URL [bundleentry://23.fwk3317565/META-INF/spring/bundle-contex.xml]: Cannot resolve reference to bean 'hibernateJpaVendorAdaptor' while setting bean property 'jpaVendorAdapter'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'hibernateJpaVendorAdaptor' defined in URL [bundleentry://23.fwk3317565/META-INF/spring/bundle-contex.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [org.springframework.orm.jpa.vendor.HibernateJpaVen dorAdapter]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/hibernate/ejb/HibernatePersistence
    at
    org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveReference(BeanDefinitio nValueResolver.java:328)
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveValueIfNecessary(BeanDe finitionValueResolver.java:106)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:1317)

    </CODE>

    But the missing class is part of the bundles I'm including in the testcase! I have been stuck on this issue for more than a day! Any help will be appreciated.

    Thanks in advance!

    Matt
Working...
X