ClassNotFoundException in org.hibernate.annotations.commons.reflection
oren Aug 26, 2009 5:18 PMI have a bundle that depends on Hibernate, and I just can't get it to see the Hibernate annotations common bundle that is installed on the bus. I keep getting
smx@root:osgi> Exception in thread "SpringOsgiExtenderThread-112" org.springfram
ework.beans.factory.UnsatisfiedDependencyException: Error creating bean with nam
e 'dao' defined in URL [bundle://211.0:1/edu/utah/further/core/data/service/DaoH
ibernateImpl.class]: Unsatisfied dependency expressed through constructor argume
nt with index 0 of type : : Error creating bean wi
th name 'sessionFactory' defined in URL [bundle://225.0:0/META-INF/spring/mdr-im
pl-context-datasource.xml]: Invocation of init method failed; nested exception i
s java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/Re
flectionManager; nested exception is org.springframework.beans.factory.BeanCreat
ionException: Error creating bean with name 'sessionFactory' defined in URL [bun
dle://225.0:0/META-INF/spring/mdr-impl-context-datasource.xml]: Invocation of in
it method failed; nested exception is java.lang.NoClassDefFoundError: org/hibern
ate/annotations/common/reflection/ReflectionManager
at org.springframework.beans.factory.support.ConstructorResolver.createA
rgumentArray(ConstructorResolver.java:591)
at org.springframework.beans.factory.support.ConstructorResolver.autowir
eConstructor(ConstructorResolver.java:193)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
ject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.
preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finish
BeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp
plicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:6
8)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp
plicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:343)
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCus
tomTCCL(PrivilegedUtils.java:85)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionAp
plicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.ja
va:308)
at org.springframework.osgi.extender.internal.dependencies.startup.Depen
dencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterAp
plicationContextExecutor.java:138)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creati
ng bean with name 'sessionFactory' defined in URL [bundle://225.0:0/META-INF/spr
ing/mdr-impl-context-datasource.xml]: Invocation of init method failed; nested e
xception is java.lang.NoClassDefFoundError: org/hibernate/annotations/common/ref
lection/ReflectionManager
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
ject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
y.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
an(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean
(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.
findAutowireCandidates(DefaultListableBeanFactory.java:671)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.
resolveDependency(DefaultListableBeanFactory.java:610)
at org.springframework.beans.factory.support.ConstructorResolver.resolve
AutowiredArgument(ConstructorResolver.java:622)
at org.springframework.beans.factory.support.ConstructorResolver.createA
rgumentArray(ConstructorResolver.java:584)
... 20 more
Caused by: java.lang.NoClassDefFoundError: org/hibernate/annotations/common/refl
ection/ReflectionManager
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.getDeclaredConstructor(Class.java:1985)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:7
8)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newConfigu
ration(LocalSessionFactoryBean.java:772)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessi
onFactory(LocalSessionFactoryBean.java:517)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPr
opertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at org.springframework.beans.factory.support.AbstractAutowireCapableBean
Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
... 33 more
Caused by: java.lang.ClassNotFoundException: org.hibernate.annotations.common.re
flection.ReflectionManager
at org.apache.felix.framework.searchpolicy.ModuleImpl.findClassOrResourc
eByDelegation(ModuleImpl.java:558)
at org.apache.felix.framework.searchpolicy.ModuleImpl.access$100(ModuleI
mpl.java:59)
at org.apache.felix.framework.searchpolicy.ModuleImpl$ModuleClassLoader.
loadClass(ModuleImpl.java:1427)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 43 more
smx@root:osgi>
smx@root:osgi>
smx@root:osgi>
... even though it is declared in the felix plugin config of my bundle (see attached pom), and the dependency exists on the ESB:
list | grep Hibernate
JBoss Hibernate Annotations (3.4.0.GA)
JBoss Hibernate Entity Manager (3.4.0.GA)
JBoss Hibernate Object-Relational Mapper
(3.3.1.GA)
JBoss Hibernate Common Annotations (3.3.0
.ga)
smx@root:osgi>
What am I doing wrong? Also, how can I search for a package on the bus? e.g. match all bundles that have this package in their exported package header?
-
pom.xml 7.5 KB