/**
   * Tests that a invocation on SFSB method annotated with @Remove (and without the
   * retainIfException set to true) results in removal of the bean even in case of application
   * exception.
   */
  @Test
  public void testRemoveEvenIfAppExceptionOnSFSB() throws Exception {

    // invoke the remove method which throws a app exception
    try {
      sfsbWithRemoveMethods.removeEvenIfAppException();
      Assert.fail("Did not get the expected app exception");
    } catch (SimpleAppException sae) {
      // expected
    }

    // invoke again and it *must* throw NoSuchEJBException
    try {
      sfsbWithRemoveMethods.removeEvenIfAppException();
      Assert.fail("Did not get the expected NoSuchEJBException on second invocation on SFSB");
    } catch (NoSuchEJBException nsee) {
      // expected
      log.info("Got the expected NoSuchEJBException on second invocation on SFSB");
    }
  }