Tag Archives: tomcat

Find out the number of connections to tomcat server

Questions: I have a Java/Java EE web application deployed on Tomcat Server 5.5.17. I want to know the number of clients which are connected to the server. How can we find it out? Answers: Most reliable way would be to search for ip.addr.of.srv:port in netstat. Here’s the Windows based example (sorry, no Linux guru here… Read More »

Is there a url rewriting engine for Tomcat/Java?

Questions: How can we provide URL-Rewriting support for Tomcat/Java ? mod_rewrite provides this functionality for Apache and can modify URLs even before they reach the handler (e.g. PHP). Is there a similar tool in Java/Tomcat ? To be more specific we need modifications such as http://www.somedomain.com/person/1 Maps to http://www.somedomain.com/details?personId=1 And this should be transparent to… Read More »

Tomcat 7 “SEVERE: A child container failed during start”

Questions: Basically, I’ve written a springMVC application (with a relatively shotgun my way first-timer approach with regards to Spring). The project works fine on Tomcat 6. My Tomcat server doesn’t start and throws the following exception: Apr 29, 2012 3:41:00 PM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance… Read More »

Get the server port number from tomcat without a request

Questions: Is there any Tomcat API or configuration available which can tell an application (probably on startup), what port its running on without a request? Imagine a scenario where there are two web applications running in the same Tomcat and one of which need to invoke a web service from the other one. We don’t… Read More »

Tomcat vs Weblogic JNDI Lookup

Questions: The Weblogic servers we are using have been configured to allow JNDI datasource names like “appds”. For development (localhost), we might be running Tomcat and when declared in the <context> section of server.xml, Tomcat will hang JNDI datasources on “java:comp/env/jdbc/*” in the JNDI tree. Problem: in Weblogic, the JNDI lookup is “appds” whilst in… Read More »

“SetPropertiesRule” warning message when starting Tomcat from Eclipse [duplicate]

Questions: This question already has an answer here: Setting property 'source' to 'org.eclipse.jst.jee.server:JSFTut' did not find a matching property 6 answers Answers: The solution to this problem is very simple. Double click on your tomcat server. It will open the server configuration. Under server options check ‘Publish module contents to separate XML files’ checkbox. Restart… Read More »

Connecting remote tomcat JMX instance using jConsole

Questions: I am trying to connect to a remote tomcat JMX instance using jConsole. But can’t connect successfully. Any Idea? I included the following option in remote tomcat catalina.sh: JAVA_OPTS=”$JAVA_OPTS -Dcom.sun.management.jmxremote \ -Dcom.sun.management.jmxremote.port=9004 \ -Dcom.sun.management.jmxremote.ssl=false \ -Dcom.sun.management.jmxremote.authenticate=false” Answers: I had a similar, if not the same, problem. I could connect to the JMX server if… Read More »

Detecting client disconnect in tomcat servlet?

Questions: How can I detect that the client side of a tomcat servlet request has disconnected? I’ve read that I should do a response.getOutputStream().print(), then a response.getOutputStream().flush() and catch an IOException, but is there a way I can detect this without writing any data? EDIT: The servlet sends out a data stream that doesn’t necessarily… Read More »