top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to stop Tomcat if servlet fails to initialize

0 votes

If one servlet fails to initialize, meaning that ServletContextListener.contextInitialized() throws exception, then Tomcat still starts (but without the servlet).
I found out that if servlet calls System.exit(1), then Tomcat dies. Is this the only way to make this happen?

This does not work:
- Dorg.apache.catalina.startup.EXIT_ON_INIT_FAILURE=true

posted Jun 21, 2017 by anonymous

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button

Similar Questions
+1 vote

How do I start and stop just the tomcat admin application from a command line?

I had someone try to guess the password to my Tomee-Plume server last night. Thankfully I changed the default password and the hacker only tried twice. I want to be able to keep the admin application closed most of the time. On the rare occasion that I need access to the tomcat admin console I would like to start it up only for a brief period of time and then stop it.

Internet searches showed me how to stop other applications using the tomcat admin application. I want to stop just the Tomcat admin application not the whole server.

+3 votes

I have been experiencing missing packets during my application testing using Tomcat Server. If someone can help me to identify what is happening, it will be of great value.

Issue: Few packets do not reach the application servlet but tomcat receives them. The missing packets reach the HTTP layer and thereafter they disappear.

This issue is not frequent but occasionally consistent. For the POSTs of missing packet I am not able to find the entry in localhost_access_log.

Version: apache-tomcat-7.0.42
Application entry point: Servlet
OS: Windows 7(32 bit)

0 votes

Is it true that current servlet-based websocket implementation will be deprecated due to the implementation of the JSR-356. We are currently implementing a Tomcat 7-based websocket server implementation that we hoped could scale up to at least 50K concurrent connections [or more], but are concerned if there are any known issues and/or limitations with the websocket implementation in Tomcat 7.

We are currently trying to test how high Tomcat 7 will scale with regards to the maximum number of concurrent websocket connections, but have already hit some problems with only 200 concurrent connections. Perhaps it's our multi-threaded client, or Tomcat configuration - not sure at this point. We have the Tomcat Connector configured with maxConnections=50000 and maxThreads=1000, so 200 concurrent connections shouldn't be a problem.

If anyone could elaborate on the Tomcat 7 servlet websocket implementation stability from a highly concurrent aspect that would be great. Additionally, if anyone has achieved 10(s) of 1000(s) of concurrent websocket connections with Tomcat 7, can you share how Tomcat was configured, what OS it was running on, and what client library you used in testing this?

0 votes

I have a question. I'm doing some oAuth stuff, and the remote site is redirecting me to:


I can see this is the url in the redirect of my browser bar.

What I can't figure out is how to access the part of the URL after the pound sign. I've tried getRequestURI(), getPathInfo(), getServletPath(), getPathTranslated(), and nothing is working. Also, the elements are (correctly) not showing up in the parameters collection.

How can I get that part of the URL from inside a servlet? I am using tomcat.

+2 votes

I want to display a static html page to the user if he wants to access a missing application. The goal is to display this page while updating (redeploy) the application to Tomcat. If the application is available, the user must access the application.

Is there a possibility to do this?