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

  • Home
  • SEARCH
  • 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 8905285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:21:32+00:00 2026-06-15T02:21:32+00:00

I have the following Scala code to setup a Jetty server with Scalatra. val

  • 0

I have the following Scala code to setup a Jetty server with Scalatra.

val server = new Server(8080)
val context = new WebAppContext()
context.setResourceBase("visualization")
context.addServlet(new ServletHolder(new CallTreeServlet(dataProvider)), "/*")
context.addServlet(new ServletHolder(new DataLoadingServlet(dataProvider)), "/*")
server.setHandler(context)

My problem is that it seems to work only if I register a single servlet.

If I register more than one, like I do in the code I posted, it loads only one of them.

Is it possible to load multiple servlets? I guess it is, but I can’t figure out how.

If I try to load a page from the first servlet I got this error message that references only pages belonging to the second servlet:

Requesting "GET /callTrees" on servlet "" but only have:
GET /components
POST /load
POST /searchCallTrees
POST /selectPlugIn
  • 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-15T02:21:34+00:00Added an answer on June 15, 2026 at 2:21 am

    To troubleshoot this, you should verify the servlet lifecycle. One convenient way to do this is to peruse the servlet container’s logs to see what it reports while starting up the web application. It should tell you about each web app ( servlet context ) and each servlet . . .

    However, I think I see what your problem is. Your servlet path mappings are kind of funky. It looks to me that you are mapping both servlets to receive ALL requests. This can’t work, from a practical point of view, and might not work in terms of the servlet rules. From the servlet specification:

    SRV.11.2
    Specification of Mappings
    In the Web application deployment descriptor, the following syntax is used to define
    mappings:
    • A string beginning with a ‘/’ character and ending with a ‘/*’ suffix is used
    for path mapping.
    • A string beginning with a ‘*.’ prefix is used as an extension mapping.
    • A string containing only the ’/’ character indicates the "default" servlet of
    the application. In this case the servlet path is the request URI minus the con-
    text path and the path info is null.
    • All other strings are used for exact matches only.
    

    I suggest you make them both unique. As it looks now, you have them both at “/*” which is kind of like the “default servlet”, but not . . .

    Why not try “/first/” and “/second/” as a sanity check. Then move from there toward getting the configuration how you like.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have the following Scala code: trait BaseTrait[EnumType <: Enumeration] { protected val
I have the following Scala code: class X[T1 <: AnyRef] { var _x :
In Scala IDE I have the following code: package pkg.one object S { class
I have the following scala code: package dummy import javax.servlet.http.{HttpServlet, HttpServletRequest => HSReq, HttpServletResponse
Suppose I have the following Scala code: class Foo(a: Int) class Bar(b: Buffer[Int]) extends
I have the following code, partly in Java, partly in Scala: Java: public interface
I have the following Scala code. import scala.actors.Actor object Alice extends Actor { this.start
I've got a simple question for you :) I have the following Scala code,
I am looking into scala TCO and have written the following code import scala.annotation.tailrec
I have the following code in Scala Play Framework: case class Step(name: String, f:

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.