jpaglassfishopenxava

java.lang.NoSuchMethodError: javax.persistence.EntityManager.getMetamodel()


How to fix this error using OpenXava 4.6 with Glassfish 2.2:

javax.servlet.ServletException: java.lang.NoSuchMethodError: javax.persistence.EntityManager.getMetamodel()Ljavax/persistence/metamodel/Metamodel

I got this error when trying to access my test module from the browser.

http://localhost:8080/testmod/xava/module.jsp?application=testmod&module=test

Solution

  • In my case, using openxava 4.6 with glassfishESBv22 gave me the error java.lang.NoSuchMethodError: javax.persistence.EntityManager.getMetamodel... so when i changed the server to default tomcat bundle with OX4.6, it worked fine. that means it was the glassfish server problem...finally i used the latest glassfish server v3.1.2 and it also worked fine. so problem solved...only changing the server to the latest one was the solution.