jetty

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

wsdl2java generated code causes character encoding problems

五迷三道 提交于 2021-02-10 05:57:08
问题 I have generated a bunch of java-files from a WSDL source. I used Apache CXF 2.6.1 for generating the files. When I put the code onto our production box that is running jetty and maven and I send a request to the server via the generated java-files it somehow changes the systems/JVM character encoding. The swedish characters å, ä and ö changes into Ã¥, ä, ö. I can't reproduce this on my own box. Someone have any idea? 回答1: Since version 2.5.4 there is a new command line option -encoding

wsdl2java generated code causes character encoding problems

ぐ巨炮叔叔 提交于 2021-02-10 05:57:06
问题 I have generated a bunch of java-files from a WSDL source. I used Apache CXF 2.6.1 for generating the files. When I put the code onto our production box that is running jetty and maven and I send a request to the server via the generated java-files it somehow changes the systems/JVM character encoding. The swedish characters å, ä and ö changes into Ã¥, ä, ö. I can't reproduce this on my own box. Someone have any idea? 回答1: Since version 2.5.4 there is a new command line option -encoding

How to make jersey servlet to load more than one service or class in java REST application

人盡茶涼 提交于 2021-02-08 11:44:25
问题 I have Two different java files in the same package. The classes are EntryPoint.java and ModelInn.java . Now, when the jersey servlet starts, I want it to load both the EntryPoint class and ModelInn class. But For the meantime I can only load one. But I want to load the two classes. Am using jetty 9. Below is the code i used to load EntryPoint java class package com.rest.test; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse

Standalone Jetty - configure multiple context paths for same context instance

十年热恋 提交于 2021-02-08 08:38:39
问题 Is it possible to configure jetty - vers. 9 (server config files or context xml files) so that the same context instance has the multiple context paths? (that point to the same loaded application, not different instances of the same .war). In the docs it seams that only one context path can be set. I need this because I want to set the default context path (root /) of my webapps without changing the context .xml files of my applications (and switch the / path from one app to another without

Servlet class org.restlet.ext.servlet.ServerServlet is not a jakarta.servlet.Servlet

非 Y 不嫁゛ 提交于 2021-02-08 05:47:42
问题 What could be causing this error? Caused by: jakarta.servlet.UnavailableException: Servlet class org.restlet.ext.servlet.ServerServlet is not a jakarta.servlet.Servlet at org.eclipse.jetty.servlet.ServletHolder.checkServletType (ServletHolder.java:499) at org.eclipse.jetty.servlet.ServletHolder.doStart (ServletHolder.java:377) at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:96) at org.eclipse.jetty.servlet.ServletHandler.lambda$initialize$2 (ServletHandler

BaseX REST API: Set custom HTTP response header

冷暖自知 提交于 2021-02-08 04:54:09
问题 I want to include the following HTTP header to all responses by the BaseX REST API: Access-Control-Allow-Origin: * Is this possible? 回答1: BaseX uses Jetty below the hood. You can modify the web.xml file to make Jetty send CORS headers, but either use at least BaseX 8.6.3 which added the jetty-servlets library or have to add the jetty-servlets jar to your $CLASSPATH (BaseX already ships jetty-servlet , which is a different class; and be sure to fetch the appropriate version matching what's

Jetty, where are my five threads?

孤街浪徒 提交于 2021-02-07 18:30:11
问题 I'm using spring+jetty. I'm configuring jetty: @Bean public JettyEmbeddedServletContainerFactory jettyEmbeddedServletContainerFactory() { final JettyEmbeddedServletContainerFactory factory = new JettyEmbeddedServletContainerFactory(port); factory.addServerCustomizers((Server server) -> { final QueuedThreadPool threadPool = server.getBean(QueuedThreadPool.class); threadPool.setMinThreads(minThreads); threadPool.setMaxThreads(maxThreads); threadPool.setIdleTimeout(1000); }); return factory; }

Spring Boot 容器选择 Undertow 而不是 Tomcat

北城以北 提交于 2021-02-05 06:15:11
Spring Boot 内嵌容器Undertow参数设置 配置项: # 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程 # 不要设置过大,如果过大,启动项目会报错:打开文件数过多 server.undertow.io -threads=16 # 阻塞任务线程池, 当执行类似servlet请求阻塞IO操作, undertow会从这个线程池中取得线程 # 它的值设置取决于系统线程执行任务的阻塞系数,默认值是IO线程数 *8 server.undertow.worker -threads=256 # 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理 # 每块buffer的空间大小,越小的空间被利用越充分,不要设置太大,以免影响其他应用,合适即可 server.undertow.buffer -size=1024 # 每个区分配的buffer数量 , 所以pool的大小是buffer -size * buffers-per- region server.undertow.buffers -per-region=1024 # 是否分配的直接内存(NIO直接分配的堆外内存) server.undertow.direct -buffers= true 来看看源代码: https:/

Getting `NoClassDefFoundError` for classes `FutureCallback` and `LazyList` using Jetty Maven plugin 9.4.32.v20200930 on Java 11

余生颓废 提交于 2021-01-29 11:18:41
问题 I started a few months ago to maintain an old Spring project using the Jetty Maven plugin. I'm currently trying to port it to Java 11 but Jetty won't start the server and (silently) fails with MultiException[java.lang.NoClassDefFoundError: org/eclipse/jetty/util/FutureCallback, java.lang.NoClassDefFoundError: org/eclipse/jetty/util/LazyList] . This seems to be an old bug of the Jetty Maven plugin that I can reproduce on various 9.x versions. It seems fixed in versions 10 and 11 and I would