I just tried out if Spring-AOP none-ApectJ style is working with ServiceMix.

I am running into the same kind of error.

The exception is:
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'org.springframework.aop.config.internalAutoProxyCreator':
Initialization of bean failed; nested exception is
java.lang.AbstractMethodError
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.
createBean(AbstractAutowireCapableBeanFactory.java:443)

If trying to get Spring-AOP ApectJ style working with ServiceMix you get the
following exception:
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name
'org.springframework.aop.config.internalAutoProxyCreator': Initialization of
bean failed; nested exception is java.lang.AbstractMethodError:
org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator.
findCandidateAdvisors()Ljava/util/List;
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.
createBean(AbstractAutowireCapableBeanFactory.java:443)

Apparently Spring's AbstractAutowireCapableBeanFactory is not able to create
a bean with name 'org.springframework.aop.config.internalAutoProxyCreator'.
Why? No clue.

If anybody has ever succeeded in using Spring-AOP in ServiceMix deployed in
a JBoss environment, please help.

Thanks a lot!

Cheers,

Oliver.



oliver kuntze wrote:
> 
> Could it be that because of the way [EMAIL PROTECTED] does the
> classloading, currently it is not possible to use Spring-AOP (at least
> AspectJ annotation style)?
> 
> I googled the following exception I get
> java.lang.AbstractMethodError:
> org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator.
> findCandidateAdvisors()Ljava/util/List;
> All the posts are dealing with classloading or lib version
> incompatibilities, most of them dealing with ASM in the CGLIB jar (which
> is also used be JBoss' Hibernate).
> 
> So I took a look at the POM for spring-aop.jar (Version 2.0.1, the one
> that is also packaged in my ServiceMix distribution) and inluced all jars
> listed in the dependency section in my
> servicemix-jboss-deployer-3.1-incubating.sar and in my SU. I also tried
> only putting them in the servicemix-jboss-deployer-3.1-incubating.sar and
> only putting them in the SU.
> 
> The POM looks like this:
> <code>
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
>       <modelVersion>4.0.0</modelVersion>
>       <parent>
>       
> <groupId>oliver.osiris.playground.sandbox.swifttransformation-service</groupId>
>               <artifactId>swifttransformation-service</artifactId>
>               <version>1.0</version>
>       </parent>
> 
> <groupId>oliver.osiris.playground.sandbox.swifttransformation-service</groupId>
>       <artifactId>swifttransformation-jsr181-su</artifactId>
>       <name>Osiris :: sandbox :: swifttransformation-service ::
> swifttransformation-jsr181-su :: SU</name>
>       <packaging>jbi-service-unit</packaging>
>       <version>1.0</version>
>       <url>${site.root}//swifttransformation-service/</url>
>       <dependencies>
>               <dependency>
>                       <groupId>aopalliance</groupId>
>                       <artifactId>aopalliance</artifactId>
>                       <version>1.0</version>
>               </dependency>
>               <dependency>
>                       <groupId>aspectj</groupId>
>                       <artifactId>aspectjrt</artifactId>
>                       <version>1.5.2a</version>
>                       <scope>provided</scope>
>               </dependency>
>               <dependency>
>                       <groupId>aspectj</groupId>
>                       <artifactId>aspectjweaver</artifactId>
>                       <version>1.5.2a</version>
>               </dependency>
>               <dependency>
>                       <groupId>cglib</groupId>
>                       <artifactId>cglib-nodep</artifactId>
>                       <version>2.1_3</version>
>               </dependency>
>               <dependency>
>                       <groupId>commons-attributes</groupId>
>                       <artifactId>commons-attributes-api</artifactId>
>                       <version>2.2</version>
>               </dependency>
>               <dependency>
>                       <groupId>commons-attributes</groupId>
>                       <artifactId>commons-attributes-compiler</artifactId>
>                       <version>2.2</version>
>               </dependency>
>               <dependency>
>                       <groupId>commons-logging</groupId>
>                       <artifactId>commons-logging</artifactId>
>                       <version>1.1</version>
>               </dependency>
>               <dependency>
>                       <groupId>commons-pool</groupId>
>                       <artifactId>commons-pool</artifactId>
>                       <version>1.3</version>
>               </dependency>
>               <dependency>
>                       <groupId>com.jamonapi</groupId>
>                       <artifactId>jamon</artifactId>
>                       <version>1.0</version>
>               </dependency>
>               <dependency>
>                       <groupId>oro</groupId>
>                       <artifactId>oro</artifactId>
>                       <version>2.0.8</version>
>               </dependency>
>               <dependency>
>                       <groupId>org.springframework</groupId>
>                       <artifactId>spring-aop</artifactId>
>                       <version>2.0.1</version>
>               </dependency>
>               <dependency>
>                       <groupId>org.apache.servicemix</groupId>
>                       <artifactId>servicemix-jsr181</artifactId>
>                       <version>${servicemix-version}</version>
>               </dependency>
>               <dependency>
>                       <groupId>mycompany.framework</groupId>
>                       <artifactId>mycompany-shared</artifactId>
>                       <version>${myproject-version}</version>
>                       <scope>provided</scope>
>               </dependency>
>       </dependencies>
>       <build>
>               <plugins>
>                       <plugin>
>                               <groupId>org.apache.servicemix.tooling</groupId>
>                               <artifactId>jbi-maven-plugin</artifactId>
>                               <version>${servicemix-version}</version>
>                               <extensions>true</extensions>
>                               <configuration>
>                                       <type>service-unit</type>
>                                       
> <generateJbiDescriptor>false</generateJbiDescriptor>
>                               </configuration>
>                       </plugin>
>               </plugins>
>       </build>
> </project>
> </code>
> 
> Help is greatly appreciated!
> It would be really sad if one could not use Spring-AOP (AspectJ style).
> 
> Has anyone ever succeeded in getting this up and running?
> 
> Thanks a lot in advance!
> 
> Cheers,
> 
> Oliver.
> 
> 
> gnodet wrote:
>> 
>> Not really. Have you tried googling for the exception ?
>> 
>> On 6/26/07, oliver kuntze <[EMAIL PROTECTED]> wrote:
>>>
>>> Perfect! Thanks a lot, Guillaume!
>>>
>>> When trying to deploy the advised SU I get the following exception:
>>>
>>> <code>
>>> org.springframework.beans.factory.BeanCreationException: Error creating
>>> bean
>>> with name 'org.springframework.aop.config.internalAutoProxyCreator':
>>> Initialization of bean failed; nested exception is
>>> java.lang.AbstractMethodError:
>>> org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator.
>>> findCandidateAdvisors()Ljava/util/List;
>>> </code>
>>>
>>> Still trying...
>>>
>>> Do you have any ideas???
>>>
>>> Thanks very much!
>>>
>>> Cheers,
>>>
>>> Oliver.
>>>
>>>
>>>
>>> gnodet wrote:
>>> >
>>> > On 6/26/07, oliver kuntze <[EMAIL PROTECTED]> wrote:
>>> >>
>>> >>
>>> >> Ok, I think I got it.
>>> >>
>>> >> When a SU is deployed to a ServiceMix component, the component
>>> creates a
>>> >> Spring application context and configures the app according to the
>>> >> xbean.xml. I.e. every SU is in fact a Spring application.
>>> >> That means out of the box one is able to use Spring AOP aspects per
>>> SU.
>>> >> If
>>> >> one would like to have aspects for his/her "eai application", that is
>>> for
>>> >> a
>>> >> whole bunch of SAs, than one should extend ServiceMix / Xbean 
>>> somehow so
>>> >> that a "global" xbean config containing the aspects is added to the
>>> >> ApplicationContext when the XBean SpringLoader has loaded the
>>> xbean.xml.
>>> >> Correct?
>>> >
>>> >
>>> > Exactly !
>>> >
>>> > I tried to deploy a SU with an aspect but received the following
>>> > exception:
>>> >> BeanDefinitionStoreException: Unrecognized xbean namespace mapping:
>>> >> http://www.springframework.org/schema/aop
>>> >>
>>> >> My xbean.xml looks like this:
>>> >> <code>
>>> >> <?xml version="1.0" encoding="UTF-8"?>
>>> >> <beans xmlns="http://www.springframework.org/schema/beans";
>>> >>         xmlns:jsr181="http://servicemix.apache.org/jsr181/1.0";
>>> >>        
>>> xmlns:swifttransformation="http://mycompany/swifttransformation";
>>> >>         xmlns:aop="http://www.springframework.org/schema/aop";>
>>> >>
>>> >>         <aop:aspectj-autoproxy/>
>>> >>         <bean class="
>>> >> mycompany.playground.swifttransformation.MonitoringAspect"
>>> >> id="swiftTransformationMonitoringAspect"/>
>>> >>
>>> >>         <jsr181:endpoint endpoint="swift2xml"
>>> >>                 service="swifttransformation:iso15022-transformation"
>>> >>
>>> >> serviceInterface="
>>> >> mycompany.playground.swifttransformation.SwiftToXmlTransformer"
>>> >>                 typeMapping="xmlbeans">
>>> >>                 <jsr181:pojo>
>>> >>                         <bean
>>> >>
>>> class="mycompany.playground.swifttransformation.SwiftToXmlTransformerImpl"
>>> >> />
>>> >>                 </jsr181:pojo>
>>> >>         </jsr181:endpoint>
>>> >> </beans>
>>> >> </code>
>>> >>
>>> >> The spring.handler file in the spring-beans-2.0.1.jar of my
>>> ServiceMix
>>> >> distribution contains the following line:
>>> >> http\://www.springframework.org/schema/aop=
>>> >> org.springframework.aop.config.AopNamespaceHandler
>>> >>
>>> >> So everything seems to be in place.
>>> >>
>>> >> Any ideas why I get the exception?
>>> >
>>> >
>>> > I don't know why the handler is defined in spring-beans while the
>>> > associated
>>> > class is not.
>>> > You should put spring-aop in the SU by adding it to your pom.xml.
>>> > It should do the trick.
>>> >
>>> > Thanks a lot for helping a newbie out!
>>> >>
>>> >> Cheers,
>>> >>
>>> >> Oliver.
>>> >>
>>> >>
>>> >> gnodet wrote:
>>> >> >
>>> >> > I'm not sure to understand all the problems.
>>> >> > If I had to do AOP inside a SU, I would just consider the SU as a
>>> >> spring
>>> >> > application (even if it has to contain a JBI endpoint).
>>> >> > You can put additional jars needed in the SU and you should be able
>>> to
>>> >> use
>>> >> > AOP.  You don't really need to hack the components
>>> >> > or the main configuration file.
>>> >> >
>>> >> > Or maybe you want to do AOP without configuring it explicitely ?
>>> This
>>> >> is
>>> >> > currently not possible.  I think it should be doable by extending
>>> >> > the components somehow so that they always load other spring
>>> >> configuration
>>> >> > files: for example when a component creates a spring
>>> >> > ApplicationContext when loading a xbean.xml, it could be configured
>>> to
>>> >> > always load an aop.xml configuration file that you would provide
>>> >> > and which would add all the needed definitions.
>>> >> >
>>> >>
>>> >> --
>>> >> View this message in context:
>>> >>
>>> http://www.nabble.com/Spring-AOP-integration-in-ServiceMix-tf3975690s12049.html#a11303312
>>> >> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>> >>
>>> >>
>>> >
>>> >
>>> > --
>>> > Cheers,
>>> > Guillaume Nodet
>>> > ------------------------
>>> > Principal Engineer, IONA
>>> > Blog: http://gnodet.blogspot.com/
>>> >
>>> >
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Spring-AOP-integration-in-ServiceMix-tf3975690s12049.html#a11305922
>>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>>
>>>
>> 
>> 
>> -- 
>> Cheers,
>> Guillaume Nodet
>> ------------------------
>> Principal Engineer, IONA
>> Blog: http://gnodet.blogspot.com/
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Spring-AOP-integration-in-ServiceMix-tf3975690s12049.html#a11322643
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to