Questions tagged [embedded-jetty]

Jetty is a widely used web container (server) written in Java and produced by Eclipse.

Jetty is a widely used web container written in Java. Jetty has a slogan, "Don't deploy your application in Jetty, deploy Jetty in your application."

What this means is that as an alternative to bundling your application as a standard WAR to be deployed in Jetty, Jetty is designed to be a software component that can be instantiated and used in a Java program just like any POJO. Put another way, running Jetty in embedded mode means putting an HTTP module into your application, rather than putting your application into an HTTP server.

You can find extra information for Jetty at Codehaus.

1375 questions
3
votes
2 answers

How to configure embedded Jetty (v9) to set specific headers for specific resource files?

Is it possible to configure embedded Jetty (v9) to set specific headers for specific resource file types only. At the moment, I'm not doing anything special to handle static resources, so presumably Jetty has some default handler setup to do that.…
RTF
  • 6,214
  • 12
  • 64
  • 132
3
votes
3 answers

java.lang.NoClassDefFoundError: Could not initialize class org.springframework.web.util.NestedServletException

I met an issue but I cannot figure out the cause of this problem because the error quite general. java.lang.NoClassDefFoundError: Could not initialize class org.springframework.web.util.NestedServletException at …
biendltb
  • 1,149
  • 1
  • 13
  • 20
3
votes
1 answer

Jetty + SpringMVC: Error when set configureDefaultServletHandling because cannot find the default servlet name

I created an simple application without web.xml and spring-servlet.xml config file. I just config in Java code. This is the project structure: Project structure This is my main class: public class TripMapServer { private static final int…
biendltb
  • 1,149
  • 1
  • 13
  • 20
3
votes
1 answer

embedded jetty: get post parameters

I am using embedded jetty like this: Server server = new Server(7498); URL url = Main.class.getClassLoader().getResource("html"); URI webRootUri = null; try { webRootUri = url.toURI(); } catch (URISyntaxException e) { …
user3629892
  • 2,960
  • 9
  • 33
  • 64
3
votes
4 answers

I-Jetty or Jetty

I have a web application to be hosted on android device. I am currently using the emulator available with android sdk. My application will serve both static as well as dynamic data. I am currently using jetty version 6.1.22. I wanted to ask what…
Tushar Tarkas
  • 1,592
  • 13
  • 25
3
votes
4 answers

Read JSON message from HTTP POST request in Java

I am new to Java and to client- server programming. I am using embedded Jetty, and I'm trying to send a JSON string to some address (http://localhost:7070/json) and then to display the JSON string in that address. I tried the following code but all…
Maya
  • 53
  • 1
  • 2
  • 7
3
votes
1 answer

Integration of embedded jetty with Resteasy

I am trying to setup a jetty server which should: Serve html files on one context. Server REST API calls made using RestEasy on another context. I have referred Integrating Jetty with RESTEasy to integrate Resteasy and it works. I am able to…
Ameya
  • 147
  • 2
  • 15
3
votes
3 answers

Error "Multiple servlets map to path: /*: " in embedded Jetty with jerseyServlets

There seem to be many questions arround it here but none helped me.... Tried to have single Java Class as startingpoint running embedded Jetty with Jersey to provide either Webpages and JSON interfaces...However even first step failed to provide…
user3732793
  • 1,699
  • 4
  • 24
  • 53
3
votes
0 answers

Too many threads on WAITING state in Jetty server

I am using Dropwizard and the embedded jetty server which comes with it. Recently I am noticing too many threads having WAITING state. If I look at the trend then number of threads WAITING bumps up by 5 every time. The acceptors and threadpool for…
thomas
  • 310
  • 2
  • 12
3
votes
0 answers

jetty Persistent Sessions

I'm using persistent sessions with jetty, as described here: http://www.eclipse.org/jetty/documentation/9.3.x/using-persistent-sessions.html Sessions are normally saved and restored after a stop/restart. This is true as long as the application is…
jamp
  • 2,159
  • 1
  • 17
  • 28
3
votes
3 answers

Serving static files with jetty in karaf (outside of bundle)

we are struggling with the simple issue of serving static files from somewhere in the filesystem but outside of the web application, but we can't get it running. There are sever examples on how to do this, but none of them seem to work and so far we…
Florian
  • 53
  • 7
3
votes
1 answer

Embedded Jetty + ShiroFilter problems

I haven't asked questions here yet, but after around 2 months of struggle on this, I decided to finally ask for help. I am new to Java, this is actually my first project (just for fun), in which I am trying to create a web server with Jetty (without…
3
votes
0 answers

Embedded Jetty reads two application contexts

I'm trying to deploy a war file with an embedded Jetty. You can clone a minimal working example here: https://github.com/guilty/jetty-test When you build the project and try to run the war-project with a jetty-runner (which can be downloaded here:…
Paulius K.
  • 813
  • 1
  • 7
  • 13
3
votes
2 answers

Not able to start Jetty in pre-integration-test phase

I would like that Jetty is started before integrations tests, so that I could run my Selenium integration tests against my webapp. However, when I run mvn verify Jetty is not started and Selenium tests naturally fails. Any ideas what is wrong?…
JohnP
  • 1,046
  • 2
  • 16
  • 29
3
votes
1 answer

What's the right way to bootstrap Jersey 2 (with Jetty)?

I've managed to hack my way to a working Jersey/Jetty setup with HK2 injection, but given the vast number of somewhat confusing (and at times inconsistent) docs I'm finding, I'm not sure if I've missed some salient detail of getting it right.. As it…
XeroxDucati
  • 5,130
  • 2
  • 37
  • 66