Reputation: 77131
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 ?
Upvotes: 5
Views: 3176
Reputation: 6251
You could trace your application at the JVM level using InTrace. This would allow you to identify what Java code was being executed during startup. This uses a Java agent to add instrumentation to classes as they are loaded so can generate method entry/exit calls for all of the classes being used.
Upvotes: 1
Reputation: 14607
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.
Upvotes: 2
Reputation: 1384
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.
Upvotes: 2
Reputation: 19905
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'
Upvotes: 4
Reputation: 44821
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.
Upvotes: 2