title: Exception while using PointCut in spring
body: <p>Aspect Class: </p>
  
  <pre><code> import org.aspectj.lang.annotation.AdviceName;
   import org.aspectj.lang.annotation.Aspect;
   import org.aspectj.lang.annotation.Before;
   import org.aspectj.lang.annotation.Pointcut;
  
  @Aspect
  public class LoggingAspect {
  
  
  @Before("allCircleMethods()")
  public void LoggingAdvice() {
      System.out.println("Advice Run: Get Method Called:");
  }
  
  @Before("args(String)")
  public void StringArgumentMethod(String name) {
      System.out.println("Method That takes String Argument is calling  value of that string is "+name);
  }
  
  @Pointcut("execution(* get*())")
  public void allGetters(){}
  
  @Pointcut("within(com.cisco.kapil.model.Circle)")
  public void allCircleMethods() {}    }
  </code></pre>
  
  <p>Main Class:</p>
  
  <pre><code> public class AopMain {
  public static void main(String args[]) {
      ApplicationContext ctx = new ClassPathXmlApplicationContext("spring.xml");
      ShapeService shapeservice = ctx.getBean("ShapeService", ShapeService.class);
      shapeservice.getCircle().setName("My Own Circle");
      //System.out.println(shapeservice.getCircle().getName());
  }   }
  </code></pre>
  
  <p>Shape Class:</p>
  
  <pre><code>public class ShapeService {
  private Circle circle;
  private Triangle  triangle;
  
  public Circle getCircle() {
      return circle;
  }
  public void setCircle(Circle circle) {
      this.circle = circle;
  }
  public Triangle getTriangle() {
      return triangle;
  }
  public void setTriangle(Triangle triangle) {
      this.triangle = triangle;
  } }
  </code></pre>
  
  <p>Spring.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
    &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:aop="http://www.springframework.org/schema/aop"
      xmlns:context="http://www.springframework.org/schema/context"
      xsi:schemaLocation="http://www.springframework.org/schema/beans          http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
              http://www.springframework.org/schema/aop   http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
              http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd"&gt;
  
   &lt;aop:aspectj-autoproxy /&gt;
      &lt;bean name="Triangle" class="com.cisco.kapil.model.Triangle"&gt;
          &lt;property name="name" value="Triangle name" /&gt;
      &lt;/bean&gt;
  
  
     &lt;bean name="circle" class="com.cisco.kapil.model.Circle"&gt;
          &lt;property name="name" value="Circle Name" /&gt;
     &lt;/bean&gt;
  
      &lt;bean name="ShapeService" class="com.cisco.kapil.service.ShapeService" autowire="byName" /&gt;
  
      &lt;bean name="LoggingAspect" class="com.cisco.kapil.aspect.LoggingAspect" /&gt;
      &lt;/beans&gt;
  </code></pre>
  
  <p>Circle:</p>
  
  <pre><code>public class Circle {
  private String name;
  
  public String getName() {
      return name;
  }
  
  public void setName(String name) {
      this.name = name;
      System.out.println("Circle Setter is called");
  }  }
  </code></pre>
  
  <p>Triangle:</p>
  
  <pre><code>public class Triangle {
  private String name;
  
  public String getName() {
      return name;
  }
  
  public void setName(String name) {
      this.name = name;
  }  }
  </code></pre>
  
  <p>Exception: </p>
  
  <pre><code>INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@536d00: defining beans [org.springframework.aop.config.internalAutoProxyCreator,Triangle,circle,ShapeService,LoggingAspect]; root of factory hierarchy
  Jul 04, 2015 2:33:16 AM org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
  INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@536d00: defining beans [org.springframework.aop.config.internalAutoProxyCreator,Triangle,circle,ShapeService,LoggingAspect]; root of factory hierarchy
  Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'Triangle' defined in class path resource [spring.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: error at ::0 formal unbound in pointcut 
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
  </code></pre>