Posts tagged "debugging"

Debugging LiveCycle – Working with Application Servers

- Ankush Kumar, Lead Software Engineer @ Adobe

Enabling Debugging

WebSphere

  1. Go to Websphere console -> Servers -> Application servers -> server1 -> Process Definition -> Java Virtual Machine.
  2. Enable the checkbox against Debug Mode.
  3. Fill in the following as debug arguments in the text box:
    Djava.compiler=NONE -Xdebug -Xnoagent
    -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7777

Weblogic

  1. Go to Home >Summary of Servers >DocServer Server Start tab.
  2. Edit arguments and add:
    • For JRockit R28 and above -XX:
      agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8787
    • For others:
      Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7777

JBoss

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:

Windows

You can use a utility SendSignal. Follow the docs at this URL.

Unix

Identify the process id and then fire command

kill -3 <pid>

JBoss

Got to <jboss_home>\bin and execute following command:

twiddle.bat invoke “jboss.system:type=ServerInfo” listThreadDump > threaddump.html

Weblogic

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.

Websphere 6

  1. Login to the machine where the WebSphere server is running.
  2. Open a command prompt and change directory to /WebSphere/AppServer/bin.
  3. Type wsadmin (will take a minute to connect – if authentication is enabled, it will prompt).
  4. 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.

Websphere 7

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.

 

VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 6.0/10 (1 vote cast)