Uploaded image for project: 'Byteman'
  1. Byteman
  2. BYTEMAN-397

Byteman tool not working properly.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • None
    • Trigger Injection
    • None
    • Hide

      Create a java application with a try without catch, and having a finally block.
      Once you enter the try block, throw an exception, the finally block will not be executed.

      Show
      Create a java application with a try without catch, and having a finally block. Once you enter the try block, throw an exception, the finally block will not be executed.

      The finally block of the java is not able to trigger when Byteman rule throws an exception.

      public String func() throws OperationFailedException
      {
      boolean lAlreadyOwned = lockCacheIfNotOwned(); // Lock the resources
      try

      { .. .. // Do some work here // Generated NULL POINTER EXCEPTION HERE WITH BYTEMAN RULE .. return "Test"; }

      finally

      { unlockCache(lAlreadyOwned); }

      }

      Rule:
      RULE catchExp.LRUSPRCache.getAccountBySubscriptionId.GenExp
      CLASS com.alcatel.tpapps.spr.csb.server.LRUSPRCache
      METHOD getAccountBySubscriptionId(java.util.Collection, com.alcatel.tpapps.spr.par.Account)
      NOCOMPILE
      AFTER WRITE $lSPRResult
      IF true
      DO System.out.println("[BMAN] Gen Exception: Result [" + $lSPRResult.getSprResultCode() + "] Account: " + $lSPRResult.getAccount().getAccountId());
      traceStack("Caller Stack: ");
      THROW new java.lang.NullPointerException();
      ENDRULE

      This resulted in the resources remained blocked for ever until the application is restarted.

            rhn-engineering-adinn Andrew Dinn
            narendrasingh2 Narendra SINGH2 (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: