– Ankush Kumar, Lead Software Engineer @ Adobe
- Go to Websphere console -> Servers -> Application servers -> server1 -> Process Definition -> Java Virtual Machine.
- Enable the checkbox against Debug Mode.
- Fill in the following as debug arguments in the text box:
Djava.compiler=NONE -Xdebug -Xnoagent
- Go to Home >Summary of Servers >DocServer Server Start tab.
- Edit arguments and add:
- For JRockit R28 and above -XX:
- For others:
Add following in run.conf (for Non-Windows) and run.conf.bat/run.bat (for Windows):
- Non-Windows: JAVA_OPTS=-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n $JAVA_OPTS
- Windows: set JAVA_OPTS=”-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n %JAVA_OPTS%”
Taking Thread Dump
If the server is started through a console/command line and not as a service, press a ctrl+z. The thread dump would be logged in the console window/console logs.
If the server is running as a service, do the following:
You can use a utility SendSignal. Follow the docs at this URL.
Identify the process id and then fire command
kill -3 <pid>
Got to <jboss_home>\bin and execute following command:
twiddle.bat invoke “jboss.system:type=ServerInfo” listThreadDump > threaddump.html
For Weblogic 10 R3 you can use following way. Go to Weblogic Console -> Environment -> Servers On left side. Then select <your server> -> Monitoring tab -> Threads -> Dump Thread Stacks.
It will display the thread info.
- Login to the machine where the WebSphere server is running.
- Open a command prompt and change directory to /WebSphere/AppServer/bin.
- Type wsadmin (will take a minute to connect – if authentication is enabled, it will prompt).
- Enter set jvm [$AdminControl completeObjectName,process=server1,*].
- Replace server1 with the actual server you want to take a thread dump from (has to be local to this machine).
- Enter $AdminControl invoke $jvm dumpThreads.
The thread dump is created in the profile folder for the server you created a dump for. There should be a “javacore.someText.txt” file created. If it’s a cluster, you’ll have to repeat the above steps for each server.
Using JConsole. Connect the JConsole present in IBM JDK and trigger threaddump using that. You would have to follow the steps mentioned here for it to get to work.
Capturing SQL Logs
The SQL queries by UM can be logged using the default logging system for that system. Following two categories should be used:
- com.adobe.idp.storeprovider.jdbc – Logs all the queries fired with the value populated.
- storeprovider.stacktrace – This would also log the stacktrace of the thread which fired the query.
The logging level should be set to TRACE or the lowest for the queries to be logged. For the POF layer use the category com.adobe.pof.adapter for seeing the queries getting fired.