Good night people in the community. I explain my problem, I have a web application made with JPA2.0 using EclipseLink2.0 (with jars: EclipseLink and javaxpersistence), when generating the war and raise it in an apache-tomcat my application works without problems, but when deploying the same war in jboss 5.1 EAP I get the following error:

Looking found that I must define my datasource for my connection to my database: MySQL5.0, in addition to change my persistence.xml to include a JTA. Copy to the folder: default / deploy-ds.xml file Sales is my datasource (configured with my database mysql5.0) whose JNDI VentasDatasource

I don't think you can deploy JPA 2.0 applications in JBoss 5.1 (EAP or otherwise). This version of JBoss contains an implementation of the JPA 1.0 spec, which is why you're getting the ClassCastException.

You will have more luck attempting this in JBoss 7.1. It's my understanding that there will be an EAP release of this later in the year.