javax.servlet.UnavailableException: Servlet class com.vaadin.terminal.gwt.s

Hi all,

I’m fairly new to vaadin, but so far all I can say is: awesome work!

I’m having a problem running my application. I’m deploying it to a Jetty server at runtime, as I start the server I’m getting this exception:


Problem accessing /prova-vaadin. Reason:

Servlet class com.vaadin.terminal.gwt.server.ApplicationServlet is not a javax.servlet.Servlet

Caused by:

javax.servlet.UnavailableException: Servlet class com.vaadin.terminal.gwt.server.ApplicationServlet is not a javax.servlet.Servlet
at org.eclipse.jetty.servlet.ServletHolder.checkServletType(
at org.eclipse.jetty.servlet.ServletHolder.doStart(
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(
at org.eclipse.jetty.servlet.ServletHandler.initialize(
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(
at org.eclipse.jetty.webapp.WebAppContext.startContext(
at org.eclipse.jetty.server.handler.ContextHandler.doStart(
at org.eclipse.jetty.webapp.WebAppContext.doStart(
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(
at org.eclipse.jetty.server.Server.doStart(
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(
at paripari.GUI.ServerStarter.startServer(
at paripari.GUI.GUI.init(
at paripari.plugin.Plugin.go(
at java.util.concurrent.Executors$
at java.util.concurrent.FutureTask$Sync.innerRun(
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
at java.util.concurrent.ThreadPoolExecutor$

of which I can’t figure out the cause. If I run the application on Tomcat 6 or Jetty in eclipse everything goes fine.

Maybe I’m doing something wrong with the project setup: I have the gwt-dev and gwt-user jars, along with java servlet-api, vaadin and refresher jars, in my WebContent/WEB-INF/lib folder.

This is the web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="" xmlns="" xmlns:web="" xsi:schemaLocation="" id="WebApp_ID" version="2.5">
  	Vaadin production mode</description>
  	<servlet-name>Prova_vaadin Application</servlet-name>
  		Vaadin application class to start</description>
  		Application widgetset</description>
  	<servlet-name>Prova_vaadin Application</servlet-name>
  	<servlet-name>Prova_vaadin Application</servlet-name>


Normally you’d only have the vaadin and refresher jars in WEB-INF/lib (and your problem sure sounds like a classloading problem).

(Did you use the Vaadin Eclipse plugin to set up the project structure? You don’t have to, but it might help.)

Best Regards,

Hi Marc,
thanks for the fast response.
Yes, I’m using the eclipse plugin, but I somehow still managed to mess it up :smiley:

As you suggested, I removed everythig from my WEB-INF/lib folder but the vaadin and refresher jars. I imported the whole gwt directory, moved the servlet-api jar to a /lib folder in the project root directory.

As I moved the servlet-api jar, the exception changed into a plain:

java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet
at java.lang.ClassLoader.defineClass1(Native Method)
… (full stack trace included in the attached file)

This is why I put all the jars in the WEB-INF/lib folder in the first place. Should I export in some way the gwt libraries when making the WAR?
11391.txt (3.17 KB)


Try making a new project with the plugin and look how that’s structured; in the first screenshot attached I did a new Vaadin Project, pressed finish, and got the structure in the second. This project should work when you do a ‘Export as WAR’. Add-on jars can be drag&dropped into WEB-INF/lib, and the whole thing should still work.

Best Regards,

NOTE: everything under “Libraries” is added automatically - no need to manually include servlet jars etc.