Tip for diagnosing failed paths in Tomcat / OpenEJB ... 

Treat this as an experiment .. which may or may not prove useful  ..

To a relative newcomer (like me) Tomcat logs and stack traces are quite daunting to 
inspect and decipher.  And as you google to find a solution to an app problem there 
are countless more Tomcat logs found in various emails in forums.

So I've started using a free tool .. FILEMON .. to monitor what is going on inside 
Tomcat 5.0 as applications are run.  Helps in diagnosing "file not found" problems in 
webapps.

____________

Go to http://www.sysinternals.com and download FILEMON.EXE

Also you might download ProcessExplorer, a companion utility which can inspect 
handles (including jars) and dll's.

____________

Launch FILEMON and setup filter (click on filter in toolbar)

The "Include" and "Exclude" fields must be set to filter paths on the monitored 
program (in this case tomcat) .. the process name for Tomcat 5.0 is tomcat5.exe

Initially there will be a flood of path reports seen in the FILEMON monitor window 
(because the exclude field starts empty when installed, and there is a wild card * in 
include field).

Start by inserting in the Include field the single keyword .... tomcat ..  (no wild 
card 
*).

Gradually whittle down the unwanted process reports to zero by looking at the 
names in process field and adding each process name (only part name is needed to 
filter) to the exclude list .. usually the applications which are open .. like 
IEXPLORE 
etc.

separate each new filter entry with a semi-colon

typically entries might be .. explore;notepad; .. and others seen in the Process 
column

(you can also see a list of running background processes in Task Manager -  
Ctrl+Alt+Del - to add to the Exclude filter list).

...

When there are no entries seen in monitor window you have succeeded in 
suppressing the background reports and you can launch tomcat server.

...

Now in the Highlight field, insert the filter ... FILE NOT  FOUND

you can try different key phrases to highlight (only one can be used at any time) ..

PATH NOT FOUND
.jar
openejb


Run the Tomcat application you are testing and when a problem is encountered 
capture the FILEMON log  (toolbar button).

After capturing your FILEMON log go to Filemon Filter (toolbar button) drop down 
the highlight menu to select different phrases .. and apply to the captured log

....

You can setup different highlight colours in Options.

Now run your Tomcat server and attempt to run any servlet which is being tested.

Watch the FILEMON screen .. you can capture the screen by clicking on the capture 
button in toolbar

Look for colour highlighted errors in the monitor window  ..

You can save each FILEMON log and inspect later if you are doing several runs.

____________


tip:

If you shutdown Tomcat, then clear the FILEMON window,

put .jar in the Highlight field

then restart Tomcat you will see a highlighted list of all the jars (and their paths) 
which are loaded. at startup

____________


tip:

Use "explorer jump" in FILEMON toolbar to jump to any path selected in the log 
report

____________


tip:

If you run the other utility, ProcessExplorer, and select tomcat5.exe you will see a 
list of all handles or dll's referenced.  Go to "display handles" mode to see all jars.

____________


Summing up.

FILEMON and PROCEXP may not help in all test scenarios .. but they give a useful 
insight into what is going on inside Tomcat and OpenEJB. 

dl




Reply via email to