embedded-tomcat-7

Spring Boot “Request method 'GET' not supported” while redirecting POST request to https port through Catalina Connector

徘徊边缘 提交于 2019-12-07 07:05:16
问题 I'm trying to redirect http to https through Catalina Connector in my Spring Boot application. If the incoming POST request is "https" then it is working as expected. But if my incoming POST request is "http" and after the redirection to "https" through below code, somewhere it is getting changed to GET because of which I'm getting - WARN 45028 --- [nio-8443-exec-8] o.s.web.servlet.PageNotFound : Request method 'GET' not supported Below are the methods in my @SpringBootApplication class:

Spring boot - Embedded Tomcat - Connector Customizer - fail to add parseBodyMethods attributes

萝らか妹 提交于 2019-12-06 16:57:09
The original problem is when I sent a http request with method 'DELETE', the body part couldn't be sent to the server. After googling, I found this article that suggests modifying the server.xml file and adding 'parseBodyMethods' to the Connector part can solve the problem: <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" parseBodyMethods="POST,PUT,DELETE" redirectPort="8443" /> However, because I'm using spring's embedded tomcat, I have to find a way to do the same in spring's way. So, I found this article that seems to allow me to add ConnectorCustomizer and add

Reverse Proxy Java

落花浮王杯 提交于 2019-12-06 09:45:17
I am working with a Java web application and I would like to have a reverse proxy masking some of my internal endpoints. Requirements 1. The reverse proxy maps need to be modifiable at runtime e.g if we move some components to another server we should be able to modify the mapping such that new requests are routed to this endpoint. 2. This must be embeddable to a standard servlet container like Jetty. Most of the Java Reverse Proxies out there such as J2EP require mapping information available prior to starting the application. As far as I can see, http://www.membrane-soa.org/service-proxy/

Maven - JSF 2.0 doesn't work on embedded tomcat

雨燕双飞 提交于 2019-12-06 05:36:06
问题 I created a Maven Web Application using JSF 2.2 , Primefaces, Tomcat 7 dependencies. My JSF's implemention is Mojarra 2.2.4, I added this dependecies on my POM: <dependency> <groupId>com.sun.faces</groupId> <artifactId>jsf-api</artifactId> <version>2.2.4</version> <scope>compile</scope> </dependency> <dependency> <groupId>com.sun.faces</groupId> <artifactId>jsf-impl</artifactId> <version>2.2.4</version> <scope>compile</scope> </dependency> But unfortunately, I have problem with tomcat7-maven

tomcat7-maven-plugin: run multiple webapps but port 8080 already in use

南笙酒味 提交于 2019-12-06 01:37:17
问题 I'm trying to use tomcat7-maven-plugin to setup an embedded tomcat container, run webapps in pre-integration-test phase, run integration tests, then shutdown tomcat in post-integration-test phase. The project is a multi-module maven project (contains app1 , app2 , etc). Parent pom.xml looks like following, <build> <plugins> <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.1</version> <configuration> <contextFile>path/to/context.xml<

Spring Boot “Request method 'GET' not supported” while redirecting POST request to https port through Catalina Connector

寵の児 提交于 2019-12-05 12:27:35
I'm trying to redirect http to https through Catalina Connector in my Spring Boot application. If the incoming POST request is "https" then it is working as expected. But if my incoming POST request is "http" and after the redirection to "https" through below code, somewhere it is getting changed to GET because of which I'm getting - WARN 45028 --- [nio-8443-exec-8] o.s.web.servlet.PageNotFound : Request method 'GET' not supported Below are the methods in my @SpringBootApplication class: @Bean public EmbeddedServletContainerFactory servletContainer() { TomcatEmbeddedServletContainerFactory

Automatically starting/stopping web server for frontend tests

泪湿孤枕 提交于 2019-12-02 02:59:40
问题 Now, I start separately embedded tomcat via maven: mvn tomcat7:run And then run the mvn test goal. My question is can I configure maven in order to do that automatically? tomcat has to be started before all tests run, and then stopped. The following maven configuration for tomcat plugin is used: <plugins> <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.1</version> <configuration> <path>/SpringMvcExample</path> <url>http://localhost

Automatically starting/stopping web server for frontend tests

假如想象 提交于 2019-12-02 01:44:31
Now, I start separately embedded tomcat via maven: mvn tomcat7:run And then run the mvn test goal. My question is can I configure maven in order to do that automatically? tomcat has to be started before all tests run, and then stopped. The following maven configuration for tomcat plugin is used: <plugins> <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.1</version> <configuration> <path>/SpringMvcExample</path> <url>http://localhost:8080/manager/text</url> <server>tomcat7</server> </configuration> </plugin> </plugins> I've tried to

Gradle Spring Boot project not working in Tomcat as a WAR

a 夏天 提交于 2019-11-29 11:12:06
I have a simple sample application written in Spring Boot using Gradle dependency. It says helloworld on calling localhost:8080/greetings. I packaged it as WAR and deployed it to a Tomcat as a myWebApp.war. When i call localhost:8080/myWebApp/greetings i get 404. What am i supposed to infer from the below catalina.log Sep 17, 2014 1:43:09 AM org.apache.catalina.core.StandardEngine startInternal INFO: Starting Servlet Engine: Apache Tomcat/7.0.54 Sep 17, 2014 1:43:09 AM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive D:\C813507\Tomcat7\apache-tomcat-7.0

Spring Boot - How to get the running port

佐手、 提交于 2019-11-26 18:52:44
I have a spring boot application (using embedded tomcat 7), and I've set server.port = 0 in my application.properties so I can have a random port. After the server is booted up and running on a port, I need to be able to get the port that that was chosen. I cannot use @Value("$server.port") because it's zero. This is a seemingly simple piece of information, so why can't I access it from my java code? How can I access it? Is it also possible to access the management port in a similar way, e.g.: @SpringBootTest(classes = {Application.class}, webEnvironment = WebEnvironment.RANDOM_PORT) public