tomcat9

Tomcat is not redirecting to 400 bad request custom error page

删除回忆录丶 提交于 2019-12-22 08:53:38
问题 We have tomcat 9 web server in production. The problem we are facing is we want to show the custom error page for our application if tomcat receives any malformed URL as follows http://URL/| or http://URL/[ I have added error page tag in web.xml of tomcat application server as follows <error-page> <error-code>400</error-code> <location>/error.html</location> </error-page> <error-page> <error-code>404</error-code> <location>/error.html</location> </error-page> and we have error.html in our

Migration to JDK 11 has error occure “java.lang.NoClassDefFoundError: javax/activation/DataSource” (tomcat 9.0.12) [duplicate]

…衆ロ難τιáo~ 提交于 2019-12-18 08:28:21
问题 This question already has answers here : What is the replacement for javax.activation package in java 9? (3 answers) Replacements for deprecated JPMS modules with Java EE APIs (7 answers) Closed last year . I'm migrating java project use JDK8 to use JDK 11 then has error occurred relate of javax activation. Following migration guide from Oracle, I see java.activation that module was removed from JDK 11. After that, I give a suggest to added third parties **activation-1.0.2.jar* but still, an

Migration to JDK 11 has error occure “java.lang.NoClassDefFoundError: javax/activation/DataSource” (tomcat 9.0.12) [duplicate]

孤者浪人 提交于 2019-12-18 08:28:18
问题 This question already has answers here : What is the replacement for javax.activation package in java 9? (3 answers) Replacements for deprecated JPMS modules with Java EE APIs (7 answers) Closed last year . I'm migrating java project use JDK8 to use JDK 11 then has error occurred relate of javax activation. Following migration guide from Oracle, I see java.activation that module was removed from JDK 11. After that, I give a suggest to added third parties **activation-1.0.2.jar* but still, an

Embedded Tomcat - update/delete certificates without restarting

旧城冷巷雨未停 提交于 2019-12-11 17:59:53
问题 I am using embedded Tomcat and using SSLHostConfig to add SNI certificates when I create the connector. It works wonderfully. I am also able to add certificates without restarting Tomcat using something like this: SSLHostConfig sslHostConfig = new SSLHostConfig(); sslHostConfig2.setHostName(host); sslHostConfig2.setCertificateFile(path); connector.addSslHostConfig(sslHostConfig); This also works perfectly. Also, without restarting Tomcat, I can get a list of all the existing SSLHostConfig

How to set SameSite Cookie in Tomcat's Cookie Processor?

非 Y 不嫁゛ 提交于 2019-12-11 17:01:41
问题 Tomcat's context.xml defines CookieProcessor (default LegacyCookieProcessor) https://tomcat.apache.org/tomcat-9.0-doc/config/cookie-processor.html I'm trying to add attribute(s) shown on cookie processor, however that doesn't seems to be working I don't see Tomcat's response header cookie with sameSite attribute being set 回答1: In your web application, inside the META-INF folder create a context.xml file with this inside. <Context> <CookieProcessor sameSiteCookies="strict" /> </Context> If you

HttpServletRequest getLocalAddr not returning local address after migrating to spring 2.1.6

家住魔仙堡 提交于 2019-12-11 15:29:33
问题 I've recently upgrading spring boot from 2.1.0 to 2.1.6 and now HttpServletRequest.getLocalAddr() does not behave as expected anymore. For context, I have a web client and a spring server. When the client connects to the server, the latter sends its IP address to the former. In 2.1.0 and up to 2.1.5 it worked as expected: getLocalAddr returns the local address of the spring server. However, in 2.1.6 it now returns the local address of the client. Spring-boot 2.1.5 use tomcat 9.0.19 Spring

SSL Handshake Debugging not working any more with Apache Tomcat/9.0.0.M22

[亡魂溺海] 提交于 2019-12-10 23:46:39
问题 I have to debug a SSL Handshake on Tomcat (OS: MS Windows), so I followed the instructions found in the web an enabled it with the following line in setenv.bat: set "JAVA_OPTS=%JAVA_OPTS% -Djavax.net.debug=ssl" With Apache Tomcat/9.0.0.M21 everything works fine, when I opened the page with my browser I can see the handshake on the commandline. With Apache Tomcat/9.0.0.M22 I only can see which certificates are beeing loaded on startup but after then when I call the server via browser no more

Java remote debugging (JPDA) not working for me in Tomcat 9

浪尽此生 提交于 2019-12-10 19:29:42
问题 I'm trying to remotely debug a Tomcat webapp on a recently upgraded Tomcat 9.0.13 and Open JDK 11.0.1. Server is Redhat Enterprise Linux 7.6 and I'm using Eclipse on a Windows 7 developer box to connect. Tomcat starts, and the app is accessible on port 8080 but fails on certain requests. So on my Eclipse, I've configured a Remote Java application with my configuration details. When I try to connect to it, the connecting fails with Failed to connect to remote VM. Connection refused. I'm using

Spring+Hibernate- Getting 404 exception

老子叫甜甜 提交于 2019-12-06 12:35:37
问题 I am new to Spring and Hibernate and I would like to create Restful Web services using these technologies. I am getting 404 exception when calling the URL http://localhost:8080/RakeshMavenProject/book . I have created controller,service,Dao classes and mentioned the configuration parameters in AppConfig.java @Configuration @EnableTransactionManagement @ComponentScans(value = {@ComponentScan("com.example.ws.maven_web_service_project.service"), @ComponentScan("com.example.ws.maven_web_service

Tomcat is not redirecting to 400 bad request custom error page

六月ゝ 毕业季﹏ 提交于 2019-12-05 17:25:17
We have tomcat 9 web server in production. The problem we are facing is we want to show the custom error page for our application if tomcat receives any malformed URL as follows http://URL/| or http://URL/[ I have added error page tag in web.xml of tomcat application server as follows <error-page> <error-code>400</error-code> <location>/error.html</location> </error-page> <error-page> <error-code>404</error-code> <location>/error.html</location> </error-page> and we have error.html in our application ROOT folder in webapps directory of tomcat. Whenever the user tries to request any nonexistent