embedded-tomcat-8

Code works with Embedded Apache Tomcat 8 but not with 9. What's changed?

纵然是瞬间 提交于 2019-11-28 03:20:49
问题 Embedding Apache Tomcat into an eclipse web app project. The code works when I'm using the latest Tomcat 8 (8.0.5 Embedded) jars as dependencies, and this server responds at http://localhost:8080, however, it fails to start the same way and does not respond in this address when using the latest Tomcat 9's (9.0.5 Embedded) jars. The code is very simple. I've researched as thoroughly as I could but didn't figure out what's wrong. package app; import org.apache.catalina.LifecycleException;

Howto use JNDI database connection with Spring Boot and Spring Data using embedded Tomcat?

我与影子孤独终老i 提交于 2019-11-27 23:23:04
When I try to use a JNDI datasource with Spring Boot and Spring Data JPA using an embedded Tomcat server, I get the following error message when running the application with SpringApplication.run: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.orm.jpa

@WebServlet annotation doesn't work with Tomcat 8

为君一笑 提交于 2019-11-27 08:55:40
I want to use the @WebServlet annotation in a Java EE webapp which runs on Tomcat 8. I have read that I need to declare Servlet Version 3.1 in my web.xml and that my Servlet needs to extend HttpServlet . I did all that but still the @WebServlet doesn't work. I am getting a HTTP 404. I also tried my configuration with metadata-complete="false" in my web.xml , but still no success. Here is my web.xml and Servlet. The complete sample code can be found on GitHub . web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www

Invalid character found in the request target in spring boot

偶尔善良 提交于 2019-11-27 03:10:38
问题 My application is started with java -jar with version 1.5.6.RELEASE of spring boot. The content of one of my request has the character "{".When it is sended to server the following exception is raised: java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986 at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:472) at org.apache.coyote.http11.Http11Processor.service

Spring boot embedded tomcat logs

99封情书 提交于 2019-11-27 02:42:32
问题 i'm using spring boot embedded tomcat with spring boot 1.5.9 , im also using Log4j2. recently i exerience problems during load, so i want to understand better the tomcat logs [Not the access Logs] , i tried (in application.properties) : logging.level.org.apache.tomcat: INFO logging.level.org.apache.catalina: INFO but none of the above worked. is there any other way to achieve it ? 回答1: Found it !! You are now able to see the internal Logs of Embedded Tomcat in your App's Log4j log file with 3

Howto use JNDI database connection with Spring Boot and Spring Data using embedded Tomcat?

旧城冷巷雨未停 提交于 2019-11-26 21:30:37
问题 When I try to use a JNDI datasource with Spring Boot and Spring Data JPA using an embedded Tomcat server, I get the following error message when running the application with SpringApplication.run: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework

@WebServlet annotation doesn&#39;t work with Tomcat 8

与世无争的帅哥 提交于 2019-11-26 14:22:30
问题 I want to use the @WebServlet annotation in a Java EE webapp which runs on Tomcat 8. I have read that I need to declare Servlet Version 3.1 in my web.xml and that my Servlet needs to extend HttpServlet . I did all that but still the @WebServlet doesn't work. I am getting a HTTP 404. I also tried my configuration with metadata-complete="false" in my web.xml , but still no success. Here is my web.xml and Servlet. The complete sample code can be found on GitHub. web.xml <?xml version="1.0"