Hi,

I'm trying to use Spring AOP in my ServiceMix runtime.

Since I'm apparently doing something basic terribly wrong, it would be great
if you could help me out with some info.

I have an aspect like this:

<code>
package de.mycompany.myproject;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;

@Aspect
public class MonitoringAspect {
        @Pointcut("execution(* de.mycompany.myproject..*.*(..)))")
        public Object doSomething() {
                throw new RuntimeException("Im doSomething Advice!!!");
        }
}
</code>

Furthermore I have a corresponding xbean file:

<code>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"; 
        xmlns:aop="http://www.springframework.org/schema/aop"; 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; >
        <aop:aspectj-autoproxy/>
        <bean class="de.mycompany.myproject.MonitoringAspect"
id="swiftTransformationMonitoringAspect"/>
</beans>
</code>

And finally I have a POM 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</groupId>
                <artifactId>sandbox</artifactId>
                <version>1.0</version>
        </parent>

<groupId>oliver.osiris.playground.sandbox.swifttransformation-monitoring</groupId>
        <artifactId>swifttransformation-aspect</artifactId>
        <name>Osiris :: sandbox :: swifttransformation-monitoring ::
swifttransformation-aspect</name>
        <packaging>jbi-shared-library</packaging>
        <version>1.0</version>
        <url>${site.root}//sandbox/</url>
        <dependencies>
                <dependency>
                        <groupId>aspectj</groupId>
                        <artifactId>aspectjrt</artifactId>
                        <version>1.5.3</version>
                </dependency>
        </dependencies>
        <build>
                <plugins>
                        <plugin>
                                <groupId>org.apache.servicemix.tooling</groupId>
                                <artifactId>jbi-maven-plugin</artifactId>
                                <version>${servicemix-version}</version>
                                <extensions>true</extensions>
                        </plugin>
                </plugins>
        </build>
</project>
</code>

So what I am doing is: Using the POM to build a ServiceMix shared library
containing the aspect class and the Spring xbean configuration.

Unfortunately the advice ist never executed.

What am I doing wrong?

Thanks a lot in advance for your help!

Cheers,

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

Reply via email to