title: Pointcut expression issues in Logging, Spring AOP with log4j
body: <p>I have to apply logging info for all the methods belonging to package and sub-packages for com.mycomp.** .I have tried lots of pointcuts given in spring reference manual but sadly no one is working out for me.
  I am using </p>
  
  <pre><code>@Pointcut("execution(* com.mycomp..(..))")
  private void businessService() {}  // signature
  </code></pre>
  
  <p>what I am getting is </p>
  
  <pre><code>Caused by: java.lang.IllegalArgumentException: Pointcut is not well-formed: expecting
  'name pattern cannot finish with ..' at character position 27
   execution(* com.mycomp..(..))
  </code></pre>
  
  <p>In the documentation it is given that</p>
  
  <pre><code> @Pointcut("execution( com.xyz.someapp..service..(..))")
  </code></pre>
  
  <p>I have tried using execution(com.mycomp..(..)) but got a similar Exception.</p>
  
  <p>On using the pointcut @Around(value="execution(* xyz.package.foo.bar..*(..))")  as suggested by James I am getting new kind of exception  when I starting the server.</p>
  
  <pre><code>   Caused by: java.lang.IllegalStateException: Cannot convert value of type [$Proxy76 implementing org.springframework.context.ApplicationContextAware,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.mycompname.BancsContextAware] for property 'bancsContextAware': no matching editors or conversion strategy found
  at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:264)
  at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:448)
  ... 57 more
  </code></pre>
  
  <p>Later on debugging I found out that in one of the classes I was using object.getClass().getAnnotation() and the proxy object which is created by spring AOP does not have annotation. Because of that only I was getting a null pointer exception. I sorted that using AopProxyUtils.ultimateTargetClass(someObject) 
  but now the problem is that I have some final classes and enum inside sub-packages of com.mycom.. because of this I am getting</p>
  
  <pre><code>nested exception is org.springframework.aop.framework.AopConfigException: 
  Could not generate CGLIB subclass of class [class com.mycom.util.BancsServiceProvider]: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: Cannot subclass final class class com.mycom.util.BancsServiceProvider
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:529)
  </code></pre>
  
  <p>So how to exclude final classes and enum from Spring AOP pointcut.</p>