embedded-jetty

How to collect and get connection pool statistics using jetty and spring boot?

时光总嘲笑我的痴心妄想 提交于 2021-02-11 14:39:46
问题 I'm developing simple Spring Boot web application with embedded Jetty server. I'd like to have some statistics on connection pool usage (i.e. how many threads, avg request time. avg queue wait time, queue size etc.) I realized that Spring Boot configures Jetty with QueuedThreadPool which has few basic metrics. Is there more sophisticated bean or module designated for statistics collecting in Spring Boot? How to enable it? 回答1: Have you had a look at Spring boot actuator? It provides you with

updating embedded jetty webapp in eclipse during run

半世苍凉 提交于 2021-02-11 08:54:54
问题 we have a maven generated webapp that runs in an embedded jetty server all stuffed into a fat jar. This seems to work fine but our UI developer is unhappy because when doing his UI stuff he wants to make changes to his code and not have to restart the webapp to have it show up. It was working like that before I did all the jar stuff. we have a resources section in the pom that looks like this: <resources> <resource> <directory>src/main/resources</directory> </resource> <resource> <directory

Programmatically set Jetty configuration to increase allowed URL length

♀尐吖头ヾ 提交于 2020-12-05 06:00:35
问题 We're using embedded Jetty 9.3.1.v20150714 and ran into the problem in which our long query URL, combined with the other headers, were longer than those allowed. The solution seems straightforward: increase the requestHeaderSize in HttpConfiguration . But how do I do that easily? I'm currently creating a Server , a ServletContextHandler , and a ServletHolder . But to mix in a custom HttpConfiguration , do I have to create a new ServerConnector and HttpConnectionFactory ? Do I have to override

jetty org.apache.jasper.JasperException: Unable to compile class for JSP

百般思念 提交于 2020-06-13 11:01:46
问题 org.apache.jasper.JasperException: Unable to compile class for JSP i use the embedded jetty org.apache.jasper.JasperException: Unable to compile class for JSP at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:610) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:368) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330) at org.eclipse.jetty.jsp

Generate a jar with embedded Jetty using maven jetty plugin?

雨燕双飞 提交于 2020-02-22 06:12:25
问题 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 maven jetty plugin to generate a fat jar with embedded Jetty? 回答1: MarianP already answered your question in the comment. Add your jetty dependencies in your pom.xml <!-- jetty dependencies --> <dependency> <groupId>org.eclipse.jetty</groupId>

Generate a jar with embedded Jetty using maven jetty plugin?

北慕城南 提交于 2020-02-22 06:12:06
问题 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 maven jetty plugin to generate a fat jar with embedded Jetty? 回答1: MarianP already answered your question in the comment. Add your jetty dependencies in your pom.xml <!-- jetty dependencies --> <dependency> <groupId>org.eclipse.jetty</groupId>

How do I programmatically set gzip in Jetty?

感情迁移 提交于 2020-02-02 02:59:08
问题 I'm writing a web app using Noir and clojure, which uses Jetty. Jetty has two ways of using gzip, one for static, and one for dynamic, they are described in https://stackoverflow.com/a/9113129/104021. I want to turn on both static and dynamic gzipping, but our project doesn't use web.xml files, and doesn't want to start. How do I programmatically set jetty to use gzip (ie without having a web.xml)? 回答1: In a Compojure app I'm working on, I have a Ring/Jetty adapter based on ring-jetty-adapter

Getting a 403 on root requests when using a ResourceHandler and custom handler in Jetty

柔情痞子 提交于 2020-01-30 05:13:34
问题 In (embedded) Jetty, I'm trying to use a ResourceHandler to serve static files and a custom handler to respond to dynamic requests. Based on this page I have a setup that looks like this: public static void main(String[] args) throws Exception { Server server = new Server(); SelectChannelConnector connector = new SelectChannelConnector(); connector.setPort(8080); server.addConnector(connector); ResourceHandler resource_handler = new ResourceHandler(); resource_handler.setDirectoriesListed

RESTEasy, CDI, embedded Jetty, bean validation is ignored

喜你入骨 提交于 2020-01-24 01:04:07
问题 I've a Groovy project where I use RESTEasy with Weld and deploy to embedded Jetty. What I can't seem to get working is bean validation. RESTEasy documentation says that adding resteasy-validator-provider-11 along with hibernate validator dependencies ( hibernate-validator, hibernate-validator-cdi, javax.el-api, javax.el ) is enough. But the bean validation is simply ignored by RESTEasy. I curiously also get the following message in the logs: plugins.validation.ValidatorContextResolver -