Catching exception from DAO to the first class calling method,
<p>The architecture of my application is like this:</p>

<blockquote>
  <p>Main classe -> ServiceBean -> Manager -> DAO.</p>
</blockquote>

<p>I am throwing an exception in my DAO:</p>

<pre><code>catch (HibernateException he) {
        throw new RemuRuntimeLoggableException(he, RuntimeLoggableException.HIBERNATE_UNKNOWN);
    }
</code></pre>

<p>Then in Manager I catch the exception as below:</p>

<pre><code>catch (RuntimeLoggableException e) {
                            log.info(e.getMessage());
                            e.printStackTrace();
                            throw new RuntimeLoggableException(e, RuntimeLoggableException.HIBERNATE_UNKNOWN);
</code></pre>

<p>And in my ServiceBean, I have this:</p>

<pre><code>catch (RuntimeLoggableException e) {
        log.info(e.getMessage());
        e.printStackTrace();
        throw new RemoteException();
</code></pre>

<p>In my main class, I have caught the exception like this:</p>

<pre><code>catch (RemoteException e) {
        log.info(prefixeLog + " Error");
        log.info(e.getMessage());
</code></pre>

<p>I also have an interface Service.java. ServiceBean implements this interface and the method concerned here is declared as below in the interface, Service.java:</p>

<pre><code> public void calculate( boolean flag )
  throws java.rmi.RemoteException;
</code></pre>

<p>The problem I am getting is that the exception RemoteException from the ServiceBean, is not caught in the main class.  And I can't modify the interface Service.java as it is automatically generated by XDoclet.  Any idea of how to do this please?</p>

<p>In my Service.java, the method is declared like this:</p>

<pre><code>  public void calculate( boolean flag )
  throws java.rmi.RemoteException;
</code></pre>

<p>And in my class it is declared as below:</p>

<pre><code> public static void main(String[] args) throws RuntimeLoggableException {
 try {
        log.info("Start" + prefixeLog);
        serviceBean.calculate(true);
        log.info("End" + prefixeLog);
    } catch (RemoteException e) {
        log.info(prefixeLog + " Error");
        log.info(e.getMessage());
    }
    finally {
        InitFramework.stopFramework(FrameworkFacade.BATCH);
        System.exit(retour);
    }
}
</code></pre>

<p>And in my serviceBean:</p>

<pre><code> public void calculate(boolean flagExclurePlansPerimes) throws RemoteException {
</code></pre>