0

We are migrating from JBoss 5 to WildFly 8.2. Still using Spring 3.1. Suddenly none of our aspects can be found when application starts. We might have solved (partially) the XML configuration (by placing more wildcards around), but annotation based configuration of aspects cannot be solved the same way (no wildcard possible for aspect itself since this is annotated class). Here is the Aspect class definition:

package com.mycompany.session;
@Aspect
@Component("mySessionManager")
public class SessionManager {

  // intercepting any class, any method starting with com.mycompany.some
  @Pointcut("execution(* com.mycompany.some.*.*(..))")
  public void myPointcut() {}

  @Around(value="myPointcut()")
  public Object process(ProceedingJoinPoint jointPoint)
    throws Throwable
  { ... the rest of code }
}

When starting this code without changes under WildFly we get this error:

java.lang.IllegalArgumentException: warning can't determine implemented interfaces of missing type com.mycompany.session.SessionManager

Anything wrong with code? Anything needs to be different in WildFly versus older jboss?

Thanks, Nikolay

Nikolay
  • 101
  • 1
  • 8
  • It all depends on classloading : where are your spring jars ? Can they 'see' the annotated classes ? What kind of application are you in war/ ear /war + ejbs ? this is really a complex matter. – ehsavoie Jan 26 '15 at 07:40
  • Simple application, single WAR file, all JARs are packages inside WEB-INF/lib, including all Spring jars. No EJB. The sample I placed above is in fact loaded by Spring and also auto-wired (there are @Autowire annotations that I skipped). This means that Spring actually accesses this class. What I am surprised to see that AOP portion of Spring does no see the class. Maybe AOP loads before Spring does its package scan? I am puzzled – Nikolay Jan 26 '15 at 19:23
  • Used all new Spring 4.1.* with all new resteasy versions provided by wildfly. This worked as a charm. – Nikolay Jan 26 '15 at 22:54
  • Hi Nikolay, I tried to use WildFly with Spring DI unsuccessfully (http://stackoverflow.com/questions/27759416/spring-dependency-injection-with-wildfly); I saw your question today because I am now trying to use AOP with WildFly, is your config xml-less or you still need some xml files? – Maxime Laval Feb 10 '15 at 21:32
  • Sorry to respond late. I use XML and Annotations in project (not my choice). I was able to use spring aop with higher version of spring (3.2.x) but I have not tried to use annotation without XML to instantiate aspect bean. This is no longer needed, we only need XML aspects at the moment. I hope this answers your question – Nikolay Feb 23 '15 at 16:43

0 Answers0