<--Back

Every project using JBoss AOP needs several JAR files. You defined a classpath variable in Eclipse Classpath Variable for JBoss AOP. We now need to use that classpath variable:

  1. Select your project, right-click and select Properties (Alt-Enter on PC)
  2. Select Java Build Path
  3. Select the Libraries tab
  4. Click on Add Variable
  5. Select the variable you created (called JBOSS_AOP_LIB)
  6. Click Extend
  7. Select all JAR files listed (Ctrl-A on PC)
  8. Click OK
  9. Click OK

You'll need to do this for each project you create. If you don't you'll see a long stack trace that resembles the following:
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:141)
Caused by: java.lang.NoClassDefFoundError: javassist/ClassPool
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:620)FATAL ERROR in native method: processing of -javaagent failed
 
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    at org.jboss.aop.standalone.Agent.premain(Agent.java:41)
    ... 5 more
Exception in thread "main" 
<--Back