Hi
I'm trying to integrate Spring data and MongoDb into our existing OSGI framework. This was working fine until I tried to create some custom mappers, at which point an exception is thrown (see below).
Now, it appears that its a problem with the hibernate validator implementation (com.springsource.org.hibernate.validator version 4.2.0.Final), which exists as an OSGI bundle, along with the javax.validation (com.springsource.javax.validation version 1.0.0.GA) which exists as another bundle. I'm trying to implement a third bundle that simply defines a custom converter in the applicationContext.xml: -
I'm not sure what I can do to get rid of this exception and allow the converters to be created, any help would be greatly appreciated
Thanks
Darrell
2013 08 20 13:18:38#+0200#ERROR#org.springframework.osgi.exte nder.internal.activator.ContextLoaderListener##ano nymous#SpringOsgiExtenderThread-46###Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=com.sap.id s.mongodb, config=osgibundle:/META-INF/spring/*.xml))
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.validation.beanvalidation.Loc alValidatorFactoryBean#0': Invocation of init method failed; nested exception is javax.validation.ValidationException: Unable to find a default provider
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1455)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 94)
at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:225)
at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:291 )
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:607)
at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:925)
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:136)
at java.lang.Thread.run(Thread.java:722)
Caused by: javax.validation.ValidationException: Unable to find a default provider
at javax.validation.Validation$GenericBootstrapImpl.c onfigure(Validation.java:264)
at org.springframework.validation.beanvalidation.Loca lValidatorFactoryBean.afterPropertiesSet(LocalVali datorFactoryBean.java:184)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$6.run(AbstractAutowireC apableBeanFactory.java:1504)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1502)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1452)
... 14 more|
I'm trying to integrate Spring data and MongoDb into our existing OSGI framework. This was working fine until I tried to create some custom mappers, at which point an exception is thrown (see below).
Now, it appears that its a problem with the hibernate validator implementation (com.springsource.org.hibernate.validator version 4.2.0.Final), which exists as an OSGI bundle, along with the javax.validation (com.springsource.javax.validation version 1.0.0.GA) which exists as another bundle. I'm trying to implement a third bundle that simply defines a custom converter in the applicationContext.xml: -
Code:
<mongo:mapping-converter>
<mongo:custom-converters>
<mongo:converter>
<bean class="com.sap.ids.mongodb.TestConverter" />
</mongo:converter>
</mongo:custom-converters>
</mongo:mapping-converter>
Thanks
Darrell
2013 08 20 13:18:38#+0200#ERROR#org.springframework.osgi.exte nder.internal.activator.ContextLoaderListener##ano nymous#SpringOsgiExtenderThread-46###Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=com.sap.id s.mongodb, config=osgibundle:/META-INF/spring/*.xml))
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.validation.beanvalidation.Loc alValidatorFactoryBean#0': Invocation of init method failed; nested exception is javax.validation.ValidationException: Unable to find a default provider
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1455)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 94)
at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:225)
at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:291 )
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:607)
at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:925)
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:136)
at java.lang.Thread.run(Thread.java:722)
Caused by: javax.validation.ValidationException: Unable to find a default provider
at javax.validation.Validation$GenericBootstrapImpl.c onfigure(Validation.java:264)
at org.springframework.validation.beanvalidation.Loca lValidatorFactoryBean.afterPropertiesSet(LocalVali datorFactoryBean.java:184)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$6.run(AbstractAutowireC apableBeanFactory.java:1504)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1502)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1452)
... 14 more|