Uploaded image for project: 'EJB 3.0'
  1. EJB 3.0
  2. EJBTHREE-201

Stateful tutorial: wrong exception caught

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • EJB 3.0 Beta 1
    • None
    • docs
    • None

      It looks like org.jboss.tutorial.stateful.client.Client is catching the wrong exception:

      [java] Should throw an object not found exception by invoking on cart after @Remove method
      [java] Exception in thread "main" javax.ejb.EJBNoSuchObjectException: Could not find Stateful bean: 5c4o130-g6x2qx-eaa2p3au-1-eaa2sp2k-5

      Instead it's catching java.rmi.NoSuchObjectException:

      import java.rmi.NoSuchObjectException;
      ....
      if (e.getCausedByException() instanceof NoSuchObjectException)
      System.out.println("Successfully caught no such object exception.");
      else
      throw e;

      So I guess the import just needs to be changed from java.rmi. to javax.ejb?

              Unassigned Unassigned
              ryan.campbell_jira ryan.campbell (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: