title: Spring Aop Error of formal unbound pointcut
body: <p>Hi i am using spring Aop in my application i am getting an error for following lines of code
  LoggingAspect.java</p>
  
  <pre><code>@Aspect
  public class LoggingAspect {
      @Before("allCircleMethods()")
      public void loggingAdvice(Joinpoint joinPoint)
      {
          System.out.println("get method is called"+joinPoint.toString() );
      }
  
      @Pointcut("execution(* get*())")
      public void allGetters(){}
  
  
      @Pointcut("within(org.com.revanth.model.Circle)")
      public void allCircleMethods(){}
  }
  </code></pre>
  
  <p>Circle.java</p>
  
  <pre><code>public class Circle {
  
      private String name;
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
  }
  </code></pre>
  
  <p>Traingle.java</p>
  
  <pre><code>public class Traingle {
  
      private String name;
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
  }
  </code></pre>
  
  <p>ShapeService.java</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;beans xmlns="http://www.springframework.org/schema/beans"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xmlns:context="http://www.springframework.org/schema/context"
           xmlns:aop="http://www.springframework.org/schema/aop"  
      xsi:schemaLocation="http://www.springframework.org/schema/beans  
      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd   
      http://www.springframework.org/schema/aop   
      http://www.springframework.org/schema/aop/spring-aop-3.0.xsd "&gt;
  
  &lt;aop:aspectj-autoproxy&gt;&lt;/aop:aspectj-autoproxy&gt;
  
     &lt;bean name="triangle" class="org.com.revanth.model.Triangle"&gt;
          &lt;property name="name" value="Traingle Name"&gt;&lt;/property&gt;
     &lt;/bean&gt;
  
      &lt;bean name="circle" class="org.com.revanth.model.Circle"&gt;
          &lt;property name="name" value="Circle Name"&gt;&lt;/property&gt;
     &lt;/bean&gt;
  
     &lt;bean name="shapeService" class="org.com.revanth.service.ShapeService" autowire="byName"/&gt;   
     &lt;bean name="loggingAspect" class="org.com.revanth.aspect.LoggingAspect"&gt;&lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>AopMain.java</p>
  
  <pre><code>public class AopMain {
  
      public static void main(String[] args) {
          // TODO Auto-generated method stub
          ApplicationContext ctx = new ClassPathXmlApplicationContext("spring.xml");
          ShapeService shapeService = (ShapeService) ctx.getBean("shapeService", ShapeService.class);
          System.out.println(shapeService.getCircle().getName());
      }
  
  }
  </code></pre>
  
  <p>I am getting an error of formal unbound in pointcut expression.the error stack trace is as follows:</p>
  
  <pre><code>WARNING: Exception encountered during context initialization - cancelling refresh attempt: 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 
  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:553)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:776)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
      at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:139)
      at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:83)
      at org.com.revanth.AopMain.main(AopMain.java:11)
  Caused by: java.lang.IllegalArgumentException: error at ::0 formal unbound in pointcut 
      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.checkReadyToMatch(AspectJExpressionPointcut.java:193)
      at org.springframework.aop.aspectj.AspectJExpressionPointcut.getClassFilter(AspectJExpressionPointcut.java:170)
      at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:220)
      at org.springframework.aop.support.AopUtils.canApply(AopUtils.java:279)
      at org.springframework.aop.support.AopUtils.findAdvisorsThatCanApply(AopUtils.java:311)
      at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findAdvisorsThatCanApply(AbstractAdvisorAutoProxyCreator.java:118)
      at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.findEligibleAdvisors(AbstractAdvisorAutoProxyCreator.java:88)
      at org.springframework.aop.framework.autoproxy.AbstractAdvisorAutoProxyCreator.getAdvicesAndAdvisorsForBean(AbstractAdvisorAutoProxyCreator.java:69)
      at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:347)
      at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:299)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:422)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1583)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
      ... 11 more
  </code></pre>
  
  <p>Can anyone help me please to solve the above error?Any help would be appreciated.</p>