title: maven-scala-spring-jetty servlet not initialized
body: <p>I want to create a maven scala spring hibernate project <strong>using ECLIPSE</strong>. Im following this tutorial : 
  <a href="http://grahamhackingscala.blogspot.fr/2010/01/scala-spring-hibernate-maven-webapp-how.html" rel="nofollow">http://grahamhackingscala.blogspot.fr/2010/01/scala-spring-hibernate-maven-webapp-how.html</a></p>
  
  <p>Now I'm stuck in the 4th step : Start the Webapp with Maven using the Jetty Plugin. This is what the browser is displaying : </p>
  
  <pre><code>HTTP ERROR 404
  
  Problem accessing /hello.html. Reason:
  
      Servlet Not Initialized
  
  Caused by:
  
  javax.servlet.UnavailableException: Servlet Not Initialized
      at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:529)
      at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:488)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
      at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520)
      at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
      at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:973)
      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:417)
      at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:907)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
      at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
      at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
      at org.eclipse.jetty.server.Server.handle(Server.java:346)
      at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:442)
      at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:924)
      at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:582)
      at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218)
      at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
      at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
      at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
      at java.lang.Thread.run(Thread.java:722)
  </code></pre>
  
  <p>And this is the log im having during the initialisation :</p>
  
  <pre><code>java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
      at org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:195)
      at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:255)
      at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:274)
      at org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:214)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
      at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:424)
      at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:377)
      at org.eclipse.jetty.util.Loader.loadClass(Loader.java:92)
      at org.eclipse.jetty.util.Loader.loadClass(Loader.java:71)
      at org.eclipse.jetty.servlet.Holder.doStart(Holder.java:92)
      at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:255)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
      at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:779)
      at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:255)
      at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1212)
      at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:610)
      at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:453)
      at org.mortbay.jetty.plugin.JettyWebAppContext.doStart(JettyWebAppContext.java:256)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
      at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:224)
      at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:167)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
      at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:224)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
      at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:89)
      at org.eclipse.jetty.server.Server.doStart(Server.java:262)
      at org.mortbay.jetty.plugin.JettyServer.doStart(JettyServer.java:65)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
      at org.mortbay.jetty.plugin.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:511)
      at org.mortbay.jetty.plugin.AbstractJettyMojo.execute(AbstractJettyMojo.java:364)
      at org.mortbay.jetty.plugin.JettyRunMojo.execute(JettyRunMojo.java:514)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
      at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
  </code></pre>
  
  <p>first here s pom.xml:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;com.mycompany&lt;/groupId&gt;
    &lt;artifactId&gt;scala-spring-hibernate&lt;/artifactId&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
    &lt;inceptionYear&gt;2008&lt;/inceptionYear&gt;
    &lt;packaging&gt;war&lt;/packaging&gt;
    &lt;properties&gt;
      &lt;scala.version&gt;2.10.1&lt;/scala.version&gt;
      &lt;org.springframework.version&gt;3.0.0.RELEASE&lt;/org.springframework.version&gt;
    &lt;/properties&gt;
  
    &lt;repositories&gt;
  
      &lt;repository&gt;
        &lt;id&gt;scala-tools.org&lt;/id&gt;
        &lt;name&gt;Scala-Tools Maven2 Repository&lt;/name&gt;
        &lt;url&gt;http://scala-tools.org/repo-releases&lt;/url&gt;
      &lt;/repository&gt;
  
      &lt;repository&gt;
           &lt;id&gt;com.springsource.repository.bundles.release&lt;/id&gt;
           &lt;name&gt;EBR Spring Release Repository&lt;/name&gt;
           &lt;url&gt;http://repository.springsource.com/maven/bundles/release&lt;/url&gt;
      &lt;/repository&gt;
  
      &lt;repository&gt;
           &lt;id&gt;com.springsource.repository.bundles.external&lt;/id&gt;
           &lt;name&gt;EBR External Release Repository&lt;/name&gt;
           &lt;url&gt;http://repository.springsource.com/maven/bundles/external&lt;/url&gt;
      &lt;/repository&gt;
  
    &lt;/repositories&gt;
  
    &lt;pluginRepositories&gt;
      &lt;pluginRepository&gt;
        &lt;id&gt;scala-tools.org&lt;/id&gt;
        &lt;name&gt;Scala-Tools Maven2 Repository&lt;/name&gt;
        &lt;url&gt;http://scala-tools.org/repo-releases&lt;/url&gt;
      &lt;/pluginRepository&gt;
    &lt;/pluginRepositories&gt;
  
    &lt;dependencies&gt;
  
      &lt;dependency&gt;
        &lt;groupId&gt;org.scala-lang&lt;/groupId&gt;
        &lt;artifactId&gt;scala-library&lt;/artifactId&gt;
        &lt;version&gt;${scala.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
        &lt;groupId&gt;junit&lt;/groupId&gt;
        &lt;artifactId&gt;junit&lt;/artifactId&gt;
        &lt;version&gt;3.8.1&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;org.springframework.context&lt;/artifactId&gt;
          &lt;version&gt;${org.springframework.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;org.springframework.transaction&lt;/artifactId&gt;
          &lt;version&gt;${org.springframework.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;org.springframework.orm&lt;/artifactId&gt;
          &lt;version&gt;${org.springframework.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;org.springframework.web&lt;/artifactId&gt;
          &lt;version&gt;${org.springframework.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;org.springframework.web.servlet&lt;/artifactId&gt;
          &lt;version&gt;${org.springframework.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
           &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
           &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
           &lt;version&gt;2.5&lt;/version&gt;
           &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
           &lt;groupId&gt;commons-logging&lt;/groupId&gt;
           &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
           &lt;version&gt;1.1.1&lt;/version&gt;
      &lt;/dependency&gt;
  
    &lt;/dependencies&gt;
  
    &lt;build&gt;
      &lt;sourceDirectory&gt;src/main/scala&lt;/sourceDirectory&gt;
      &lt;testSourceDirectory&gt;src/test/scala&lt;/testSourceDirectory&gt;
      &lt;plugins&gt;
  
      &lt;plugin&gt;
          &lt;groupId&gt;org.mortbay.jetty&lt;/groupId&gt;
          &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;8.0.4.v20111024&lt;/version&gt;
      &lt;/plugin&gt;    
  
        &lt;plugin&gt;
          &lt;groupId&gt;org.scala-tools&lt;/groupId&gt;
          &lt;artifactId&gt;maven-scala-plugin&lt;/artifactId&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;goals&gt;
                &lt;goal&gt;compile&lt;/goal&gt;
                &lt;goal&gt;testCompile&lt;/goal&gt;
              &lt;/goals&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
          &lt;configuration&gt;
            &lt;scalaVersion&gt;${scala.version}&lt;/scalaVersion&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-eclipse-plugin&lt;/artifactId&gt;
          &lt;configuration&gt;
            &lt;downloadSources&gt;true&lt;/downloadSources&gt;
            &lt;buildcommands&gt;
              &lt;buildcommand&gt;ch.epfl.lamp.sdt.core.scalabuilder&lt;/buildcommand&gt;
            &lt;/buildcommands&gt;
            &lt;additionalProjectnatures&gt;
              &lt;projectnature&gt;ch.epfl.lamp.sdt.core.scalanature&lt;/projectnature&gt;
            &lt;/additionalProjectnatures&gt;
            &lt;classpathContainers&gt;
              &lt;classpathContainer&gt;org.eclipse.jdt.launching.JRE_CONTAINER&lt;/classpathContainer&gt;
              &lt;classpathContainer&gt;ch.epfl.lamp.sdt.launching.SCALA_CONTAINER&lt;/classpathContainer&gt;
            &lt;/classpathContainers&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/build&gt;
    &lt;reporting&gt;
      &lt;plugins&gt;
        &lt;plugin&gt;
          &lt;groupId&gt;org.scala-tools&lt;/groupId&gt;
          &lt;artifactId&gt;maven-scala-plugin&lt;/artifactId&gt;
          &lt;configuration&gt;
            &lt;scalaVersion&gt;${scala.version}&lt;/scalaVersion&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;/reporting&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Here is my web.xml : </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="
          http://java.sun.com/xml/ns/javaee
          http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
        id="scala-spring-hibernate"
        version="2.5"&gt;
  
   &lt;servlet&gt;
       &lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt;
       &lt;servlet-class&gt;
           org.springframework.web.servlet.DispatcherServlet
       &lt;/servlet-class&gt;
       &lt;init-param&gt;
           &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
           &lt;param-value&gt;/WEB-INF/web-context.xml&lt;/param-value&gt;
       &lt;/init-param&gt;
       &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
   &lt;/servlet&gt;
  
   &lt;servlet-mapping&gt;
       &lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt;
       &lt;url-pattern&gt;*.html&lt;/url-pattern&gt;
   &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>This the web-context.xml :</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:context="http://www.springframework.org/schema/context"
      xsi:schemaLocation="
       http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
       http://www.springframework.org/schema/context
       http://www.springframework.org/schema/context/spring-context-3.0.xsd"&gt;
  
   &lt;context:component-scan
       base-package="com.mycompany.spring.web"/&gt;
  
   &lt;bean id="viewResolver"
         class="org.springframework.web.servlet.view.UrlBasedViewResolver"&gt;
       &lt;property name="viewClass"
           value="org.springframework.web.servlet.view.JstlView"/&gt;
       &lt;property name="prefix" value="/WEB-INF/jsp/"/&gt;
       &lt;property name="suffix" value=".jsp"/&gt;
   &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>My JSP is containing the following code : </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;%@page contentType="text/html;"%&gt;
  &lt;html&gt;
  &lt;body&gt;
      &lt;h1&gt;Hello from ${pageContext.request.serverName}&lt;/h1&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My scala class :</p>
  
  <pre class="lang-java prettyprint-override"><code>import org.springframework.stereotype.Controller
  import org.springframework.web.bind.annotation.RequestMapping
  
  @Controller
  class HelloWorldController {
  @RequestMapping(Array("/hello.html"))
  def showHello = "helloPage"
  }
  </code></pre>
  
  <p>Can you help me please ?</p>