Results 1 to 7 of 7

Thread: found error/workaround on test Failed to load ApplicationContext error

  1. #1

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

  2. #2
    Join Date
    Mar 2008
    Location
    Sydney, AU
    Posts
    974

    Default

    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?
    Stefan Schmidt
    Software Engineer, Spring Roo
    SpringSource - a division of VMware
    twitter @schmidtstefan

  3. #3

    Default

    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

  4. #4

    Question Solution?

    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

  5. #5

    Default

    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.

  6. #6
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    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.
    Ben Alex
    Project Founder, Spring UAA, Spring Roo and Spring Security

  7. #7

    Default

    Thanks will test for that on the next ro project.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •