views:

252

answers:

1

This started happening when I upgraded my Springsource Toolsuite 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.

A: 

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.

seanizer
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
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
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.
seanizer