Spring Tool Suite
  1. Spring Tool Suite
  2. STS-1950

Gradle STS support: Test fails to run in IDE due to ClassNotFound even though Gradle Dependencies container shows the class to be on the classpath

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7.0.RELEASE
    • Fix Version/s: 2.9.0.M1
    • Component/s: GRADLE
    • Labels:

      Description

      Project: Spring Social, a multi-module build
      Module effected: spring-social-web
      Test that fails with ClassNotFoundException: org.springframework.social.connect.web.ConnectSupportTest
      Class in error: Says "javax.servlet.http.HttpServletRequest" - despite the fact servlet-api-2.5.jar is a "Gradle Dependency" and the class is there.

      Somewhat unrelated, for some reason STS (2.7) is also not allowing me to run this class "as a unit test". I'm having to run it by selecting the src/test/java folder and running that folder.

      java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest
      	at java.lang.ClassLoader.defineClass1(Native Method)
      	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
      	at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
      	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
      	at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
      	at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
      	at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      	at java.lang.Class.getDeclaredMethods0(Native Method)
      	at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
      	at java.lang.Class.getMethod0(Class.java:2670)
      	at java.lang.Class.getMethod(Class.java:1603)
      	at org.junit.internal.builders.SuiteMethodBuilder.hasSuiteMethod(SuiteMethodBuilder.java:20)
      	at org.junit.internal.builders.SuiteMethodBuilder.runnerForClass(SuiteMethodBuilder.java:13)
      	at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
      	at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
      	at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
      	at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
      	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.<init>(JUnit4TestReference.java:33)
      	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.<init>(JUnit4TestClassReference.java:25)
      	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48)
      	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
      Caused by: java.lang.ClassNotFoundException: javax.servlet.http.HttpServletRequest
      	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      	... 30 more
      

        Activity

        Hide
        Mauro Molinari added a comment -

        I have the same problem.

        Kris please fix this, because it's very hard to work without having the possibility to run unit tests from the IDE!

        Show
        Mauro Molinari added a comment - I have the same problem. Kris please fix this, because it's very hard to work without having the possibility to run unit tests from the IDE!
        Hide
        Kris De Volder (c) added a comment -

        I haven't been able to reproduce the problem. Mainly because I don't have enough information on how to setup a problem scenario.

        Any chance you could provide a bit more detail on how to setup a project that demonstrates the issue?

        Show
        Kris De Volder (c) added a comment - I haven't been able to reproduce the problem. Mainly because I don't have enough information on how to setup a problem scenario. Any chance you could provide a bit more detail on how to setup a project that demonstrates the issue?
        Hide
        Mauro Molinari added a comment -

        I do not have tested on a small test case, however the situation is this:

        • you have a gradle multi-project
        • one of the projects has a dependency against JUnit and another JAR
        • this project has a test case produced with JUnit 4 which uses a class from that JAR
        • try to Run As => JUnit test that file => first of all Eclipse says it can't find a class from JUnit; so I add the JUnit library to the project classpath (although I shouldn't need to do that, since I have JUnit in the Gradle dependencies)
        • however, once solved the first problem, the following problem is that the Eclipse JUnit runner says it can't find any class from the other JAR although it is in the Gradle dependencies library

        I'll try to provide you a test case as soon as I can.

        Show
        Mauro Molinari added a comment - I do not have tested on a small test case, however the situation is this: you have a gradle multi-project one of the projects has a dependency against JUnit and another JAR this project has a test case produced with JUnit 4 which uses a class from that JAR try to Run As => JUnit test that file => first of all Eclipse says it can't find a class from JUnit; so I add the JUnit library to the project classpath (although I shouldn't need to do that, since I have JUnit in the Gradle dependencies) however, once solved the first problem, the following problem is that the Eclipse JUnit runner says it can't find any class from the other JAR although it is in the Gradle dependencies library I'll try to provide you a test case as soon as I can.
        Hide
        Kris De Volder (c) added a comment -

        Thanks for the description, I can work with that. I'll let you know if I have need of more info.

        Show
        Kris De Volder (c) added a comment - Thanks for the description, I can work with that. I'll let you know if I have need of more info.
        Hide
        Kris De Volder (c) added a comment - - edited

        Been able to reproduce the problem. I'll investigate a bit into the cause of the problem.

        I only get the ClassNotFound error while running tests, not getting the other problme you describe (i.e. I didn't need to add the junit library).

        Show
        Kris De Volder (c) added a comment - - edited Been able to reproduce the problem. I'll investigate a bit into the cause of the problem. I only get the ClassNotFound error while running tests, not getting the other problme you describe (i.e. I didn't need to add the junit library).
        Hide
        Mauro Molinari added a comment -

        If I don't add the JUnit library to my project, even though it has JUnit 4.4 in the Gradle Dependencies library, I get the following exception in the console and the Eclipse JUnit runner doesn't even start:

        java.lang.NoClassDefFoundError: org/junit/runner/notification/StoppedByUserException
        	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48)
        	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
        Caused by: java.lang.ClassNotFoundException: org.junit.runner.notification.StoppedByUserException
        	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        	at java.security.AccessController.doPrivileged(Native Method)
        	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        	at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        	... 6 more
        
        Show
        Mauro Molinari added a comment - If I don't add the JUnit library to my project, even though it has JUnit 4.4 in the Gradle Dependencies library, I get the following exception in the console and the Eclipse JUnit runner doesn't even start: java.lang.NoClassDefFoundError: org/junit/runner/notification/StoppedByUserException at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: java.lang.ClassNotFoundException: org.junit.runner.notification.StoppedByUserException at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang. ClassLoader .loadClass( ClassLoader .java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang. ClassLoader .loadClass( ClassLoader .java:248) ... 6 more
        Hide
        Kris De Volder (c) added a comment -

        After I run 'Gradle >> Refresh All' on the project containing the test class, the error goes away (subsequently, doing "run as >> Junit test" works correctly.

        I don't know yet why it doesn't work before the refresh...

        But it seems that for some reason the Gradle classpath container entries are not getting added to the classpath used by the Junit runner.

        Show
        Kris De Volder (c) added a comment - After I run 'Gradle >> Refresh All' on the project containing the test class, the error goes away (subsequently, doing "run as >> Junit test" works correctly. I don't know yet why it doesn't work before the refresh... But it seems that for some reason the Gradle classpath container entries are not getting added to the classpath used by the Junit runner.
        Hide
        Mauro Molinari added a comment - - edited

        Unfortunately, in my case issuing a "Refresh All" does not solve either of my problems... I see the exact same behaviour

        Another strange thing: now I have "Gradle Dependencies" for my project and in Run Configurations... | <my JUnit configuration< | Classpath | <my project> (default classpath) I have Gradle Dependencies... however I have the described problems.

        Previously I had "Gradle Dependencies (persisted)" instead and the same UI didn't even show any Gradle Dependencies library under the <my project> (default classpath) list...

        Show
        Mauro Molinari added a comment - - edited Unfortunately, in my case issuing a "Refresh All" does not solve either of my problems... I see the exact same behaviour Another strange thing: now I have "Gradle Dependencies" for my project and in Run Configurations... | <my JUnit configuration< | Classpath | <my project> (default classpath) I have Gradle Dependencies... however I have the described problems. Previously I had "Gradle Dependencies (persisted)" instead and the same UI didn't even show any Gradle Dependencies library under the <my project> (default classpath) list...
        Hide
        Kris De Volder (c) added a comment -

        I think I know what is causing this. The Gradle classpath container which returns a set of "persisted" entries is incorrectly treated as being 'uninitialized' and as such its classpath entries are not treated as 'application level' libraries. That causes them to be filtered out from the runtime classpath by the launcher.

        Solution is to ensure the container with persisted entries is correctly identifying itself as containing 'user' entries.

        Show
        Kris De Volder (c) added a comment - I think I know what is causing this. The Gradle classpath container which returns a set of "persisted" entries is incorrectly treated as being 'uninitialized' and as such its classpath entries are not treated as 'application level' libraries. That causes them to be filtered out from the runtime classpath by the launcher. Solution is to ensure the container with persisted entries is correctly identifying itself as containing 'user' entries.
        Hide
        Kris De Volder (c) added a comment -

        I've committed a fix.

        BTW: I was also getting this exception:
        java.lang.ClassNotFoundException: org.junit.runner.notification.StoppedByUserException

        I figured that this is really the same problem... after my fix now I can run the unit tests in my small sample gradle project (setup following your description).

        I am guessing that all the strange behaviors you describe could be related to the same bug. But perhaps not (since refresh dependencies, you say, doesn't solve it for you).

        Please try out the latest snapshot build. Should be available in about an hour or so from here:

        http://dist.springsource.com/snapshot/TOOLS/nightly/gradle/

        In the mean time I'm resolving this issue, but we can reopen if the fix doesn't seem to address the problem at your end.

        Show
        Kris De Volder (c) added a comment - I've committed a fix. BTW: I was also getting this exception: java.lang.ClassNotFoundException: org.junit.runner.notification.StoppedByUserException I figured that this is really the same problem... after my fix now I can run the unit tests in my small sample gradle project (setup following your description). I am guessing that all the strange behaviors you describe could be related to the same bug. But perhaps not (since refresh dependencies, you say, doesn't solve it for you). Please try out the latest snapshot build. Should be available in about an hour or so from here: http://dist.springsource.com/snapshot/TOOLS/nightly/gradle/ In the mean time I'm resolving this issue, but we can reopen if the fix doesn't seem to address the problem at your end.
        Hide
        Kris De Volder (c) added a comment -

        Build was successful update site should be up now.

        Show
        Kris De Volder (c) added a comment - Build was successful update site should be up now.
        Hide
        Mauro Molinari added a comment - - edited

        Hi Kris,
        I'm using 2.9.0.201111142313-SNAPSHOT from the nightly update site, but unfortunately I don't see any real benefit.
        I mean:

        • if I do not add the JUnit library to my project I now see the following error in the console:
        java.lang.NoClassDefFoundError: junit/framework/Test
        	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.isJUnit3SetUpTest(JUnit4TestLoader.java:58)
        	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:49)
        	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
        	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
        Caused by: java.lang.ClassNotFoundException: junit.framework.Test
        	at java.net.URLClassLoader$1.run(Unknown Source)
        	at java.security.AccessController.doPrivileged(Native Method)
        	at java.net.URLClassLoader.findClass(Unknown Source)
        	at java.lang.ClassLoader.loadClass(Unknown Source)
        	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        	at java.lang.ClassLoader.loadClass(Unknown Source)
        	... 7 more
        
        • if I do add the JUnit library to my project, the JUnit runner seems to start, but says it can't find a class required by the test case, which should be made available by a JAR in Gradle Dependencies

        Refreshing dependencies or "refreshing all" does not help yet

        Show
        Mauro Molinari added a comment - - edited Hi Kris, I'm using 2.9.0.201111142313-SNAPSHOT from the nightly update site, but unfortunately I don't see any real benefit. I mean: if I do not add the JUnit library to my project I now see the following error in the console: java.lang.NoClassDefFoundError: junit/framework/Test at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.isJUnit3SetUpTest(JUnit4TestLoader.java:58) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:49) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) Caused by: java.lang.ClassNotFoundException: junit.framework.Test at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang. ClassLoader .loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang. ClassLoader .loadClass(Unknown Source) ... 7 more if I do add the JUnit library to my project, the JUnit runner seems to start, but says it can't find a class required by the test case, which should be made available by a JAR in Gradle Dependencies Refreshing dependencies or "refreshing all" does not help yet
        Hide
        Mauro Molinari added a comment -

        Here is a project that reproduces the first problem (error in console if you don't add the JUnit library to the project, although JUnit4 is in the project B classpath thanks to the Gradle Dependencies).

        Do this:

        • unzip the attached project
        • import with the Gradle import wizard
        • go to testb.TestB in project B
        • right click in the editor, Run As => JUnit Test

        You'll see the first exception in the console.

        Unfortunately I was not able to reproduce the second problem: if I add the JUnit library to B, the test case works, although I would expect it to fail since it uses a classes from Glazed Lists JAR which is contributed by the Gradle Dependencies library...

        However I observed that once I removed project C (from settings.gradle of the root project and from the dependencies of build.gradle of project B) and the src/main/java folder of project A (which is useless for this demonstration), then the Run As => JUnit Test started to work perfectly, even without the need to add the JUnit library to project B...

        So, maybe also the second problem, which I'm not able to reproduce with this simple test case, is in some way bound to the fact that the project where I see it have a complex dependency graph between projects and something is triggering this strange behaviour...

        Show
        Mauro Molinari added a comment - Here is a project that reproduces the first problem (error in console if you don't add the JUnit library to the project, although JUnit4 is in the project B classpath thanks to the Gradle Dependencies). Do this: unzip the attached project import with the Gradle import wizard go to testb.TestB in project B right click in the editor, Run As => JUnit Test You'll see the first exception in the console. Unfortunately I was not able to reproduce the second problem: if I add the JUnit library to B, the test case works, although I would expect it to fail since it uses a classes from Glazed Lists JAR which is contributed by the Gradle Dependencies library... However I observed that once I removed project C (from settings.gradle of the root project and from the dependencies of build.gradle of project B) and the src/main/java folder of project A (which is useless for this demonstration), then the Run As => JUnit Test started to work perfectly, even without the need to add the JUnit library to project B... So, maybe also the second problem, which I'm not able to reproduce with this simple test case, is in some way bound to the fact that the project where I see it have a complex dependency graph between projects and something is triggering this strange behaviour...
        Hide
        Kris De Volder (c) added a comment -

        Thanks for sample project. I am able to reproduce the problem with that. Seems I am getting a slightly different error message:

        java.lang.NoClassDefFoundError: org/junit/runner/notification/StoppedByUserException
        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48)

        But probably all of these are connected. All points to some problems getting the jars from the Gradle classpath container onto the junit runners classpath.

        Show
        Kris De Volder (c) added a comment - Thanks for sample project. I am able to reproduce the problem with that. Seems I am getting a slightly different error message: java.lang.NoClassDefFoundError: org/junit/runner/notification/StoppedByUserException at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48) But probably all of these are connected. All points to some problems getting the jars from the Gradle classpath container onto the junit runners classpath.
        Hide
        Mauro Molinari added a comment -

        Yes, with the sample project I also get an error regarding missing StoppedByUserException (the same problem I hade with 2.8.0 on my main project, see my comment of 14/nov/11).

        I also think all the problems are related.

        Show
        Mauro Molinari added a comment - Yes, with the sample project I also get an error regarding missing StoppedByUserException (the same problem I hade with 2.8.0 on my main project, see my comment of 14/nov/11). I also think all the problems are related.
        Hide
        Kris De Volder (c) added a comment -

        Getting a little closer to figuring this out. What I fixed yesterday seems to be working... but...

        The more complex project setup seems to trigger another problem. What I'm seeing is that when project B's classpath is being resolved it actually ends up using the contents of the project C's classpath container instead of B's. Now, project C's container doesn't have the JUnit libraries on it casing a problem.

        Why it's doing that I'm not sure yet, but I think it has something to do with how classpaths from dependendent projects are merged in when expanding project classpaths. The JDT resolution logic is quite complex, but it looks like it may be treating project B's container as "redundant". So instead of trying to merge the contents of both containers it only gets the contents of one of them.

        Show
        Kris De Volder (c) added a comment - Getting a little closer to figuring this out. What I fixed yesterday seems to be working... but... The more complex project setup seems to trigger another problem. What I'm seeing is that when project B's classpath is being resolved it actually ends up using the contents of the project C's classpath container instead of B's. Now, project C's container doesn't have the JUnit libraries on it casing a problem. Why it's doing that I'm not sure yet, but I think it has something to do with how classpaths from dependendent projects are merged in when expanding project classpaths. The JDT resolution logic is quite complex, but it looks like it may be treating project B's container as "redundant". So instead of trying to merge the contents of both containers it only gets the contents of one of them.
        Hide
        Kris De Volder (c) added a comment -

        I've committed a fix. Problem was indeed that JDT was ignoring the 'B' container in favor of the 'C' container. It considered them to be equivalent because the default implementation for classpath container's 'comparator id' doesn't take the project into account.

        Once diagnosed it was easily fixed by overriding the default implementation with a more detailed comparator id that includes the project name.

        Also committed a regression test.

        Mauro, if you have a chance please try the snapshot build.

        Thanks a lot for your help in getting to the bottom of this. I'm closing the issue now, but as always, it can be reopened if you experience more problems with it.

        Show
        Kris De Volder (c) added a comment - I've committed a fix. Problem was indeed that JDT was ignoring the 'B' container in favor of the 'C' container. It considered them to be equivalent because the default implementation for classpath container's 'comparator id' doesn't take the project into account. Once diagnosed it was easily fixed by overriding the default implementation with a more detailed comparator id that includes the project name. Also committed a regression test. Mauro, if you have a chance please try the snapshot build. Thanks a lot for your help in getting to the bottom of this. I'm closing the issue now, but as always, it can be reopened if you experience more problems with it.
        Hide
        Mauro Molinari added a comment -

        Hi Kris, I will try the new snapshot as soon as possible, however I see that the current nightly build was made at 21:57, while your message is at 22:55, so I think I must wait tomorrow to have the fix.

        By the way, could the problem you found be related in some way to also STS-2190?

        Show
        Mauro Molinari added a comment - Hi Kris, I will try the new snapshot as soon as possible, however I see that the current nightly build was made at 21:57, while your message is at 22:55, so I think I must wait tomorrow to have the fix. By the way, could the problem you found be related in some way to also STS-2190 ?
        Hide
        Mauro Molinari added a comment -

        I suspect the nightly build I downloaded actually does have the fix because now all my JUnit launch configurations work as expected, thank you Kris

        Show
        Mauro Molinari added a comment - I suspect the nightly build I downloaded actually does have the fix because now all my JUnit launch configurations work as expected, thank you Kris
        Hide
        Kris De Volder (c) added a comment -

        Cool thanks for confirming. I'm glad we got this fixed. I think it was a serious issue with much potential to create problems for many users

        Don't know if STS-2190 could be related. But maybe I'll try to have a look at that issue later today.

        Show
        Kris De Volder (c) added a comment - Cool thanks for confirming. I'm glad we got this fixed. I think it was a serious issue with much potential to create problems for many users Don't know if STS-2190 could be related. But maybe I'll try to have a look at that issue later today.
        Hide
        Michael Brand added a comment -

        We're seeing this exact problem using an AspectJ compiler. JUnit works for projects that are not dependent on an AspectJ. But when we added AspectJ this problem appeared.

        We're using SpringSource version 2.9.0.201112091000-M1 and gradle-1.0-milestone-7. Do you have any suggestions for a resolution? Should we open a new defect or re-open this one?

        Show
        Michael Brand added a comment - We're seeing this exact problem using an AspectJ compiler. JUnit works for projects that are not dependent on an AspectJ. But when we added AspectJ this problem appeared. We're using SpringSource version 2.9.0.201112091000-M1 and gradle-1.0-milestone-7. Do you have any suggestions for a resolution? Should we open a new defect or re-open this one?
        Hide
        Mauro Molinari added a comment -

        Actually this problem was about the fact that the "Gradle Dependencies" library was not put in the runtime build path when an Eclipse launch was run (the JUnit launch, for instance, or even a plain Java Application launch), especially when dependencies between projects were involved.
        Since I updated to 2.9.0.x I've never seen this problem again.
        So, I think the AspectJ problem is something else, but I don't know anything about it, so Kris may be of more help here.

        Show
        Mauro Molinari added a comment - Actually this problem was about the fact that the "Gradle Dependencies" library was not put in the runtime build path when an Eclipse launch was run (the JUnit launch, for instance, or even a plain Java Application launch), especially when dependencies between projects were involved. Since I updated to 2.9.0.x I've never seen this problem again. So, I think the AspectJ problem is something else, but I don't know anything about it, so Kris may be of more help here.
        Hide
        Kris De Volder (c) added a comment -

        Hi Michael,

        It could be the problem is related/similar, but let's start with a 'clean' slate and open a new ticket.

        Michael, you think you could create some small test project that demonstrates the problem. That will help greatly in trying to reproduce and fix.

        Kris

        Show
        Kris De Volder (c) added a comment - Hi Michael, It could be the problem is related/similar, but let's start with a 'clean' slate and open a new ticket. Michael, you think you could create some small test project that demonstrates the problem. That will help greatly in trying to reproduce and fix. Kris

          People

          • Assignee:
            Kris De Volder (c)
            Reporter:
            Keith Donald
          • Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              First Response Date: