Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse does not deploy jars into WEB-INF/lib directory

To integrate JSF with Spring I have added these lines in web.xml:

<context-param>  
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>  
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>  
    <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>

And I have added all the spring dependencies using Maven, but when I run the project I receive the following error messages:

java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.request.RequestContextListener

When I took a glance at the folder /WEB-INF/lib I have found no JAR files, although dependencies are declared in the pom.xml.

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-web</artifactId>
    <version>${spring.version}</version>
</dependency>

I think that the problem that the JAR's are not packaged with the draft. Do you have an idea how to fix it?

like image 390
user405458 Avatar asked Jan 23 '26 00:01

user405458


1 Answers

eclipse project right click -> Properties -> Deployment Assembly -> Add -> Java Build Path Entry will do.

like image 63
tompal18 Avatar answered Jan 25 '26 12:01

tompal18