small medium large xlarge

Generic-user-small
18 Oct 2016, 13:22
Gaz Morris (2 posts)

I’m having an issue with starting the server.

My POM is exactly the same as the book. (Checked this from the code examples)

Under the resolved dependencies in my POM, it shows javax.servlet-api:3.1.0

This means my AtmServlet.java won’t compile. The error;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;

The above cant be resolved.

Also the POM in the example refers to 3.0.0.v201112011016. However this version is not being read anywhere.

If I try to add to the pom, it will only compile with 3.0.1 and wont compile if I add 3.1.0. What version should I be using?

javax.servlet javax.servlet-api 3.0.1

When i run it with everything compiling using 3.0.1, i get this error;

Caused by: java.lang.ClassNotFoundException: javax.servlet.http.HttpSessionIdListener

Now I can’t progress. Help please.

Generic-user-small
18 Oct 2016, 13:48
Gaz Morris (2 posts)

I’ve managed to resolve this by overriding the javax.servlet jar in the resolved dependencies by using a new version in the POM.

	<dependency>
		<groupId>javax.servlet</groupId>
		<artifactId>javax.servlet-api</artifactId>
		<version>4.0.0-b01</version>
	</dependency>
You must be logged in to comment