The CreatorCon Call for Content is officially open! Get started here.

Debugging a JAR file

kirkr
Tera Expert

I've built a fairly simple JAR file that will be used to pull external credentials. This all works locally on development workstations, but deploying the JAR to a MID Server will fail to retrieve a credential.

Are there any methods that can be used to debug what is going on, even to just log output anywhere?

I've attempted to write to a file on the MID Server, but it's not being written to. Any suggestions on debugging?

1 ACCEPTED SOLUTION

Dave Smith1
ServiceNow Employee
ServiceNow Employee

That all sounds fine.   Did you compile the new JAR under the same environment as the MID (32bit, 64bit, etc)...?   Did you check it appears in "extlib" directory?



Also, checked the MID logs themselves to see what it's reported when attempting to use the JAR?   I think if it uses standard Java logging (log4j?) then something will be passed through to platform or MID logs.



I'll agree that it's a pain no drivers/struts are provided for a test harness for this particular JAR file. I really ought to knock one up.


View solution in original post

7 REPLIES 7

I was able to end up getting something to the wrapper.log by using an Exception.



I suspect there must be a better method than this, like you mentioned with standard logging but I wasn't able to get anything to log.



Thank you very much for the help, I was able to track down what was going on.


Dave Smith1
ServiceNow Employee
ServiceNow Employee

I was able to end up getting something to the wrapper.log by using an Exception.


Ouch! But... if the only way it'll make a sound is to kick it, needs must...



I suspect there must be a better method than this, like you mentioned with standard logging but I wasn't able to get anything to log.


It's had me thinking now.   Fancy putting some feedback through the docs site about debugging and JAR analysis techniques?   I'm sure you're not the only one that's faced this issue.



Thank you very much for the help, I was able to track down what was going on.


Glad to hear you got it sorted!


A fine idea, I've submitted feedback on my experience as well as suggesting some debugging in relation to MID Servers and JAR debugging.