title: A weird org.hibernate.DuplicateMappingException which happen only if my web app is deployed to tomcat on CentOS
body: <p>I am creating a java web app running on Spring framework, Tomcat, Hibernate(but, only JPA API). I've written some code that connects to database with named queries that are externalized into xml files like:</p>
  
  <p>this web app is working fine on my local tomcat on OS X. but it is not working on CentOS machine. when it is deployed on CentOS, initialization of Spring context fails due to:</p>
  
  <pre><code>Caused by: org.hibernate.DuplicateMappingException: Duplicate query mapping ProductReview.getProductReviewNamedParameter
  </code></pre>
  
  <p>From my knowledge, DuplicateMappingException should happen when the <code>ProductReview.getProductReviewNamedParameter</code> named query is defined two or more times. but I defined exactly once and this app working fine on my local machine. Has anyone experienced a similar problem like me? Any answers, your experiences, or insights would be awesome!</p>