Jan 18th, 2010, 04:52 AM
found error/workaround on test Failed to load ApplicationContext error
I get a Failed to load ApplicationContext when I run a test from within the SpringSource IDE.
If I run the test from command prompt I do not get any errors. mvn test
Then when I run the junit test again through the IDE it runs.
So running mvn test from a command prompt loads the application context which is then in the path for subsequent testing anyone else seen this error.
Jan 18th, 2010, 04:45 PM
This is the first time I hear of such an issue. Can you replicate this consistently with a given script or project?
It would be good to have details so we can follow up on this. Maybe, you just need to do a project refresh or clean so all dependencies are recognized? Did you do a 'perform eclipse' from Roo shell or 'mvn eclipse:eclipse' from command line?
Jan 19th, 2010, 03:06 AM
Yes the problem is recreatable, but I think it may be linked to another bug I raised about roo hanging when I try to create a entity. As soon as I deleted those entitys the junits run, but I will need to test further around this.
Will keep you posted on if was a project set up problem or an obsure IDE problem
Feb 2nd, 2010, 11:13 PM
Did you ever figure this out? I still have it but did not use ROO. My issues, I think, is due to JavaConfig/SPring 3.0 as my project worked before I migrated to them
Would love to hear some solutions
Feb 3rd, 2010, 04:45 AM
Hi sorry never did figure what the problem was, but I am in the habit of doing a clean maven build every morning before I start anything else.
So have not come across the problem again.
Tomorrow will run a test before I do the build see what happens, see if I still have the problem.
Also with spring I find the real problem is halfway down the stack trace.
Feb 3rd, 2010, 04:15 PM
Sounds like Eclipse didn't compile the project, thus the target/classes would have been empty and that's the location where the app context XML would have been retrieved by Spring at startup time. Running the tests externally (ie via mvn command line) would have compiled and added those classes and XML file to target/classes. It's just a guess, but seems plausible. Try a Project > Clean next time and ensure Project > Build Automatically is on.
Feb 4th, 2010, 03:15 AM
Thanks will test for that on the next ro project.