I am using liferay server to run my web application.
So i am deploying my application's war on the tomcat that is bundled with liferay.
I am using jpa2 and my scenario is, there are 2 projects, one is web application and another is maven jar project
jar project handles all database related operations. jar's application context contains the entity manager settings.
the web application's application context xml has the jar's application context imported.
now when i deploy the web application, i am getting following error on console.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in URL [jar:file:/D:/for_work/EBCP_Liferay_soft/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/temp/1-EbcpAdminPortlet/WEB-INF/lib/ebcp-beans-1.0.jar!/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.spi.PersistenceUnitInfo.getValidationMode()Ljavax/persistence/ValidationMode;
Please let me know in case of any solution.
have already spent a lot of time on this but no success.
checked few posts on net but still no success.
What reading different articles, it doesn't look as if Liferay supports JPA out of the box.
May I suggest you try placing the necessary JPA jars in the endorsed libs directory for tomcat - in your case, this should be D:/for_work/EBCP_Liferay_soft/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/endorsed. You may need to created the endorsed directory beforehand.
James Boswell wrote:May I suggest you try placing the necessary JPA jars in the endorsed libs directory for tomcat - in your case, this should be D:/for_work/EBCP_Liferay_soft/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/endorsed.
While this is worth a try, I think the problem may lie elsewhere. While I know nothing about Liferay, it sounds to me as if there is another, conflicting, version of JPA already present. Moving the one that's used with this web app into the endorsed directory would not necessarily resolve that conflict, as long as there is another incompatible version elsewhere.
What's not clear to me is with which other version it would be conflicting. The way Tomcat web apps usually work is that libraries that are inside of WEB-INF/lib take precedence over libraries that exist elsewhere in Tomcat's classloader hierarchy. So this conflicting version would have to exist far up the classloader hierarchy in order to cause problems - maybe even in one of the JRE directories? Or maybe as part of Liferay (as opposed to Tomcat)?
Ping & DNS - updated with new look and Ping home screen widget
Joined: Oct 09, 2012
i added the endorsed folder in tomcat , after that i am getting a new exception :