AspectJ and NoClassDefFoundError
<p>I have problem with <a href="http://en.wikipedia.org/wiki/AspectJ" rel="nofollow">AspectJ</a>. Has anyone have encountered anything similar? I have listing:</p>

<blockquote>
  <p>../src/java/com/ws/db/Logging.aj</p>
  
  <p>../src/java/com/ws/db/Db.java</p>
</blockquote>

<p>And aspect:</p>

<pre><code>  public aspect Logging {

      pointcut prepareCall(String statement): call(* java.sql.Connection.prepareCall(String)) &amp;&amp; args(statement) &amp;&amp;
      within(com.ws.db.Db);

      before(String statement) : prepareCall(statement) {
        if(logger.isDebugEnabled())
          logger.debug("before prepareCall called: statement="+statement);
      }

      after(String statement) : prepareCall(statement) {
        if(logger.isDebugEnabled())
          logger.debug("after prepareCall called, "+statement);
      }
  }
</code></pre>

<p>Everything works OK, but when I add this</p>

<pre><code>   pointcut createStm(): call(* java.sql.Connection.createStatement()) &amp;&amp;
   within(com.ws.db.Db);

   before() : createStm()  {
     if(logger.isDebugEnabled())
       logger.debug("before called: "+thisJoinPoint);
   }

   after() : createStm() {
     if(logger.isDebugEnabled())
       logger.debug("after called: "+thisJoinPoint);
   }
</code></pre>

<p>I get the following exception:</p>

<p>And it's not able to find com.ws.db.Db, like the class is changed and it's not able to retrieve it.</p>

<pre><code>    &gt; org.apache.axis.EXCEPTIONS 2009-11-09 16:06:39,748 -- INFO -- Exception:
    java.lang.NoClassDefFoundError
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:242)
    at org.apache.axis.utils.ClassUtils$2.run(ClassUtils.java:177)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.axis.utils.ClassUtils.loadClass(ClassUtils.java:160)
    at org.apache.axis.utils.ClassUtils.forName(ClassUtils.java:142)
    at org.apache.axis.utils.cache.ClassCache.lookup(ClassCache.java:85)
    at org.apache.axis.providers.java.JavaProvider.getServiceClass(JavaProvider.java:428)
    at org.apache.axis.providers.java.JavaProvider.initServiceDesc(JavaProvider.java:461)
    at org.apache.axis.handlers.soap.SOAPService.getInitializedServiceDesc(SOAPService.java:286)
    at org.apache.axis.deployment.wsdd.WSDDService.makeNewInstance(WSDDService.java:500)
    at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getNewInstance(WSDDDeployableItem.java:274)
    at org.apache.axis.deployment.wsdd.WSDDDeployableItem.getInstance(WSDDDeployableItem.java:260)
    at org.apache.axis.deployment.wsdd.WSDDDeployment.getService(WSDDDeployment.java:427)
    at org.apache.axis.configuration.FileProvider.getService(FileProvider.java:231)
    at org.apache.axis.AxisEngine.getService(AxisEngine.java:311)
    at org.apache.axis.MessageContext.setTargetService(MessageContext.java:756)
    at org.apache.axis.handlers.http.URLMapper.invoke(URLMapper.java:50)
    at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    at org.apache.axis.server.AxisServer.invoke(AxisServer.java:239)
    at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
    at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:595)
</code></pre>
