title: EJB Remote Exception handling
body: <p>I've a Remote <code>SLSB</code> that is deployed in <code>OC4J</code>.</p>
  
  <p>This Session Bean uses TopLink which under some case throws <code>oracle.toplink.essentials.exceptions.QueryException</code> exception.</p>
  
  <p>I am handling this exception this way:</p>
  
  <pre><code>public void slsbMethod()
  {
     try
     {
        // oracle.toplink.essentials.exceptions.QueryException throws here 
     }catch(Exception ex)
     {
        // do nothing
     }
  }
  </code></pre>
  
  <p>And I am calling this SLSB from a client that way:</p>
  
  <pre><code>try
  {
      fooBarService.slsbMethod()
  }catch(Exception ex)
  {
      System.out.println("Exception calling the EJB server");
  }
  </code></pre>
  
  <p>However I am handling this exception on the EJB, still I got the message <code>Exception calling the EJB server</code> printed!</p>
  
  <p>How is this happening??</p>