This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Spring and the fly likes Spring JUnit error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring JUnit error" Watch "Spring JUnit error" New topic

Spring JUnit error

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9952


I have a JUnit test class which I run using Spring. Following is what I have configured to my JUnit type

When I try to run my test method, I get the following error:

What the heck is app-config.xml? I'm not referencing it anywhere. Suggestions on what might be wrong?

SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17271

Do you have any <import> tags in any of those configuration files? And maybe those <import> config files, have <import> tags. But somewhere you are looking up that config file.

Or do you have any Java COnfiguration classes with @Configuration that are @ImportResource other config files?

Good Luck.


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9952

Oh yes, I figured out what the problem was. My JUnit test class extends from another super class and in that super class, there was a reference to the aop-config.xml. I do not know who has added it. Guess it could be due to eclipse auto fill feature or something else. I removed it and it all started working again.
Have you checked out Aspose?
subject: Spring JUnit error
It's not a secret anymore!