0 Replies Latest reply on Sep 19, 2013 8:02 AM by amitwave

    Issue with cglib proxy creation when deploying jbi service assembly on jboss fuse 6.

    amitwave

      I am trying to deploy my jbi serviceassembly on fuse-6. The code uses spring annotations for bean wiring and transactions.

       

      The integration tests run fine because they are outside the container but when the same code is deployed to the container the following exception is thrown. I have checked the classes - All classes have interfaces and non have a final method. Please suggest.

       

      Caused by: javax.jbi.management.DeploymentException: <component-task-result xmlns="http://java.sun.com/xml/ns/jbi/management-message">

        <component-name>servicemix-camel</component-name>

        <component-task-result-details>

        <task-result-details>

        <task-id>deploy</task-id>

        <task-result>FAILED</task-result>

        <message-type>ERROR</message-type>

        <task-status-msg><msg-loc-info><loc-token/><loc-message>Could not deploy xbean service unit</loc-message></msg-loc-info></task-status-msg>

        <exception-info>

        <nesting-level>1</nesting-level>

        <msg-loc-info>

        <loc-token />

        <loc-message>Error creating bean with name 'cmActionAggregator': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected com.specsavers.ssa.businessservice.BatchBusinessService com.specsavers.ssa.processor.AbstractAggregator.batchBusinessService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'batchBusinessService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected com.specsavers.ssa.dataservice.BatchDataService com.specsavers.ssa.businessservice.impl.BatchBusinessServiceImpl.batchDataService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'batchDataServiceDataService' defined in URL [jar:file:/opt/servicemix-ssa-6.0.0.redhat-024/data/jbi/ssa-service-assembly/sus/ssa-camel-routing/lib/ssa-service-1.3.4-SNAPSHOT.jar!/com/specsavers/ssa/dataservice/impl/BatchDataServiceImpl.class]: Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class com.specsavers.ssa.dataservice.impl.BatchDataServiceImpl]: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: class com.specsavers.ssa.dataservice.impl.BatchDataServiceImpl$$EnhancerByCGLIB$$17567c77 is not an enhanced class</loc-message>

        <stack-trace><![CDATA[org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cmActionAggregator': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected com.specsavers.ssa.businessservice.BatchBusinessService com.specsavers.ssa.processor.AbstractAggregator.batchBusinessService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'batchBusinessService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected com.specsavers.ssa.dataservice.BatchDataService com.specsavers.ssa.businessservice.impl.BatchBusinessServiceImpl.batchDataService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'batchDataServiceDataService' defined in URL [jar:file:/opt/servicemix-ssa-6.0.0.redhat-024/data/jbi/ssa-service-assembly/sus/ssa-camel-routing/lib/ssa-service-1.3.4-SNAPSHOT.jar!/com/specsavers/ssa/dataservice/impl/BatchDataServiceImpl.class]: Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class com.specsavers.ssa.dataservice.impl.BatchDataServiceImpl]: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: class com.specsavers.ssa.dataservice.impl.BatchDataServiceImpl$$EnhancerByCGLIB$$17567c77 is not an enhanced class

        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:287)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)

        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)

        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:605)

        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:925)

        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:472)

        at org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(AbstractXBeanDeployer.java:86)

        at org.apache.servicemix.camel.CamelSpringDeployer.deploy(CamelSpringDeployer.java:76)

        at org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServiceUnitManager.java:86)

        at org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServiceUnitManager.java:69)

        at org.apache.servicemix.jbi.deployer.artifacts.ServiceUnitImpl.deploy(ServiceUnitImpl.java:104)

        at org.apache.servicemix.jbi.deployer.impl.ServiceAssemblyInstaller.deploySUs(ServiceAssemblyInstaller.java:207)

        at org.apache.servicemix.jbi.deployer.impl.ServiceAssemblyInstaller.install(ServiceAssemblyInstaller.java:85)

        at org.apache.servicemix.jbi.deployer.impl.Deployer.onBundleStarted(Deployer.java:330)

        at org.apache.servicemix.jbi.deployer.impl.Deployer.bundleChanged(Deployer.java:260)

        at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:870)

        at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:791)

        at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:515)

        at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4580)

        at org.apache.felix.framework.Felix$4.run(Felix.java:2115)

        at org.apache.felix.framework.Felix$5.run(Felix.java:2159)

        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

        at java.util.concurrent.FutureTask.run(FutureTask.java:138)

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

        at java.lang.Thread.run(Thread.java:662)

      Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected com.specsavers.ssa.businessservice.BatchBusinessService com.specsavers.ssa.processor.AbstractAggregator.batchBusinessService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'batchBusinessService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected com.specsavers.ssa.dataservice.BatchDataService com.specsavers.ssa.businessservice.impl.BatchBusinessServiceImpl.batchDataService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'batchDataServiceDataService' defined in URL [jar:file:/opt/servicemix-ssa-6.0.0.redhat-024/data/jbi/ssa-service-assembly/sus/ssa-camel-routing/lib/ssa-service-1.3.4-SNAPSHOT.jar!/com/specsavers/ssa/dataservice/impl/BatchDataServiceImpl.class]: Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class com.specsavers.ssa.dataservice.impl.BatchDataServiceImpl]: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: class com.specsavers.ssa.dataservice.impl.BatchDataServiceImpl$$EnhancerByCGLIB$$17567c77 is not an enhanced class

        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:513)

        at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:92)

        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284)

        ... 31 more

      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'batchBusinessService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected com.specsavers.ssa.dataservice.BatchDataService com.specsavers.ssa.businessservice.impl.BatchBusinessServiceImpl.batchDataService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'batchDataServiceDataService' defined in URL [jar:file:/opt/servicemix-ssa-6.0.0.redhat-024/data/jbi/ssa-service-assembly/sus/ssa-camel-routing/lib/ssa-service-1.3.4-SNAPSHOT.jar!/com/specsavers/ssa/dataservice/impl/BatchDataServiceImpl.class]: Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class com.specsavers.ssa.dataservice.impl.BatchDataServiceImpl]: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: class com.specsavers.ssa.dataservice.impl.BatchDataServiceImpl$$EnhancerByCGLIB$$17567c77 is not an enhanced class

        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:287)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1106)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)

        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)

        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:872)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:814)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:731)

        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:485)

        ... 33 more

      Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected com.specsavers.ssa.dataservice.BatchDataService com.specsavers.ssa.businessservice.impl.BatchBusinessServiceImpl.batchDataService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'batchDataServiceDataService' defined in URL [jar:file:/opt/servicemix-ssa-6.0.0.redhat-024/data/jbi/ssa-service-assembly/sus/ssa-camel-routing/lib/ssa-service-1.3.4-SNAPSHOT.jar!/com/specsavers/ssa/dataservice/impl/BatchDataServiceImpl.class]: Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class com.specsavers.ssa.dataservice.impl.BatchDataServiceImpl]: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: class com.specsavers.ssa.dataservice.impl.BatchDataServiceImpl$$EnhancerByCGLIB$$17567c77 is not an enhanced class

        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:513)

        at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:92)

        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:284)

        ... 44 more

      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'batchDataServiceDataService' defined in URL [jar:file:/opt/servicemix-ssa-6.0.0.redhat-024/data/jbi/ssa-service-assembly/sus/ssa-camel-routing/lib/ssa-service-1.3.4-SNAPSHOT.jar!/com/specsavers/ssa/dataservice/impl/BatchDataServiceImpl.class]: Initialization of bean failed; nested exception is org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class com.specsavers.ssa.dataservice.impl.BatchDataServiceImpl]: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: class com.specsavers.ssa.dataservice.impl.BatchDataServiceImpl$$EnhancerByCGLIB$$17567c77 is not an enhanced class

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)

        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)

        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)

        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)

        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:872)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:814)

        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:731)

        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:485)

        ... 46 more

      Caused by: org.springframework.aop.framework.AopConfigException: Could not generate CGLIB subclass of class [class com.specsavers.ssa.dataservice.impl.BatchDataServiceImpl]: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: class com.specsavers.ssa.dataservice.impl.BatchDataServiceImpl$$EnhancerByCGLIB$$17567c77 is not an enhanced class

        at org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:213)

        at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:112)

        at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.createProxy(AbstractAutoProxyCreator.java:476)

        at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:362)

        at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:322)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:407)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1461)

        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)

        ... 55 more

      Caused by: java.lang.IllegalArgumentException: class com.specsavers.ssa.dataservice.impl.BatchDataServiceImpl$$EnhancerByCGLIB$$17567c77 is not an enhanced class

        at net.sf.cglib.proxy.Enhancer.setCallbacksHelper(Enhancer.java:621)

        at net.sf.cglib.proxy.Enhancer.setThreadCallbacks(Enhancer.java:612)

        at net.sf.cglib.proxy.Enhancer.createUsingReflection(Enhancer.java:634)

        at net.sf.cglib.proxy.Enhancer.firstInstance(Enhancer.java:538)

        at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:225)

        at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:377)

        at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:285)

        at org.springframework.aop.framework.Cglib2AopProxy.getProxy(Cglib2AopProxy.java:201)

        ... 62 more

      ]]></stack-trace>