0

I am working on a .NET application that is required to use a third-party library (a .NET eBMS/AS4 client); that third-party library is itself a JNI wrapper around a Java library. When I call the library, an exception is occurring within the Java library, but whoever implemented the wrapper did not do a good job of it, because any information that the Java exception contained (e.g. error codes, specific error messages) is not added to the .NET exception that gets passed back up to my application, all I get is the most generic of error messages. As you can imagine, this makes supporting the application in production a difficult proposition.

However, if I run the same code on my developer PC from within Visual Studio, then if I watch the Output window, the debugger writes a lot of information from the Java library - I can see it initialising itself, loading all of its modules, then executing, and finally I can see my Java exception occurring, and the actual error is right there in the Output window.

Jul 25, 2018 8:46:42 AM com.ibm.b2b.as4.client.internal.MessageBatcherImpl logEventAudit
INFO: Event Details: App Context Component:[COMMS]; App Context Service Inst:[AS4]; Trans Id:[ebb64ae1-762d-4175-9ca3-61c0b7d74f48]; Stage:[PROCESSING_IN_PROGRESS]; Event Date Time:[25/07/2018 8:46:42 AM]; Event Action:[SENDING_REQUEST]; Event Status:[SUCCESS]; Event Data:[Mime Packing and sending request]; Is Processing:[false]; Is Final:[false]; Exchange Profile Id:[BatchBulkAsyncPull-EVTE-9ea3427a-ed94-474c-8785-460d2dc28a61]; Storage Ref:[Content-Type:[multipart/related]; Storage Blob Id:[000000020028418e00617564697400000000000000000000aa1c854f9817c08d00000164ddec3291]; ]; Role:[REQUEST]; Exchange Group Id:[e88e4628-13fc-411f-ab83-2a297dccb186]; External Reference:[Destination IP=[test2.ato.sbr.gov.au]]; 
Jul 25, 2018 8:46:42 AM com.ibm.b2b.as4.client.internal.MessageBatcherImpl logEventAudit
INFO: Event Details: App Context Component:[COMMS]; App Context Service Inst:[AS4]; Trans Id:[ebb64ae1-762d-4175-9ca3-61c0b7d74f48]; Stage:[PROCESSING_IN_PROGRESS]; Event Date Time:[25/07/2018 8:46:42 AM]; Event Action:[UNPACKAGING]; Event Status:[SUCCESS]; Event Data:[Unpacking Mime Message]; Is Processing:[false]; Is Final:[false]; Exchange Profile Id:[BatchBulkAsyncPull-EVTE-9ea3427a-ed94-474c-8785-460d2dc28a61]; Storage Ref:[Content-Type:[multipart/related]; Storage Blob Id:[000000020028dcb9006175646974000000000000000000007ca39a2ac13a687b00000164ddec3571]; ]; Role:[REQUEST]; Exchange Group Id:[e88e4628-13fc-411f-ab83-2a297dccb186]; External Reference:[Destination IP=[test2.ato.sbr.gov.au]]; 
Exception in thread "main" EBMS ERRORS : 1 - [ error Code : EBMS:0006, Severity : WARNING, Description : There is no message available for pulling from this MPC at this moment., Error Details : EmptyMsgPartitionChannelException: Pulling message from pull destination failed., RefToMessageInError : A1528423965023.21c28b02-2092-4faf-a394-96a1264f7e6e@1528423965023, Origin : EBMS, Category : Communication, Short description : EmptyMessagePartitionChannel].
    at com.ibm.b2b.as4.client.internal.ResponseImpl.workWithError(ResponseImpl.java:214)
    at com.ibm.b2b.as4.client.internal.ResponseImpl.<init>(ResponseImpl.java:89)
    at com.ibm.b2b.as4.client.internal.RequestImpl.createResponse(RequestImpl.java:341)
    at com.ibm.b2b.as4.client.internal.RequestImpl.createResponse(RequestImpl.java:317)
    at com.ibm.b2b.as4.client.internal.RequestImpl.sendBDO(RequestImpl.java:249)
    at com.ibm.b2b.as4.client.internal.RequestImpl.send(RequestImpl.java:226)
Exception thrown: 'IBM_AS4Client.AS4ClientEbMSException' in AS4Client_x64.dll

So my question is: how can I get to that information that the debugger can see, but the .NET runtime is not aware of? Some of it looks like logging output, but it's not being written to any logs on the file system that I can find.

UPDATE

The third-party code seems to make some use of log4cxx (at least, it comes with a log4cxx.properties and a log4cxx_x64.dll, but the log4cxx.properties seems to be pure log4j); anyway, I tweaked it to show DEBUG level instead of the default INFO level it was showing before, and now I can see some of the output, but only DEBUG level, not INFO or higher. The INFO entries in the sample below are in a different layout to that used by the DEBUG entries, so I suspect they are not being written by log4j.

Further digging (hey, I'm a .NET guy, not a Java guy, so I have no idea what this stuff does until I prod it with a pointed stick) yields a logging.properties file, which together with the logging sample above, suggests that the INFO: stuff is being written by java.utils.logging, so some more investigation there would be merited.

David Keaveny
  • 3,904
  • 2
  • 38
  • 52

0 Answers0