java.lang.IllegalStateException: Failed to load ApplicationContext..

Hello all;

Am failing to run tests with Junit with my IDE in the new maven sub module(2.4) of rest webservices with this error ,On looking into the stack trace i see this line

Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [applicationContext-service.xml]; nested exception is java.lang.NullPointerException

The funny bit of it is that on doing a maven build in my IDE the tests pass

I looked into some similar scenarios here though not much gain because am experiencing this before i introduce any changes

Any thoughts would be of help ?

@dkayiwa @ruhanga @mksd @ibacher

hello @gcliff i have been facing the same error lately. It always comes but i refreshed, and validated all the projects and then the error went. But it comes again a number of times.

thanks @jnsereko,

i did refresh and validate but still facing the same error again

Which branch/fork/PR is that?

@mksd i have not created a pr or introduced any changes in the code . I created the RESTWS-764 branch off the master i forked from https://github.com/gitcliff/openmrs-module-webservices.rest

REST WS’ latest Travis build is successful though (see here).

i did pull the latest changes from upstream with git pull --rebase upstream master and on running the tests i got the same error again…

I just tried with no issues (my build here), make sure you re-fetch all dependencies with -U:

mvn -U clean package

@mksd I have followed your suggestion with the build and it has solved my earlier Unexpected exception parsing XML document from class path resource [applicationContext-service.xml]; nested exception is java.lang.NullPointerException error…

Though i run into a new error that am looking into,the errors are coming up when running these tests individually with junit in the IDE …

I was suggesting a command line build, not within your IDE. Is that what you did?

YES i did the command line build