Spring Exception Translation isn't working after FW upgrade from 2.5 to 4.2
<p>I'm maintaining a legacy Spring FW 2.5 app. Recently I've tried moving it to Spring FW 4.2. One of the tings I can't really bring back is spring exception translation. Specific case is (simplified code):</p>

<pre><code>public boolean exists() {
  try {
    Query q = em.createNativeQuery();
    q.getSingleResult();
    return true;
  } catch(EmptyResultDataAccessException ex) {
    return false;
  } catch(Exception e) {
    throw new CustomCheckedException(e);
  }
}
</code></pre>

<p>Right after migration try block appears to be throwing <code>javax.persistence.NoResultException</code> (as underlying technology is JPA) and not <code>org.springframework.dao.EmptyResultDataAccessException</code> as it did before. I can't get Spring to translate this particular exception. I have annotated this particular dao with <code>@Repository</code>, enabled <code>component-scan</code> in XML as well as <code>PersistenceExceptionTranslationPostProcessor</code>. What else I might be missing?</p>

<p>The app is quite complex with many components, so posting config (several XML files) would probably only cause confusion. It would be great if somebody could tell me how to make spring log DEBUG messages for this particular area. I might figure this out myself or at least provide more detail.</p>

<p><strong>EDIT:</strong> DAO is annotated with <code>@Transactional(readOnly = true)</code> which causes <code>exists()</code> method to be run within transaction. This might be relevant as I think exception translation was most probably working in Spring 2.5 thanks to declarative transactions. All that <code>@Repository</code>, <code>component-scan</code> and <code>PersistenceExceptionTranslationPostProcessor</code> stuff was added after migration to 4.2 in an effort to restore exception translation.</p>