1

This started happening when I upgraded my Springsource Tool Suite from 2.3 to 2.3.1. Essentially whenever I do anything, such as open a file, change a file, etc, I have to do a clean. Everything works fine when I do mvn commands on the command line, which leads me to believe that Eclipse is looking in the wrong place for compiled code or something along those lines, although that is entirely superstitious at this point.

Example: I make a change to com.foo.mypackage.MyClass. Suddenly a bunch of tests that excercise MyClass get the red x - for class not found!

In src/main/test:

com.foo.DbUnitTest
com.foo.mypackage.FooTest extends DbUnitTest

DbUnitTest gets a class not found. I do a clean, and everything is fine. I touch something, and it breaks again :(. I don't really know where to begin on how to troubleshoot this.

Brock Adams
  • 90,639
  • 22
  • 233
  • 295
Steve
  • 71
  • 5

1 Answers1

2

The first starting point is in eclipse to select the project from the package explorer, right click it and select

Maven > Update Project Configuration

This usually gets things back in shape.

Sean Patrick Floyd
  • 292,901
  • 67
  • 465
  • 588
  • Lately with STS things have been behaving well. Thanks for the tip and if I start getting this weirdness again I'll try it. Now I have to figure out why my unit tests don't run (I get a class not found when I try to run a test as a junit test in STS and I have to just run tests from the command line using the -Dtest parameteR). – Steve May 18 '10 at 18:20
  • Spoke too soon. I have tried your tip and it doesn't work. STS is back to redlining my tests. I try doing what you suggest to no avail. I must have broke this project somehow, I need to figure out how to start it from scratch. – Steve May 18 '10 at 18:55
  • 1
    if everything is up to date in your CVS / SVN etc delete the project and check it out again. sometimes this is the only adequate choice. If you don't have an SCM export the project (source files) to an archive, create a new project and import the archive. – Sean Patrick Floyd May 18 '10 at 19:56