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

How to debug Java Service

  • 1.  How to debug Java Service

    Posted Wed September 21, 2011 09:07 PM

    I’m using version 8.2 and want to single step through my Java Service and examine my variables. I put a breakpoint at the beginning of the service, but it never stops there.

    What else do you have to do?


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 2.  RE: How to debug Java Service

    Posted Wed September 21, 2011 11:58 PM

    Alas, stepping through a Java service cannot be done.


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 3.  RE: How to debug Java Service

    Posted Thu September 22, 2011 07:31 AM

    In developer, it is not possible to trace the Java service. But, what you could do is use System.out.println() to write values of variable to the console at the breakpoints.

    Regards,
    Shriraksha A N


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 4.  RE: How to debug Java Service

    Posted Thu September 22, 2011 01:47 PM

    Debugging of Java services can only be outside webMethods with a Java IDE.
    You can use the debugging of Developer to find out which values have been passed to the service and then debug externally.
    For Java services of a higher complexity it may be of advantage to bundle them in a JAR which is developed and tested outside webemethods and then inject the jar to the webMethods package, only having small wrapper services written in webMethods itself which call the methods contained in the jar.

    Regards

    Martin


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 5.  RE: How to debug Java Service

    Posted Wed November 04, 2015 08:33 AM

    By using webMethods Designer (eclipse) you can do several steps:

    1. You need to create a java class which is serves as called “Test Harness”, first of all to make your work lot easier, do this by changing your eclipse perspective to JavaEE.

    2. Right click on your javaService working window which you want to generate a test harness, and click to Generate Code. In the Code Generation window, choose “For debugging this service” option and click Finish.
      Designer generates the test harness with a single main primary method and displays it in the debugger editor. (picture #1)
      Optionally update the “Test Harness” class param as necessary to which the test harness will connect to. For instance: change the server name, username & password entry
      Save for any change(s) you’ve made.

    3. Select breakpoint(s) on your javaService earlier (picture #2), and back again select your TestHarness java class and click on debug (or right-click for debug as java application).

    4. When you launch the Java class in debug mode and the debugger encounters a breakpoint, it suspends execution. At that time, if the Debug perspective is not already in use, Designer switches to it (picture #3)

    This is it! Finally you can debug your Java Services in Designer (eclipse)

    Source: 8-2-SP3_Service_Development_Help.pdf page 367 (SoftwareAG webMethods documentation)




    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 6.  RE: How to debug Java Service



  • 7.  RE: How to debug Java Service

    Posted Fri November 13, 2015 07:59 AM

    hi all,

    we are using wm9.6 (with no fixes applied)

    i did follow the service development guide (debugging java services).

    1. stopped integration server
    2. i changed the <SOFTWAREAG_HOME>/IntegrationServer/instances/default/bin, enabled debug settings
    3. restarted integration server as application

    unfortunately when restarted, i dont see any log ‘debug enabled’ or i dont see the port 9191 in the IS admin → security ports.

    any clue, whats missing, i strictly followed the instructions given in service development guide

    any help is appreciated. i appreciate if only guys who did it successfully respond

    thanks and regards
    ajay kumar kasam


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 8.  RE: How to debug Java Service

    Posted Fri November 13, 2015 02:13 PM

    Is this a fresh install of 9.6 and you are trying to bring up?

    How are you starting the IS from Services thru and did you monitor the default/logs anything getting updated or stuck?

    HTH,
    RMG


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 9.  RE: How to debug Java Service

    Posted Fri November 13, 2015 02:35 PM

    for now, all i’m trying to see 9191 port and debug enabled when i start my IS (after enabled debug in the setenv.bat)

    yes its normal install, normal way of starting the IS using startup.bat, normal way of starting the services.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 10.  RE: How to debug Java Service

    Posted Fri November 13, 2015 03:11 PM

    Ajay – Did you fix the issue or still looking for assistance. I am not quite clear with your earlier statements.

    Thanks,


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 11.  RE: How to debug Java Service

    Posted Tue November 24, 2015 03:25 PM

    What OS are you running your IS in? In Windows specifically, after changing setenv.bat, you have to run server.bat -service . E.g.:

    server.bat -service sagis96_2.default

    This should update your Tanuki wrapper config with those new JVM parameters. Before the Tanuki wrapper was introduced, this used to update the Windows registry from where the Windows service would pull the information.

    I hear in 9.9, this method was retired. All changes now are done directly in the Tanuki wrapper custom config file.

    Percio


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 12.  RE: How to debug Java Service

    Posted Thu December 17, 2015 08:40 AM

    for me issue is resolved

    i’m using wm9.6 (windows)

    i’ve just followed service development guide (debugging java services)

    summary

    • change setenv.bat), make debug_enabled=true
    • restart Integration server (in my case, running as console application)
    • verified the wrapper.log (located in profiles/IS_default/logs folder (searched for 9191 debug port)
    • on designer
      • in java perspective, create java application, with IS/instances/default/package/
      • created remote java application debug configuration, set the IS host(localhost) and debug port (9191)
      • open the java project, java service to debug, set the breakpoint
    • to test, i have written flow service which invokes the java service i wanted to debug. just run the flow service
    • yes the java service stops its execution where i set breakpoint

    thanks a lot


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB