Context Initialization failed – Java – Spring MVC Solved!

When you are working on Spring MVC based web application and running your application on tomcat server you must have faced Context Initialization error when try to publish your application on tomcat server.

The error looks like below.

I recently faced this error while building an old application.

Let us first know what do you mean by Context Initialization in terms of Spring MVC.

Context Initialization means registering property sources or activating profiles against the context’s environment

Here is what I did to resolve this:

Solution #1) Clean your project

In eclipse you can click on project -> Clean

Solution #2) If the Solution #1 does not work out, do not worry. Check which version spring MVC libraries are you using. If you re using Spring MVC 3 then prefer install Java 7 with tomcat version 7.0.92.

This solution worked out for my application.

The point here is you need to check which tomcat version and Java version are compatible with your application.

And when you install these version set the path in the eclipse so that your application can run on them. Then build the project again.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s