Search This Blog

Wednesday, 11 November 2009

retrieve the HttpServletRequest on an Axis server object

MessageContext context = org.apache.axis.MessageContext.getCurrentContext();
request = (HttpServletRequest)context.getProperty(
               org.apache.axis.transport.http.
               HTTPConstants.MC_HTTP_SERVLETREQUEST);

Monday, 9 November 2009

debug the network activity of a process on Windows

find the process (service) id with
tasklist /SVC

then type

netstat -aovn | findstr <processid>

where <processid> is the process id found by tasklist.

Saturday, 7 November 2009

rsync

how to sync (in simulation mode) the folder myRootPackage under /http/www/myWebapp/WEB-INF/classes on the host "hostname", in the folder /http/lib/myWebapp/WEB-INF/classes/ on the local host

rsync --rsh="/usr/bin/ssh -l username" -avzn --size-only
hostname:/http/www/myWebapp/WEB-INF/classes/myRootPackage 
/http/lib/myWebapp/WEB-INF/classes/

Friday, 6 November 2009

tar gz

to create a tar.gz file
tar -czvf archive.tgz directory --exclude "file"
 
to extract a tar.gz file
tar xvzf file.tar.gz
 

on Solaris:
tar cf tomcat7.tar /tomcat7 | gzip -f tomcat7.tar

Wednesday, 4 November 2009

log swallowing on Tomcat

In order to split the catalina.out across multiple files, each one of which created every day, it's useful to configure the context xml descriptor as below (tested on Tomcat 5.0.28)
/usr/local/tomcat/conf/Catalina/localhost/myApp.xml

<context path="/myWebApp" swallowOutput="true">
<logger directory="logs"
      className="org.apache.catalina.logger.FileLogger"
      prefix="myApp_log."
      suffix=".txt"
      timestamp="true"/>
</Context>

which will create every day a new file called
myApp_log.YYYY-MM-DD.txt
containing the daily ouput

This technique is referred to as "output swallowing" on Tomcat
(note the swallowOutput="true")

Datawarehouse

articles on Datawarehouse
read

What's blocking my lock?

Here comes an extremely clear and interesting article, written by Natalka Roshalk, about Oracle locks and how to monitor what's going on when a lock is blocking a session

read the article