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
1 answer

Setting default character encoding and content type in embedded Jetty

I'm making a DSL for embedded Jetty, and I'm having trouble setting characterEncoding and contentType. I want the users to be able to specify default values for these two fields, but Jetty is making life hard. res.characterEncoding = null gives…
tipsy
  • 402
  • 4
  • 15
3
votes
2 answers

Keycloak conflict (core and adapter)

When trying to run my webapplication in both an embedded jetty (locally) and a 'normal' jetty instance (remotely), I think I encounter some class collision. java.lang.ClassCastException: org.keycloak.adapters.RefreshableKeycloakSecurityContext…
Cloud
  • 458
  • 1
  • 13
  • 34
3
votes
1 answer

how to embed spring mvc application with jetty

I have a working Spring MVC application(doing everything I wanted when deployed to jboss) and now I'm looking a way how to start my application from a jar. What I've though of is when starting jar, first some kind of web server should be started in…
London
  • 14,986
  • 35
  • 106
  • 147
3
votes
2 answers

Spring Boot Jetty Auto Redirect HTTP (Port 80) requests to HTTPS (Port 8443)

I have the following code to configure Jetty server: @Configuration public class RedirectHttpToHttpsOnJetty2Config { @Bean public ConfigurableServletWebServerFactory webServerFactory() { JettyServletWebServerFactory factory = new…
Vinay
  • 153
  • 1
  • 2
  • 10
3
votes
1 answer

How to serve index.html with embedded jetty?

I have created the embedded jetty server below. It successfully servers my REST API from [host]:[port]:/api/ I now have an Angular app that I want to serve in addition to the API, how do I update my code so that the server serves the app's…
Drew
  • 57
  • 1
  • 7
3
votes
1 answer

Set HttpOnly for all cookies in spark-java

I developed a web UI to configure a device. To secure this UI which achieves OWASP top 10 and fix bug that reported by Acunetix application, some improvement must be done on it. One of them is setting HTTP-ONLY for cookies. How can change/set cookie…
M-Razavi
  • 3,327
  • 2
  • 34
  • 46
3
votes
0 answers

org.eclipse.jetty.io.EofException of Jetty websocket

I utilize Jetty (9.4.1) websocket for 2 ways communication between client and server. On Client side, the messages 'onerror' and 'onclose' of WebSocket are listened, so that when there is a problem, the client will make a new connection. On…
Khoa Bui
  • 733
  • 1
  • 7
  • 15
3
votes
2 answers

How to configure embedded Jetty to use LdapLoginModule?

I have the following initialization for my Jetty Servlet. HashLoginService works however I the LdapLoginModule is not connected to JAASLoginService, "ldaploginmodule" refers to the default ldap-loginModule.conf which I want to skip and pass all the…
Marc
  • 442
  • 7
  • 15
3
votes
1 answer

Change embedded Jetty log level for fatal errors

By default, Jetty does not log anything with a level higher than WARN, which is inappropriate for fatal errors such as OutOfMemory errors. (Most enterprise ops monitoring teams look for ERRORs in logs, not WARN.) How can I arrange logging so that…
Channing Walton
  • 3,977
  • 1
  • 30
  • 59
3
votes
1 answer

Spring framework best practices: deploying a non-bean compliant component

I want to build an MVC app using Spring (first timer here). As such I want to embed Jetty as the servlet engine. Jetty however doesn't stricly follow the java beans pattern, so I can't launch some classes from Spring (they use overloaded setters or…
David Parks
  • 30,789
  • 47
  • 185
  • 328
3
votes
1 answer

No DestinationFactory was found for the namespace - create uber JAR of CXF with Jetty

I want to create an uber JAR for a CXF-based application server. I want to run the server from the commandline with java -jar. In the IDE, I can run the main class com.connexta.desertcodecamp.Server, but I am not correctly creating the uber…
ahoffer
  • 6,347
  • 4
  • 39
  • 68
3
votes
2 answers

How to configure async timeout in embedded jetty using spring boot application

I am using an embedded jetty container using spring boot. If my request take too long, Jetty fails on 503. In jetty logs I see this: Dispatch after async timeout So, I assume the async timed out. However, I couldn't find where to update this timeout…
YaOg
  • 1,748
  • 5
  • 24
  • 43
3
votes
2 answers

How to make jetty ErrorHandler display error in json format in java

I have the jetty server started this way by the sample code below where I have written my own errorHandler class. Through some few research, I got some information here. But it seems not enough to get me what I want. The name of the class that I set…
Young Emil
  • 2,220
  • 2
  • 26
  • 37
3
votes
1 answer

Jetty publish endpoints on multiple TCP ports

We are using Jetty 9.3 embedded and publishing multiple webservice Endpoints (using Endpoint.publish). I'm however unsure how to publish some of them on a different TCP port. Endpoint publishing: endpoint =…
Mattias Isegran Bergander
  • 11,811
  • 2
  • 41
  • 49
3
votes
1 answer

Spark application with Jetty embedded server is not logging bubbled exceptions

It's a really basic setup, I am using slf4j-simple I have the following route: get("/fail", (req, res) -> { throw new RuntimeException("fail"); } ); As expected, it throws 500 internal error. However, the logs…
Jonah
  • 2,040
  • 7
  • 29
  • 32