I / O tracking in a Java application?

I am trying to find out why Apache CXF escapes doing something the first time a web service is initialized. "Something" is probably some kind of IO, and I assume it is trying to resolve some kind of external address / scheme / DTD.

So, I'm trying to find some kind of hook where I can control all the IO. Either at the VM level, or at the OS level (I can work on both Linux and Windows, but I am not allowed to run wirehark, and there is a theoretical possibility that this could be an IO file).

Any suggestions on how I can track what is happening?

+4
source share
5 answers

One way, if you really want to know what is going on, is to run "strace" or "ltrace" in the apache process. It has a brief introduction here . Interestingly, strace should block on a specific call, i.e. Expect I / O if your hypothesis is correct.

To check which files (and network sockets) are using a particular process, see "lsof". For example, to check which files are opened by a specific process:

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

To check network connections in general, try 'netstat'

+4
source

In windows you can use filemon , it will list all accesses to files and allows you to filter them so that you can see only those of them that are of interest to you.

It appears that for later versions of Windows Process Monitor is the way forward.

+2
source

In addition to strace and filemon, which control the application from the OS level, you can also give an interactive profiler. A tool like Sun VisualVM can show you how often various methods are called, as well as an easy way to generate and view a dump stream. That way, you can see if the application is running in your own code, or if the thread blocks waiting for any input / output that never terminates.

+2
source

Most likely, he is busy with the WSDL solution, analyzes it, processes it, etc ...

Actually, for the first time, it also processes all spring configuration files, which include loading schemes for these purposes, as well as checking, etc.

You can also run something like wirehark to monitor all network traffic to see if anything is coming out.

+2
source

You can track your application at the JVM level using InTrace . This will allow you to determine which Java code was running at startup. This uses the Java agent to add tools to classes as they are loaded, so it can generate method I / O calls for all classes used.

+1
source

All Articles