tags:

views:

210

answers:

4

I am trying to find out why Apache CXF is running away doing "something" upon first-time initialization of a web-service. "Something" is probably some kind of IO, and I'm guessing it's trying to resolve an external address/schema/DTD of some sort.

So I'm trying to find some kind of hook where I can monitor all IO. Either at VM level or at OS level (I can run on both linux and windows but I'm not allowed to run wireshark, and there is a theoretical possibility that it could be file IO).

Any suggestions on how I can track down what is happening ?

+1  A: 

On windows you can use filemon, it'll list out all file accesses and allows you to filter them so you only see those of the process your interested in.

Looks like for more recent versions of windows Process Monitor is the way forward.

Tom
+3  A: 

One way if you really want do know whats happening is to run 'strace' or 'ltrace' on the apache process. There is a short introduction to it here. The interesting is that strace should block in a certain call, ie waiting for i/o if your hypothesis is correct.

To check what files (and network sockets) a certain process is using, have a look at 'lsof'. For instance, to check what files are opened by a certain process:

lsof -p process_id  # by PID
lsof -c httpd       # by a process name

To check network connections in general, try 'netstat'

Martin Wickman
+1  A: 

In addition to strace and filemon, which monitor the app from the OS level, you might also want to give an interactive profiler a shot. A tool like Sun's free VisualVM can show you how frequently various methods are being called, as well as an easy way to generate and view thread dumps. That way, you can see if the app is spinning in your own code, or if the thread is blocking waiting for some IO that never completes.

joev
I was actually using jprofiler and seeing that the IO was happening in a specific method, but still couldn't quite see what was happening.
krosenvold
+1  A: 

It's most likely busy resolving the WSDL, parsing it, processing it, etc....

Actually, first time, it's also processing all the spring config files which involves loading schemas for those as well and validating and such.

You COULD also run something like wireshark to track all the network traffic to see if it's going out to get anything.

Daniel Kulp
I'm loading the wsdl from a resource. But it seems like you're right. Add a little bit of classloading and it just takes a lot of time.
krosenvold