Archive

Posts Tagged ‘Maven’

java.lang.ClassNotFoundException: org.Springframework.Web.Context.ContextLoaderListener

March 16, 2017 Leave a comment

How to solve java.lang.ClassNotFoundException: org.Springframework.Web.Context.ContextLoaderListener.

Firstly we must know root cause :
This error because using Spring MVC framework in Java Web application and configured org.springframework.web.context.ContextLoaderListener as a listener in your deployment descriptor also known as web.xml, but the JAR which contains this class is not available in web application’s classpath. This jar appears in spring-web.jar, if you use maven as build tool so make sure that spring-web dependency exist in pom file.


<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.3.7.RELEASE</version>
</dependency>

Second, right click web project -> Select “Deployment Assembly” -> Click the “Add..” button on the right -> Select “Java Build Path Entries” from the menu of Directive Type and click “Next” -> Select “Maven Dependencies” from the Java Build Path Entries menu -> Click finish.

Please see picture below.

Build path

Thank you.

Advertisements
Categories: Java, Java and Web Tags: , ,

Installing Maven On Windows

April 14, 2016 Leave a comment

Below are steps to install Apache Maven on Windows.

  • Download Apache Maven zip file in here
  • Unzip it in desired folder, assume you unzip Maven zip file in here E:\Installer\maven\apache-maven-3.3.9
  • Add MAVEN_HOME variable in user variable that point Maven folder

MAVEN_HOME

  • Update PATH, append it with MAVEN_HOME – %MAVEN_HOME%\bin

Update PATH

  • Verify it it with mvn -version in Windows command

Maven Verification

 

Thank you.