title: Is AspectJ required on the classpath when weaving at compile-time?
body: <p>I asked <a href="https://stackoverflow.com/questions/14285591/weaving-in-tostring-implementation-with-aspectj">this question</a> a few days ago, and managed to get it working using compile-time weaving.</p>
  
  <p>However, when the application runs and it invokes the toString() method which I mixed into my DTO via AOP, I get the exception below.</p>
  
  <p>I didn't expect AspectJ to be required in the runtime classpath. After all, I've used compile-time weaving, so the bytecode should already be in its final state, right? Why is AspectJ expected to be present at runtime?</p>
  
  <pre><code>java.lang.ClassNotFoundException: org.aspectj.lang.NoAspectBoundException
      at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:506)[osgi-3.6.2.R36x_v20110210.jar:]
      at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)[osgi-3.6.2.R36x_v20110210.jar:]
      at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)[osgi-3.6.2.R36x_v20110210.jar:]
      at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)[osgi-3.6.2.R36x_v20110210.jar:]
      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)[:1.6.0_35]
      ... 51 more
  </code></pre>
  
  <p>Is there a way to instruct AspectJ to drop all references to itself in the resulting bytecode?</p>
  
  <p>N.B.: I'm running in an OSGi environment - but that's definitely irrelevant.</p>