Archive for April, 2009

Rotation Catalina.out in Tomcat 5/6

By using swallowOutput="true" and configuring a default context we will send all logging to the default log that we have timestamp rolling enabled for. 


Logger className="org.apache.catalina.logger.FileLogger" prefix="catalina_log." suffix=".txt" timestamp="true"

Logger className="org.apache.catalina.logger.FileLogger" directory="logs" prefix="localhost_log." suffix=".txt" timestamp="true" DefaultContext reloadable="false" crossContext="true" swallowOutput="true"

Eclipse MemoryAnalyzer Exit Code=-1

I was looking for a nice tool to read java heap dumps and found that regular JHat was not a great way to go with the 1.6GiB dump files I have. A friend pointed me to a Eclipse project Memory Analyzer (MAT) which is the old SAP analyzer…

Starting it up I got the Exit Code=-1 error and found that this tool is currently not working with java 1.6.x on a mac. If you want to force the tool to use 1.5 open a terminal window and follow these instructions:
freddy@svn:~/mat/$ pwd
freddy@svn:~/mat/$ vi Info.plist
Uncomment this line:
… eworks/JavaVM.framework/Versions/1.5.0/Commands/java
This will force the use of Java 1.5!

uninitialized constant CGI::Session (NameError)

After upgrading one project to Rails 2.3.2 I got an error on startup uninitialized constant CGI::Session (NameError)

Looking into the source I found that I was loading this class CGI::Session::ActiveRecordStore::Session
After a little hunting on Google I was directed to the Rails release notes and found this section:
script/server has been switched to use Rack, which means it supports any Rack compatible server. script/server will also pick up a rackup configuration file if one exists. By default, it will look for a file, but you can override this with the -c switch.
CGI::Session::ActiveRecordStore has been replaced by ActiveRecord::SessionStore.