]
Katia Aresti closed ISPN-9471.
------------------------------
Released prev 12
Class not found when injecting a RemoteCache
--------------------------------------------
Key: ISPN-9471
URL:
https://issues.redhat.com/browse/ISPN-9471
Project: Infinispan
Issue Type: Bug
Components: Spring Integration
Affects Versions: 9.3.0.Final
Reporter: Katia Aresti
Assignee: Katia Aresti
Priority: Major
Tested in the infinispan-simple-example
When injecting embedded works
```
@Autowired
private Cache<Long, String> defaultCache;
```
Injecting remote, fails: Caused by: java.lang.ClassNotFoundException:
org.infinispan.query.dsl.Query
```java
@Autowired
private RemoteCache<Long, String> defaultRemoteCache;
```
Error:
Error starting ApplicationContext. To display the auto-configuration report re-run your
application with 'debug' enabled.
2018-08-30 21:10:48.753 ERROR 12291 --- [ main] o.s.boot.SpringApplication
: Application startup failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean
with name 'springBootApp': Unsatisfied dependency expressed through field
'defaultRemoteCache'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'getRemoteCache' defined in class path resource
[org/infinispan/tutorial/simple/spring/Config.class]: Post-processing of merged bean
definition failed; nested exception is java.lang.NoClassDefFoundError:
org/infinispan/query/dsl/Query
at
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588)
~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at
org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)
~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)
~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
~[spring-context-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
~[spring-context-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
[spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
[spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
[spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
[spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
[spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE]
at org.infinispan.tutorial.simple.spring.SpringBootApp.main(SpringBootApp.java:96)
[classes/:na]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'getRemoteCache' defined in class path resource
[org/infinispan/tutorial/simple/spring/Config.class]: Post-processing of merged bean
definition failed; nested exception is java.lang.NoClassDefFoundError:
org/infinispan/query/dsl/Query
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:526)
~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at
org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)
~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585)
~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
... 18 common frames omitted
Caused by: java.lang.NoClassDefFoundError: org/infinispan/query/dsl/Query
at java.lang.Class.getDeclaredMethods0(Native Method) ~[na:1.8.0_161]
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) ~[na:1.8.0_161]
at java.lang.Class.getDeclaredMethods(Class.java:1975) ~[na:1.8.0_161]
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:613)
~[spring-core-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at org.springframework.util.ReflectionUtils.doWithLocalMethods(ReflectionUtils.java:489)
~[spring-core-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.buildLifecycleMetadata(InitDestroyAnnotationBeanPostProcessor.java:206)
~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.findLifecycleMetadata(InitDestroyAnnotationBeanPostProcessor.java:187)
~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessMergedBeanDefinition(InitDestroyAnnotationBeanPostProcessor.java:125)
~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at
org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessMergedBeanDefinition(CommonAnnotationBeanPostProcessor.java:295)
~[spring-context-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyMergedBeanDefinitionPostProcessors(AbstractAutowireCapableBeanFactory.java:992)
~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:523)
~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
... 27 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.infinispan.query.dsl.Query
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_161]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_161]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338) ~[na:1.8.0_161]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_161]
... 38 common frames omitted
Process finished with exit code 1