From the second line:
java.lang.RuntimeException: Specification violation [EJB3 JPA 6.2.1.2] - You have not defined a jta-data-source for a JTA enabled persistence context named: ehr-punit This line here kinda suggests a solution to one of your problemproblems. Try creating a jta-data-source called ehr-punit.
That could be a massive red herring, as I have no knowledge about JTA or JBoss.
A little further down, you have:
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to javax.xml.parsers.DocumentBuilderFactory This means that Spring is trying to inject a DocumentBuilderFactoryImpl into a method that is expecting a javax.xml.parsers.DocumentBuilderFactory. Clearly the former does not implement or extend the latter. I would try using a difference version of xerces to see if this has changed recently.