A list of symptoms and their possible resolution.
An OutOfMemoryError exception is usually an indication that heap memory is being used up. Often this is from application code keeping references to objects that are no longer needed, and the garbage collector does not free them. A heap dump can help determine which code and which kinds of objects are being held.
If the heap dump or other monitoring tools reveal that the server and your appliciation(s) actually are not running out of heap memory then an OutOfMemoryError indicates that then the JVM is running out of virtual memory, i.e. an underlying malloc() call is failing.
Often this situation is indicated by using OS tools to show memory usage, the JVM itself indicates it has heap memory but the OS tool shows that the process is using a very large amount of memory. On Windows the task manager is used, on Unix top or ps.
The only non-heap allocations by the JVM (and therefore Resin and your application) are the following:
If you forget to rewrite a URL, a user who requires rewriting will lose their session as soon as they follow that URL.
Resin establishes an association between a session and a user's browser by establishing a unique id that is returned back with each new request. This is accomplished in one of two ways: using cookies or URL rewriting.
Resin first attempts to track the session of a user by sending the user's browser a cookie containing the unique session id.
Sometimes Resin cannot establish a cookie, either because the user has disabled cookies in their browser or because the browser does not support them (as is the case with some HDML and WML browsers). If the cookie cannot be established then something called URL rewriting is used.
In this case, Resin rewrites every URL that it submits to the user so that it contains a parameter named. Then for each incoming request the first thing it does is look for this parameter, and if it is available it knows a session has been established and it removes the parameter and uses it to find the users session object.
Rewriting requires the cooperation of the developer. The developer must encode every URL reference so that Resin has an opportunity to put in theparameter.
Another possiblity is that the <session-max> setting is too low, and you are getting more users establishing sessions than you have configured Resin for.
Yet another possibility is that the session is timing out, you can use the <session-timeout> tag to configure this.
Whenever a java source file, web.xml, or resin.conf changes then Resin will restart the application. If this happens, your current sessions will be lost unless you have configured a persistent session store.
Some users have reported that if their applciation uses a lot of cookies, the browser will start to discard older cookies to make room for the new. This may result in the browser discarding the cookie that Resin is using to keep track of the session.
If your application uses a lot of cookies, you may need to configure Resin to always use URL rewritting by setting <enable-cookies> to false.
You may also lose your sessions if your cookie domains are incompatible. For example, if you have one server that uses cookie domain "hogwarts.com" and another that uses "qa.hogwarts.com", the cookie in the browser for "hogwarts.com" will interfere with sessions on "qa.hogwarts.com". The solution is to change the cookie domain "hogwarts.com" to "www.hogwarts.com".
You set the cookie domain in <session-config> . (Thanks Laura for providing this)
If you are using Resin and another application server (such as Tomcat), you may encounter a conflict because both of them are using the same cookie name (usually JSESSIONID) for the session tracking cookie.
Resin provides <session-cookie> to let you change the name of the cookie that Resin uses.
This error usually happens when a conflicting jar is found, see Clean up the classpath
If the classpath is completely cleaned up, as suggested in the link, then a jar or some other component of a jdk installation or older Resin installation is coming from somewhere else.
There may be a problem with some jar in your JAVA_HOME tree, if you have added anything there. There may be a conflicting jar in WEB-INF/lib/ of your webapp.
Another possibility is that you have not set JAVA_HOME, or if you have then some component of a conflicting jdk installation (javac for example, or the java executable itself) is getting used.
If on windows, check for stray copies of java.exe outside of JAVA_HOME, for example in C:/WINDOWS/java.exe or anywhere else in your PATH.