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.

 View Only
Expand all | Collapse all

Exceptions thrown in a Java service are suppressed

  • 1.  Exceptions thrown in a Java service are suppressed

    Posted Thu April 01, 2004 11:49 PM

    I’m finding that when one of my Java services throws an exception, WebMethod suppresses the exception and simply returns from the service as though it worked – except of course the pipeline does not contain the output the service would have normally produced.

    It would make much more sense to me if the exception caused WM to behave the same way it does when an EXIT:FAIL is executed in a Flow service.

    Does anyone have a suggestion on how to get WM to do this? The only option I’m aware of at the moment is to put a Flow wrapper around every Java service, and to check its output to determine if an error occurred, and then do EXIT:FAIL – but that is really ugly…


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


  • 2.  RE: Exceptions thrown in a Java service are suppressed

    Posted Sun April 04, 2004 02:21 PM

    hi,

    does this help ?

    try
    {

    }
    catch(Exception err)
    {
    throw new ServiceException(err);
    }


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


  • 3.  RE: Exceptions thrown in a Java service are suppressed

    Posted Mon April 05, 2004 09:25 PM

    Thanks, that’s what I do.

    With further testing I’ve found that when the service throws an exception and thus exits, WM immediately validates the pipeline output – and then reports an output validation error rather than report the exception that caused it.

    Consequently, instead of getting a useful error message like:

    com.wm.app.b2b.server.ServiceException: formatValue(name=BADNAME*X) unknown option “X”

    … I get an unhelpful message like this:

    com.wm.app.b2b.server.ServiceException: [ISC.0049.9006] Output validation for service ‘ssg.util.sql:buildColumnInsertSql’ failed: ‘/columnInsertSql VV-005 [ISC.0082.9034] Field is absent, field must exist’

    I feel that WM should report the original exception rather than report an incidental downstream effect (the empty output pipeline). The only way to get a useful error message from the service is to disable output validation – which is a shame, as output validation is a good thing to have.


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