title: java.lang.IllegalArgumentException: warning no match for this type name: ru.sbt.filial.cards.aspect.SomeBean [Xlint:invalidAbsoluteTypeName]
body: <p>I never used Spring AOP and trying to configure my first bean. It seems that I configured it properly, but I get an exception that the bean is not found. </p>
  
  <p>My aspect is – </p>
  
  <pre><code>@Aspect
  @Component
  public class IdentificationAspect {
  
      @Before("execution(* ru.sbt.filial.cards.aspect.SomeBean.*(..))")
      public void logBefore(JoinPoint joinPoint) throws Throwable {
  
          System.out.println("logBefore() is running!");
          System.out.println("hijacked : " + joinPoint.getSignature().getName());
          System.out.println("******");
      }
  }
  </code></pre>
  
  <p>And my bean that AOP doesn't find is - </p>
  
  <pre><code>package ru.sbt.filial.cards.aspect;
  
  import org.springframework.stereotype.Component;
  
  @Component
  public class SomeBean {
  
      public void printSmth() {
         System.out.println("!!!!!!!!!!!");
      }
  
  }
  </code></pre>
  
  <p>I've got the following exception - </p>
  
  <pre><code>Caused by: java.lang.IllegalArgumentException: warning no match for this type name: ru.sbt.filial.cards.aspect.SomeBean [Xlint:invalidAbsoluteTypeName]
                  at org.aspectj.weaver.tools.PointcutParser.parsePointcutExpression(PointcutParser.java:301)
                  at org.springframework.aop.aspectj.AspectJExpressionPointcut.buildPointcutExpression(AspectJExpressionPointcut.java:207)
                  at org.springframework.aop.aspectj.AspectJExpressionPointcut.getFallbackPointcutExpression(AspectJExpressionPointcut.java:358)
                  at org.springframework.aop.aspectj.AspectJExpressionPointcut.matches(AspectJExpressionPointcut.java:255)
                  at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:208)
                  at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:262)
                  at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:294)
                  at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:117)
                  at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:87)
                  at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:68)
                  at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:356)
                  at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:319)
                  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:412)
                  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.postProcessObjectFromFactoryBean(AbstractAutowireCapableBeanFactory.java:1629)
                  at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:162)
                  ... 165 more
  </code></pre>
  
  <p>I have following maven dependencies - </p>
  
  <pre><code>              &lt;dependency&gt;
                  &lt;groupId&gt;org.springframework&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-aop&lt;/artifactId&gt;
                  &lt;version&gt;3.2.0.RELEASE&lt;/version&gt;
                &lt;/dependency&gt;
                &lt;dependency&gt;
                  &lt;groupId&gt;org.aspectj&lt;/groupId&gt;
                  &lt;artifactId&gt;aspectjweaver&lt;/artifactId&gt;
                  &lt;version&gt;1.7.3&lt;/version&gt;
                &lt;/dependency&gt;
                &lt;dependency&gt;
                  &lt;groupId&gt;org.aspectj&lt;/groupId&gt;
                  &lt;artifactId&gt;aspectjrt&lt;/artifactId&gt;
                  &lt;version&gt;1.7.3&lt;/version&gt;
                &lt;/dependency&gt;
  </code></pre>
  
  <p>And my spring applicationContext.xml configuration is - </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
     xmlns:mvc="http://www.springframework.org/schema/mvc"
     xmlns:aop="http://www.springframework.org/schema/aop"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://www.springframework.org/schema/beans
                           http://www.springframework.org/schema/beans/spring-beans.xsd
                           http://www.springframework.org/schema/mvc
                  http://www.springframework.org/schema/mvc/spring-mvc.xsd
                           http://www.springframework.org/schema/context
                  http://www.springframework.org/schema/context/spring-context-3.2.xsd
                           http://www.springframework.org/schema/aop
                  http://www.springframework.org/schema/aop/spring-aop-3.0.xsd"&gt;
  
  &lt;mvc:annotation-driven/&gt;
  &lt;aop:aspectj-autoproxy/&gt;
  
  &lt;bean id="someBean" class="ru.sbt.filial.cards.aspect.SomeBean"&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>UPDATE</strong> 
  I added to my Spring configuration line</p>
  
  <pre><code>&lt;context:component-scan base-package="ru.sbt.filial.cards.aspect"/&gt;
  </code></pre>
  
  <p>but still same message. I also tried to annotate different ways - if I don't specify the bean i.e. write -</p>
  
  <pre><code>@Before("execution(* ru.sbt.filial.cards.aspect.*.*(..))")
  </code></pre>
  
  <p>instead </p>
  
  <pre><code>@Before("execution(* ru.sbt.filial.cards.aspect.SomeBean.*(..))")
  </code></pre>
  
  <p>I have no error on loading, but aop method is not invoked. </p>
  
  <p>I also tried to annotate like this</p>
  
  <pre><code>@Before("this(ru.sbt.filial.cards.aspect.SomeBean) and execution(* printSmth(..))") 
  </code></pre>
  
  <p>but with same result - no match for this type name. Any more ideas??</p>