undertow

javax.faces.context.FacesContextFactory Exception while embedding Undertow with JSF application

蹲街弑〆低调 提交于 2019-12-07 21:38:26
问题 I am trying to build a simple JSF web application using embedded Undertow server. Gradle dependencies for the project: dependencies { compile group: 'io.undertow', name: 'undertow-core', version: '1.4.0.CR3' compile group: 'io.undertow', name: 'undertow-servlet', version: '1.4.0.CR3' compile group: 'javax', name: 'javaee-api', version: '7.0' compile group: 'org.glassfish', name: 'javax.faces', version: '2.2.11' } Sample Undertow Server Code: public class HelloWorldServer { public static void

Rule in undertow-handlers.conf to redirect HTTP to HTTPS

落爺英雄遲暮 提交于 2019-12-07 21:34:08
问题 I have a Wildfly behind a load balancer, the connection between them is always HTTP. The connection between the client and the load balancer can be HTTP or HTTPS. The load balancer sets a header (X-Forwarded-Proto) to let the Wildfly know which protocol the client is using. I'm trying to write an Undertow rule to redirect to HTTPS taking into account all the conditions above. This is one of my more successful tries (this rule is written in the undertow-handlers.conf file and it's the only

java.lang.ClassNotFoundException: sun.misc.Cleaner

匆匆过客 提交于 2019-12-07 06:36:31
问题 When using Undertow 1.4.20 (as embedded Servlet engine), i get this exception when running our app under Java 9.=: java.lang.ClassNotFoundException: sun.misc.Cleaner Cause is this line in io.undertow.server.DirectByteBufferDeallocator : tmpCleanerClean = Class.forName("sun.misc.Cleaner").getMethod("clean"); This class does indeed not exists anymore in Java 9. But a replacement is available: java.lang.ref.Cleaner Can i ignore this exception for now? Is there a timeline for fixing this (i.e.

Compojure handler friend/authenticate eats body of POST request

核能气质少年 提交于 2019-12-07 05:56:42
问题 How can I safely get the content of the :body InputStream from compojure? See related but different question for background. I'm trying to authenticate my ring routes with Friend using compojure handler/site but when I try to read the :body from an http POST request (which is a Java InputStream ), it is closed: 23:01:20.505 ERROR [io.undertow.request] (XNIO-1 task-3) Undertow request failed HttpServerExchange{ POST /paypal/ipn} java.io.IOException: UT000034: Stream is closed at io.undertow.io

Hosting multiple domains with WildFly (Undertow)

て烟熏妆下的殇ゞ 提交于 2019-12-07 03:20:59
问题 For example I have two domains ( app1.com , app2.com ) and two ears ( app1.ear , app2.ear ). Each EAR file consists of ejb.jar and web.war. Also each WAR has context root: /app1 or /app2 . So if I start WildFly I will have two applications running on localhost:8080/app1 and localhost:8080/app2 . How I can bind app1.com to localhost:8080/app1 and app2.com to localhost:8080/app2 ? As I understand, I should modify Undertow subsystem configuration in standalone.xml. I tried: <server name="default

HTTP Handler and Resteasy Deployment with undertow and resteasy

只谈情不闲聊 提交于 2019-12-07 02:36:59
问题 I am trying to run both HTTPServer and also the REST Handler. Only one works at a time not able to make it work both at same time. I need to serve html pages and also the api. here is my code. public class HttpServer { private final UndertowJaxrsServer server = new UndertowJaxrsServer(); private static String rootPath = System.getProperty("user.dir"); private final Undertow.Builder serverBuilder; public HttpServer(Integer port, String host) { serverBuilder = Undertow .builder()

Docker部署Spring Boot项目 笔记

孤人 提交于 2019-12-07 01:34:20
最近在看Docker,正好公司要做要一个小功能开发,所以决定拿来练一下手,以下是一些笔记。 创建一个Spring Boot 项目,网上很多这个自己查找一下。 弃用tomcat,选用undertow 最近看到了一个Web容器,在高负载的情况下号称可以胜过tomcat 和 jetty,那就是undertow。既然是练手,那就抛弃一下tomcat。所以我的项目用的是undertow。 在maven中的配置,不用默认的tomcat <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> /dependency> 引入undertow <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-undertow<

javax.faces.context.FacesContextFactory Exception while embedding Undertow with JSF application

♀尐吖头ヾ 提交于 2019-12-06 15:35:34
I am trying to build a simple JSF web application using embedded Undertow server. Gradle dependencies for the project: dependencies { compile group: 'io.undertow', name: 'undertow-core', version: '1.4.0.CR3' compile group: 'io.undertow', name: 'undertow-servlet', version: '1.4.0.CR3' compile group: 'javax', name: 'javaee-api', version: '7.0' compile group: 'org.glassfish', name: 'javax.faces', version: '2.2.11' } Sample Undertow Server Code: public class HelloWorldServer { public static void main(final String[] args) throws ServletException { DeploymentInfo servletContainer=Servlets.deployment

Spring Boot Tomcat配置

回眸只為那壹抹淺笑 提交于 2019-12-06 12:48:31
参数配置容器 server.xx开头的是所有servlet容器通用的配置,server.tomcat.xx开头的是tomcat特有的参数,其它类似。 所有参数绑定配置类:org.springframework.boot.autoconfigure.web.ServerProperties # EMBEDDED SERVER CONFIGURATION (ServerProperties) server.address= # Network address to which the server should bind to. server.compression.enabled=false # If response compression is enabled. server.compression.excluded-user-agents= # List of user-agents to exclude from compression. server.compression.mime-types= # Comma-separated list of MIME types that should be compressed. For instance `text/html,text/css,application/json` server.compression.min

Rule in undertow-handlers.conf to redirect HTTP to HTTPS

那年仲夏 提交于 2019-12-06 07:55:12
I have a Wildfly behind a load balancer, the connection between them is always HTTP. The connection between the client and the load balancer can be HTTP or HTTPS. The load balancer sets a header (X-Forwarded-Proto) to let the Wildfly know which protocol the client is using. I'm trying to write an Undertow rule to redirect to HTTPS taking into account all the conditions above. This is one of my more successful tries (this rule is written in the undertow-handlers.conf file and it's the only thing in that file): regex('/(.*)') and regex(pattern='http',value='%{i,X-Forwarded-Proto}',full-match