Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8945825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:20:48+00:00 2026-06-15T12:20:48+00:00

If I have a servlet taken directly from the example on the Scalatra docs

  • 0

If I have a servlet taken directly from the example on the Scalatra docs page:

package me.myself.andi

import _root_.akka.dispatch._
import org.scalatra.akka.AkkaSupport
import org.scalatra.ScalatraServlet

class MyAppServlet extends ScalatraServlet with AkkaSupport {
  get("/"){
    Future {
      // Add other logic here

      <html><body>Hello Akka</body></html>
    }
  }
}

I get an error class MyAppServlet needs to be abstract, since method system in trait AkkaSupport of type => akka.actor.ActorSystem is not
defined
.

Then, I tried:

package me.myself.andi

import _root_.akka.dispatch._
import org.scalatra.akka.AkkaSupport
import org.scalatra.ScalatraServlet

class MyAppServlet extends ScalatraServlet with AkkaSupport {
  val system = ActorSystem("MySystem")
  get("/"){
    Future(system) { // and also Future {
      // Add other logic here

      <html><body>Hello Akka</body></html>
    }
  }
}

But receive another error type mismatch; found : org.scalatra.ActionResult required:
akka.dispatch.ExecutionContext
. Being unfamiliar with Akka, what’s going on here?

libraryDependencies ++= Seq(
  "org.scalatra" % "scalatra" % "2.2.0-SNAPSHOT",
  "org.scalatra" % "scalatra-scalate" % "2.2.0-SNAPSHOT",
  "org.scalatra" % "scalatra-specs2" % "2.2.0-SNAPSHOT" % "test",
  "org.scalatra" % "scalatra-akka" % "2.2.0-SNAPSHOT",
  "com.typesafe.akka" % "akka" % "2.0.4",
  "ch.qos.logback" % "logback-classic" % "1.0.6" % "runtime",
  "eu.infomas" % "annotation-detector" % "3.0.0",
  "org.atmosphere" % "atmosphere-runtime" % "1.1.0-SNAPSHOT",
  "org.eclipse.jetty" % "jetty-websocket" % "8.1.4.v20120524",
  "org.eclipse.jetty" % "jetty-webapp" % "8.1.7.v20120910" % "container",
  "org.eclipse.jetty" % "test-jetty-servlet" % "8.1.5.v20120716" % "test",
  "org.eclipse.jetty" % "jetty-websocket" % "8.1.7.v20120910" % "container",
  "org.eclipse.jetty.orbit" % "javax.servlet" % "3.0.0.v201112011016" % "container;provided;test" artifacts (Artifact("javax.servlet", "jar", "jar"))
)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T12:20:49+00:00Added an answer on June 15, 2026 at 12:20 pm

    The compiler error is quite clear. Import akka.actor.ActorSystem and add val system = ActorSystem("MySystem") to the class and it should work.

    edit:

    The system should be an implicit value, so it has to be implicit val system = ActorSystem("MySystem") and then don’t pass in the system manually. So in total it would be

    class MyAppServlet extends ScalatraServlet with AkkaSupport {
      implicit val system = ActorSystem("MySystem")
      get("/"){
        Future { // and also Future {
          // Add other logic here
    
          <html><body>Hello Akka</body></html>
        }
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Servlet thats run and takes in data from a web page.
use case example I have a servlet that is receiving login requests. If a
I have this managed bean which takes two values from database's table import java.io.Serializable;
I have jsp page - <html> <head> </head> <body> <a href=http://localhost:8080/MyProject/Servlet123?usrID=33333>Go to servlet</a> </body>
I have code called from a servlet that calls out to an external service.
I have a servlet which takes us to an existing jsp, say home.jsp. This
I have a servlet that takes a couple of minutes to process and return
Suppose I have a Java Servlet that takes a while to finish computing it's
I have the following on a web servlet: EDITED: public String tryGoogleAuthentication(String auth_token){ HttpURLConnection
I have a servlet that does some business login and then redirects to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.