Home – Blog – Best Practices: PTSpy log messages linked to … hair loss?
April 13, 2009 —
For the past few years, researchers have been perplexed about the causes behind the increased rate of hair loss in ALUI portal administrators. So, a team from Function1 took on the task of tracking these subjects for a few months and recorded the findings. One of the interesting things discovered was that the cause was not genetic or gender-specific in most cases. It was actually the simple explanation of the subjects repeatedly pulling on their hair while investigating problems with the portal.
For instance, the team observed one of the subjects being told that an issue with document refresh needs to be resolved right away. For the sake of research confidentiality, we’ll call this subject Jeb. Immediately, Jeb went to work and used the handy PTSpy utility to gather more information on the problem. After a few minutes, he had seemed to have found a clue in the log file:
CPTCardRefreshAgent::RefreshCard, caught exception (-2147203840) in refreshing card 4481.
Or on second thought, maybe not!… Jeb’s mood quickly changed from being hopeful to being dejected, and he had slowly started to tug on his hair. When questioned about his frustration, he simply kept repeating the phrase “negative 2 1 4 7 2 0 ….”. The research team noticed Jeb was losing it, so they quickly went to work and found a way to reach out to Jeb.
It took some time, but it turns out the answer lay in the Portal Server API library within the ALUI deployment. For those not familiar with the Portal Server API (previously called Plumtree Server API), this is a “common” native programming interface used by the Portal, Automation Server, and API Service. Even though, it’s not as simple to use as the IDK, it provides additional capabilities which go beyond those provided by the IDK.
In implementation, the bulk of the interface is in one JAR called ”plumtreeserver.jar”, or in a DLL with the Windows version. The interesting part of this API is that half of the definitions are for actual code interfaces and the other half is static constant definitions. For addressing Jeb’s problem, we’re actually more interested in the static constants which provide the following types of information:
- task result codes
- object class IDs
- card status codes
- job status codes
Eventhough, they are all useful pieces of information, knowing what the result code values mean will allow Jeb to return to sanity. It turns out that this error code value can be decoded by looking at the PT_RESULTCODES class in the plumtreeserver library (DLL or JAR). Eventhough the class is provided in the JavaDocs and NDocs, these numeric error codes are not in the documentation. So, the team decompiled the DLL, and examined the decompiled class file for PT_RESULTCODES:
And voila!… the team was able to translate the numeric decimal value to a hex value, and look up the hex value in the PT_ResultCodes.txt file to have a more meaningful error message. In Jeb’s case, “-2147203840″ really meant that the “document was not found”. Just providing this translation to Jeb allowed him to return to sanity and continue to solve this issue.