|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Debugging java code in WMB |
« View previous topic :: View next topic » |
Author |
Message
|
hotshot |
Posted: Wed Jan 15, 2014 7:51 am Post subject: Debugging java code in WMB |
|
|
Novice
Joined: 04 Jan 2013 Posts: 20
|
Hi,
I need to investigate what happens when some java code gets executed in message broker and want to request some advice on how it would be best to do this.
Here are the details:
- Env: WMB8003 (runtime + toolkit). the OS of the runtime is Linux.
- I have a java function as follows:
Code: |
package com.a.b.c;
public class getOSVar{
public static String getOSV (String v){
String value = System.getenv (v);
return value;
}
}
|
- I have an ESQL function that calls it:
Code: |
CREATE FUNCTION getVar (IN v CHARACTER)
RETURNS CHARACTER
LANGUAGE JAVA
EXTERNAL NAME "com.a.b.c.getOSVar.getOSV";
|
- Both functions are held in a library referenced from several applications in different projects and calls are made to the ESQL function as follows:
Code: |
SET X = getVar ('HOSTNAME');
|
Under some circumstances which I do not know and cannot reproduce at will, the testing team has reported that the ESQL function will return a null value, even though the HOSTNAME OS variable is actually always set. A restart of the broker will restore the functionality and the value gets returned.
I have tried reading through the execution group user trace and through the syslog when the issue was active, but could not find any errors, nor any further details.
I will most likely open a PMR to request support from IBM, but would like to try further investigation meanwhile.
Can anyone suggest some ways to debug the java code that gets executed?
Cheers,
B |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Jan 15, 2014 8:01 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Here's a quick test.
manually kill the DataFlowEngine process.
Validate that the function now returns a null value.
Then go back and revisit all of the things you've done to "always set the environment variable". Because you probably haven't done "the right thing".
Otherwise, to debug Java code in IIB, you use the Debugger. |
|
Back to top |
|
 |
hotshot |
Posted: Wed Jan 15, 2014 8:29 am Post subject: RE:Debugging java code in WMB |
|
|
Novice
Joined: 04 Jan 2013 Posts: 20
|
Jeff, thanks for your quick reply.
I tested your proposed approach with killing the execution group, but the issue did not reproduce. The variable is still returned within the broker call. For further reference, the HOSTNAME variable is set in the OS file
Code: |
/etc/sysconfig/network |
and is available (as far as I know) for all users.
If by Debugger you meant the Toolkit debugger, unfortunately that might not be an option for me, because I cannot connect from my dev server to the test server where the issue (sometimes) gets reproduced.
Any other ideas would be highly appreciated
Thanks,
B[/url] |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|