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 6339723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:42:01+00:00 2026-05-24T19:42:01+00:00

I’m trying to create a standalone JAR containing Akka, Spray, and Jetty. Ideally I

  • 0

I’m trying to create a standalone JAR containing Akka, Spray, and Jetty. Ideally I distribute the entire application in that single file, without any external files whatsoever.

I understand how to create an embedded Jetty server instance

def main(args: Array[String]): Unit = {
    val server = new Server(9012);
    server.start();
    server.join();
    Thread.sleep(2000);
    server.stop();
}

and I’ve followed the Spray example code in creating a HelloService and Boot class, but I have no earthly idea of how to connect the two, so that when a URL is requested on the Jetty server a Spray service responds to it. Any help would be much appreciated.

Update: I’m getting a lot closer to solving this problem, thanks to a thread of inquiry prompted by Alois Cochard (I’m coming from a web scripting background, and getting my head around Java web services has been … challenging!). I’ve modified my main method to start the server and read the Jetty and akka configuration files that are in the getting started template. It’s reading both of those files, but now I’m getting this when I navigate to / on the Jetty server:

HTTP ERROR: 500

Problem accessing /. Reason:

assertion failed: 0 actors for id ‘spray-root-service’ found, expected exactly one

I know I’m missing something silly (and probably that I should break down and use SBT, but being able to just compile and run in Eclipse, and then refresh in the browser, is so simple and appealing).

Update #2: Figured out the problem. I wasn’t creating a WebAppContext object, which meant that the web.xml was never getting read, and thus Akka was never being loaded. This is the revised main method which is now working.

  • 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-05-24T19:42:02+00:00Added an answer on May 24, 2026 at 7:42 pm

    According to the spray-template, you should add the Spray servlet connector in the web.xml configuration file:

    http://github.com/spray/spray-template/blob/master/src/main/webapp/WEB-INF/web.xml

    You can find some informations about how to configure a standealone jetty to use this file here (there is surely better references in netty documentation directly):

    http://exist.sourceforge.net/deployment.html#d47e594

    BTW, using the spray template as a basis for your project looks like a good idea 😉

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

Sidebar

Related Questions

I'm trying to create an if statement in PHP that prevents a single post
Basically, what I'm trying to create is a page of div tags, each has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace

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.