5 Replies Latest reply on Aug 23, 2010 11:46 PM by jessica leahy

    problem with using both AOP and JMSComponent bean

    rafal janik Newbie

      I have problem with using both AOP and JMS in my project.

      In my project i want to use Camel and AOP. Everything works fine until I'm trying to create org.apache.camel.component.jms.JmsComponent bean. Then I'm getting following Exception:

       

       

        org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'activemq' defined in URL bundle://178.0:0/META-INF/spring/my-context.xml: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Expecting raw type, not: org.apache.camel.impl.DefaultComponent

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

              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)

              at java.security.AccessController.doPrivileged(Native Method)

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

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

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

              at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(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.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)

              at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:68)

              at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:343)

              at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)

              at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:308)

              at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:138)

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

      Caused by: java.lang.IllegalStateException: Expecting raw type, not: org.apache.camel.impl.DefaultComponent

       

      -


       

       

      If I remove JMSComponent bean or <aop:config> section the bundle starts successfully.

       

      To use AspectJ I've installed in Fuse (following the instructions from Link: http://fusesource.com/issues/browse/ESB-793):

       

        http://repository.springsource.com/ivy/bundles/external/org.aspectj/com.springsource.org.aspectj.runtime/1.6.2.RELEASE/com.springsource.org.aspectj.runtime-1.6.2.RELEASE.jar

       

      and

       

        http://repository.springsource.com/ivy/bundles/external/org.aspectj/com.springsource.org.aspectj.weaver/1.6.2.RELEASE/com.springsource.org.aspectj.weaver-1.6.2.RELEASE.jar

       

      -


       

       

      The camel-context.xml:

       

       

       

      The component-aop-context.xml :

       

       

                      <aop:before

                        method="saveEvent"

                        pointcut="execution(* example.class.TestClass.*(..)) and args(image)" />

                      

       

      -


       

       

      Fuse ESB Version : 4.1.0.2

      AspectJ: 1.6.2-RELEASE (1.6.1 tested too)

      Apache Camel 1.6.1

       

      Edited by: rafal.janik on Aug 6, 2009 11:25 AM