5 Replies Latest reply on Jan 4, 2005 4:20 AM by john.howard9

    eclipse classpath problem

    john.howard9

      Has anyone any experience in trying to use AOP with an Eclipse RCP application.

      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)
       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)FATAL ERROR in native method: processing of -javaagent failed
      
       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"


        • 1. Re: eclipse classpath problem
          john.howard9

          Sorry hit submit instead of preview.

          I'm trying to use AOP with the JDK1.5 and I can get this to work standalone but not within an eclipse runtime environment so I assume this is down to Eclipse's management of the classpath. Just not sure of the best solution to the problem. Is it possible to programatically load the javaagent or does this have to be done at launch time? Can I specify the boot class path? I tried changing the jboss-aop-jdk50.jar to add a Boot-Class-Path to the Manifest, but this had no effect.

          Thanks,

          John.

          • 2. Re: eclipse classpath problem

            Which version of Eclipse does support JDK 1.5 ?
            I am curious because I have being using NETBEANS for a couple of
            months because it was one of the first IDE to provide a full support
            of JDK 1.5.I use NETBEANS with JBOSS-AOP without any issue.

            To go back to your question with Eclipse ,VM arguments can be changed using the menu : RUN->RUN and then Arguments.



            • 3. Re: eclipse classpath problem
              john.howard9

              I'm using 3.1 M4, I wouldn't say there is full support yet, but it's pretty close. I've had no problems with the features of 1.5 I've used.

              Back to the question. I've messed around with the arguments and got the javaagent recognized, it's then getting the classpath right. I hate this in eclipse, it is the one thing that always seens to cause me problems. sigh! I have no problems with plain Java applications that all works, but with the Eclipse application I'm just not sure how to specify the boot class path, which is what I assume I need to set. There is a field for bootstrap entries, but I have no idea if this is what I need to set or whta the expected syntax is.

              • 4. Re: eclipse classpath problem

                I have also no problem with the version of Eclipse that u mentioned in your email...It works for me with JDK 1.5.

                I added the following in the VM arguments dialog-box
                under RUN->RUN Menu
                Arguments Tab
                -javaagent:C:\dev-applications\jboss-aop_1.0.0-FINAL\lib-50\jboss-aop-jdk50.jar -Djboss.aop.verbose=true
                -Djboss.aop.path=jboss-aop.xml

                Thx .

                • 5. Re: eclipse classpath problem
                  john.howard9

                  Was this an eclipse application? I could get a normal java application to run, but for that the classpath is freely available. My understanding was that for a eclipse application the classpath is handled by eclipse's classloader, presumably so it can load plugins transparently. I did finally get this going by editing the jboss-aop-jdk50.jar and adding a Boot-Class-Path, but this seems hardly ideal and I am getting a number of non fatal exceptions when some classes can't be found. It is a bit like stumbling around in the dark at the moment as I am not really sure how the javaagent interacts with the classloaders. I'm assuming that there is some dependancy as for a java application I don't get any class not found exceptions.

                  Cheers,

                  John.