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
4
votes
2 answers

Why doesn't Shiro's AnonymousFilter create new web sessions in this example?

I have two applications secured with Shiro allowing anonymous access to all pages. One is a WAR deployed inside a Jetty server, and the other is a standalone Java application with an embedded Jetty server. Why does the standalone app not create…
user1886323
  • 1,179
  • 7
  • 15
4
votes
1 answer

Generate a jar with embedded Jetty using maven jetty plugin?

I use the mvn jetty:run goal from the maven jetty plugin to start my web application project, built using maven. Now I want to create a fat jar with embedded Jetty so that I will be able to start my app using java -jar. Is there a way to use the…
Adam Siemion
  • 15,569
  • 7
  • 58
  • 92
4
votes
0 answers

Elastic Beanstalk Embedded Jetty

I am building bunch of services with embedded jetty. I prefer to deploy those services in Elastic Beanstalk. Elastic Beanstalk supported environments comes with Tomcat which is not required for me. So which environment should I use to run my…
4
votes
2 answers

Path to static content with Embedded Jetty

I'm using embedded Jetty to serve static content from the "public" folder in my project: Server server = new Server(9999); ServletContextHandler context = new ServletContextHandler(); context.setContextPath("/"); ServletHolder…
Avalanche
  • 386
  • 2
  • 10
4
votes
1 answer

Spring boot WAR size with different embedded servers

I am doing som experimentation with spring-boot and i realized that when i use embedded Tomcat server the resulting WAR size is smaller than when i use Jetty or even Undertow servers with same rest dependencies. How is this possible? ... it is…
Rafael
  • 2,521
  • 2
  • 33
  • 59
4
votes
2 answers

Spring + PostgreSQL > Multiple SLF4J bindings

Im currently trying to setup a Spring 4 / Hibernate 4 / PostgreSQL project. When I add the JDBC driver for PostgreSQL, i get following exception: SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in…
Thomas Schmidt
  • 1,248
  • 2
  • 12
  • 37
4
votes
1 answer

Accessing HttpSession inside an annotated @WebSocket class on Embedded Jetty 9

How can I access a HttpSession object inside an annotated @WebSocket class in Jetty 9? I found how to do it using @ServerEndpoint annotation, like here: HttpSession from @ServerEndpoint Using the @WebSocket annotation, like in the class bellow, how…
reinaldoluckman
  • 6,317
  • 8
  • 42
  • 50
4
votes
2 answers

Browser can't connect to Jetty server

I saw another question like this on StackOverflow, but the answers he got were pretty, rediculous. "Connect to the localhost." -- Like, okay. Anyway, the problem is I finally got my embedded Jetty server to compile and run, the problem was since…
Hobbyist
  • 15,888
  • 9
  • 46
  • 98
4
votes
3 answers

Cannot get logging to work right with embedded Jetty

I have an app using embedded Jetty. Everything works well, except for logging. I am now trying to use logback, but am getting fatal errors. The app loads as you can see: $ java -XX:+UseConcMarkSweepGC -XX:PermSize=64M -XX:MaxPermSize=256M -Xms1G…
barclay
  • 4,362
  • 9
  • 48
  • 68
4
votes
1 answer

Removing only the version number from Jetty's response header

This answer explains how the server version header can be completely removed by using HttpConfiguration.setSendServerVersion(false). Is there a way to preserve the header, removing only the version number? I am using Jetty 9.
Vitaliy
  • 8,044
  • 7
  • 38
  • 66
4
votes
1 answer

How do I dynamically add servlets to a jetty server?

I create a jetty server and want to programmatically and dynamically add servlets. I setup logging and a console then proceed to create the server as follows: Connector httpConn = null; Connector httpsConn =…
4
votes
2 answers

Embedded Jetty does not find Annotated Servlet

Short: I have a project that provides a war artifact which includes a servlet with annotations but no web.xml. If i try to use the war in jetty i always get only the directory listing of the war content but not the servlet execution. Any idea? Long…
kDot
  • 43
  • 1
  • 6
4
votes
3 answers

Redirect to a different port keeping all the rest

On the server (embedded Jetty), I need to redirect to a different port leaving everything else unchanged, e.g., redirect…
maaartinus
  • 44,714
  • 32
  • 161
  • 320
4
votes
1 answer

jQuery CORS request dies on preflight OPTIONS request in FireFox

I can't tell where the breakdown occurs, whether this is a jQuery problem or a Compojure problem or what. I would like to make this cross-domain request: function signup() { var signup_username = $('#signup_username').val(); var…
cerhovice
  • 676
  • 1
  • 10
  • 24
4
votes
0 answers

jersey error java.lang.IncompatibleClassChangeError: Implementing class in jetty embedded

running jersey 2.5.1 and embedding jetty jetty-9.1.2.v20140210 I want an embedded jetty server capable of servlet 3x as well as jersey. I know that my jetty instance works as servlet handler and static file hander. however the following details I…