Send us your questions on how to improve, troubleshoot or manage your Apache Tomcat deployment. Our team of Apache Tomcat committers and community leaders will review all submitted questions, and post the most relevant questions along with an answer from a real Tomcat Expert. The questions and answers will be made public for the community to collectively learn from and discuss.
Questions submitted are not guaranteed to be posted. The selection process will favor questions of the day that are the most interesting, timely, or relevant to our community. Ensuring your questions is concise, well written, and without annoying broken links, bad grammar or spelling errors will help your question to be answered more readily by the Community Moderators.
This is a regular OutOfMemoryError in the Java Heap, you are receiving the error cause
The reason the JVM crashes, is cause you are using a very old JVM, I suggest you
If you are still seeing an OutOfMemoryError after that, you probably have a memory leak. For that you can use a profile to analyze your memory usage. I prefer YourKit
We are having issues with tomcat on production. Tomcat hangs on production and doesn’t respond to new http requests.
7.0.11 was a very early release and most likely you are running into a bug. I would upgrade to 7.0.27. Even in that release, there are reports of the system hanging -
https://issues.apache.org/bugzilla/show_bug.cgi?id=53173
The bug above shows how a newly introduced feature in Tomcat 7, has had an issue in all released versions.
There are a few work arounds
I have been running Tomcat 6.0.24 in a Netbeans development environment for months. Yesterday, I started getting a "java.lang.NoClassDefFoundError: org/jboss/logging/Logger" message when I try to start Tomcat in Netbeans services. I'm not running jboss, and to my knowledge, I haven't made any changes to my computer. The server output is:
Most likely you have a jboss jar somewhere in your system.
To troubleshoot this, I recommend enabling the -XX:+TraceClassLoading option, and then scan the output for what library it is trying to load your classes from.
The idea was to provide multiple web applications running inside a Tomcat instance with configuration properties from config files located outside the WAR file of the applications. I'm currently trying to provide these configuration properties with a global naming resource (defined inside the server.xml) which is consumed by the said applications to keep the configuration container independent and to avoid direct file access from a web application. So far almost everything already works perfectly! Except that Tomcat obviously caches resources which are looked up via JNDI.
There is sort of a way to get this happen. It is not a cache, instead it is singleton or non singleton.
Take the default example that ships with Tomcat
<Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml" /> <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml" singleton="false"/>Then you are able to decide when getObjectInstance returns a new object, or a cached object in your own code.
I have observed the tomcat 7 process memory (private bytes) was initially 1.2 GB during startup and it got increased to 3.5 GB where my server RAM size is only 4GB after running a 100 users test for 4 hours. this private bytes was not released even after stopping the test. could you please let us know any configurations that might help this or kindly analyze the situation and provide your suggestions/solutions.
Regards,
Raga
Lacking more specific about the behavior that you are seeing and about the environment that you are using to run your tests, and since this is a testing environment, my suggestion to you would be to run your tests while you have a profiler hooked up to Tomcat (YourKit is an excellent profiler). The profiler will allow you to look for memory problems in your application.
That's not to say there is definitely a problem here. It is entirely possible that you could see the heap grow from 1.2 G to 3.5G legitimately. It just depends on your JVM options and the memory demands of your application.
We recently migrated to using the apache tomcat jdbc connection pooling.
We are using v1.1.0.1 of the connection pooling mechanism with tomcat 6.0.33 on Oracle 10g
Our connection pools are configured as follows:
add
testOnBorrow="true" validationQuery="select 1 from dual"
in order to validate your connections
hi Alex, welcome to the world of Java.
My recommendation is that you run without the security manager. It is inherently complex to, and it's not where you start as a beginner.
Before even consider running with the security manager turned on, you need to evaluate your requirements if you even need it. In my experience, 9 out of 10 companies will not need it as they secure the environments where Tomcat runs instead. In shared environments with untrusted parties, such as a shared hosting environment, the security manager comes in handy as it can protect against code.
So, to get started, turn off the security manager, and get your application fully working. The security manager is not a feature of Apache Tomcat, it's part of the Java Runtime Environment.
best
Filip
Hello,
After lots of research, I cannot find the answer. Can you tell me if Apache tomcat 6.0 and 7.0 are windowsserver 2008 64bit and vmware esx 5 compatible?
Thank you
There is really no issue of compatibility between Tomcat and these products. Tomcat 6 & 7 run on the JVM and will run just fine on any system which has a capable implementation of the JVM.
Given that Oracle releases a 64 bit version of the JVM for Windows, you should have no problem running Tomcat 6 or 7 on Windows Server 2008 64-bit.
As for VMware ESX5, you may want to take a look at this link [1]. It documents the best practices for running any Java application, Tomcat 6 & 7 included, on VMware virtualization.
[1] - http://www.vmware.com/resources/techresources/1087
I'm using Tomcat 6.0.14 as part of a cognos product installation. I'm following the installation guide. After installing the product and edit the configuration files, I need to deploy a war and a ear files using de Tomcat Manager application. Trying to log on as the System manager the server returns the following error:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
You need to upgrade your Tomcat version. Besides the fact that 6.0.14 is incredibly old and missing many security fixes, it appears that this bug has been fixed.
From the link you posted:
">My post is actually a bug report. Not a question.
Those NPEs have been fixed in svn and will be in the next release. "
http://markmail.org/message/zalrgnbb7frvfwgj
Hi,
I am interested in catalina.out log file rotation, I have an application where logging to catalina.out is very huge, say 0.5 MB / sec.
So I have written one script to handle this which is shown below.
# crontab -l | grep catalina
0,30 * * * * bash /catalina_log_handler.sh >/dev/null 2>&1
# more /catalina_log_handler.sh
#!/bin/sh
CATLOC=/bin/cat
SEDLOC=/usr/bin/sed
The catalina.out file is created by a shell redirection, ex ">> catalina.out 2>&1". This catches anything written to System.out and System.err and places it into the catalina.out file.
Given this, a good way to rotate catalina.out is to alter the script to pipe the output to a log rotation script rather than directly to a file. This will allow you to rotate the logs without restarting Tomcat and without copying the entire contents of the log to another file.
It's a pretty simple change to catalina.sh and it is described at this link.
http://marc.info/?l=tomcat-user&m=105640876032532&w=2
Popular Links