I found the problem,
The reason I get the exception when run with ant but didn't get it while in Eclipse IDE is because in the project, I am referring the resin.jar of version 3.0.21 and the API has been changed in resin 4.0.32 for ThreadPool
related functions. It is no longer in com.caucho.util
. When I debug using Eclipse, resin 3.0.21 is in the class path. But when I ran with ant, we are using resin 4.0.32.
I guess it is the same reason for the first question. I am not using the right function to read the stats.
Hope this helps.