IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  callstackitem

    Posted 05/25/04 01:45 AM

    I would like to log in serveral services the stack-trace.
    I can do that in an exception, when I catch an error, I call the service
    WmPublic/pub.flow:getLastError and get the pipeline lastError/callStack.
    But I would like to get the callStack anytime from anywhere in a service, not only after an error occured, because I need it to log the Stack into my log-files.

    Can anybody help me here ?


    #Integration-Server-and-ESB
    #webMethods
    #webMethods-General


  • 2.  RE: callstackitem

    Posted 05/26/04 01:24 AM

    Hi Ralf,

    We created the following java service to do this. It will return the stack in a string list.

    String[] serviceStack; 
    IDataCursor idc_pipeline = pipeline.getCursor();
    
    try {
    Thread t = Thread.currentThread(); 
    com.wm.app.b2b.server.ServerThread st = (com.wm.app.b2b.server.ServerThread)t; 
    java.util.Stack stack = st.getState().getCallStack(); 
    
    serviceStack = new String[stack.size()];
    
    if (stack.size() > 0) {		
    for (int i=0;i<stack.size();i++) {
    serviceStack[i] = stack.elementAt(i).toString();
    }
    }
    } catch (Exception e) {
    throw new ServiceException(e);
    }
    
    // pipeline
    IDataCursor pipelineCursor = pipeline.getCursor();
    IDataUtil.put( pipelineCursor, "serviceStack", serviceStack );
    pipelineCursor.destroy();
    

    Mvg,

    Dave


    #webMethods-General
    #Integration-Server-and-ESB
    #webMethods


  • 3.  RE: callstackitem

    Posted 01/22/08 09:07 AM

    Hi Dave,

    Do you know how to do it in wM 7.1?

    I get a java error at compile time. The getState method from ServerThread does not exist anymore.

    Any ideas how to do it now?

    Many Thanks,
    Ganesh


    #Integration-Server-and-ESB
    #webMethods
    #webMethods-General


  • 4.  RE: callstackitem

    Posted 01/24/08 09:46 AM

    Hi Ganesh,

    what about getCurrentState()?

    As this is undocument


    #webMethods
    #Integration-Server-and-ESB
    #webMethods-General


  • 5.  RE: callstackitem

    Posted 02/05/08 12:25 PM

    If you change this line…

    java.util.Stack stack = st.getState().getCallStack();

    …into this…

    java.util.Stack stack = st.getInvokeState().getCallStack();

    …then it should work in 7.1.


    #Integration-Server-and-ESB
    #webMethods
    #webMethods-General