title: System Exception in a Singleton EJB
body: <p>I am reading the <code>EJB specification</code> and I got confused by a contradiction from my point of view and particularly regarding the way the <code>Container</code> behaves when a <code>System Exception</code> is thrown in lifecycle callback method of <code>Singleton Bean</code>.</p>
  
  <p><strong>Section 12.3.1 :</strong></p>
  
  <blockquote>
    <p>A runtime exception thrown by any lifecycle interceptor callback
    method causes the bean instance and its interceptors to be discarded
    after the interceptor chain unwindsce and any associated interceptor
    instances are discarded (except for Singleton Beans).</p>
  </blockquote>
  
  <p><strong>Section 4.8.4 :</strong></p>
  
  <blockquote>
    <p>Errors occurring during Singleton initialization are considered fatal
    and must result in the discarding of the Singleton instance. Possible
    initialization errors include injection failure, a system exception
    thrown from a PostConstruct method, or the failure of a PostConstruct
    method container-managed transaction to successfully commit.</p>
    
    <p>Unlike instances of other component types, system exceptions thrown
    from business methods or callbacks of a Singleton do not result in the
    destruction of the Singleton instance.</p>
  </blockquote>
  
  <p>So, what is true according the Section 4.8.4? If a <code>System Exception</code> is thrown in a <code>@PostConstruct</code> method or the <code>Interceptor</code> <code>@PostConstruct</code> method is the <code>Bean</code> discarded? I have tried it throwing an <code>EJBException</code> and the result was that the Beans initialization failed.</p>
  
  <p>More surprising was the fact, that when throwing an <code>EJBException</code> from a <code>Singleton Bean</code> <strong>Business Method</strong>, the client received the <code>Exception</code> and no other method was further executed. Can I assume that the Bean Instance was discarded? According to the Specification that should not have caused the destruction of the <code>Bean Instance</code>. What is true in both cases?   </p>