File is being found if not you would have gotten FileNotFoundException.
Where is the NPE coming from? Is it from a collaborator that was supposed to be injected?
Are you running Spring's JUnit class runner? Your test should look like this for example:
Code:
@RunWith( SpringJUnit4ClassRunner.class )
@ContextConfiguration(locations = { "classpath:com/agg/dao/JpaIntegrationTests-context.xml" })
public class TestContext {
@Autowired
private SomeBeanInYourContext someBeanInYourContext;
@Test
public void testSomething() {
.....
someBeanInYourContext.doSomething();
....
}
}
You might want to add logging so you can see what spring is doing. Just add a simple log4j.properties to your classpath.
Example log4j.properties
Code:
log4j.rootLogger=info, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
log4j.logger.org.springframework=info