Layer7 API Management

 View Only
  • 1.  How to debug custom assertion ?

    Posted May 23, 2018 04:31 AM

    Hi Team.


    I'm currently developing a custom assertion, and running into some trouble.


    What is the best approach to debug my code?

    Is it possible to influence the java runtime parameters of the gateway to activate remote debug capabilities, so that I would be able to debug my assertion remotely in my eclipse environment?

    Or are there different approaches for debugging.

    I'm currently running into a null pointer exception when the assertion gets executed, and I have no idea where this might come from. So it would be of great help to debug the code step by step.


    Another approach would be to enrich my code with logging statements to be able to follow the code execution. But I did not find  specific hints regarding logging from within  a custom assertion.


    Any hint/suggestion/help is welcome



  • 2.  Re: How to debug custom assertion

    Posted May 23, 2018 04:41 AM

    just found


    which might be applicable to add remote debug parameters like:

    -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=4000, suspend=n


    What do you think?


  • 3.  Re: How to debug custom assertion ?
    Best Answer

    Posted May 23, 2018 10:57 AM

    I gave it a try:

    I added the following line to /opt/SecureSpan/Gateway/runtime/etc/profile.d/ :

    default_java_opts="$default_java_opts -Xdebug -Xnoagent -Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=n"

    I restarted the gateway service with "service ssg stop" and"service ssg start".

    I added a firewall rule through Policy Manager for port 4000


    I created a remote debug configuration in my eclipse:


    And that's it. eclipse is able to connect to the Gateway debug port 4000 , I'm able to set breakpoints and able to debug my stuff in a very convenient way through eclipse.


    Of course I did and would do this only in a local / private dev environment !