kundera icon indicating copy to clipboard operation
kundera copied to clipboard

Getting exception Error creating bean with name 'entityManagerFactory' defined in class path resource [Spring-AutoScan.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Invalid XML in persistence unit from URL

Open Gargee opened this issue 13 years ago • 1 comments

Hi , I am trying to integrate my Kundera Project with springs.I am getting the below exception.

I have uploaded my code here at https://github.com/Gargee/KunderaDAL

Please let me know what to do:-

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [Spring-AutoScan.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Invalid XML in persistence unit from URL [file:/Users/a-gbanerjee/jlux/KunderaDAL/target/classes/META-INF/persistence.xml] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:93) at com.expedia.lux.content.mainClass.KunderaExample.main(KunderaExample.java:16)

Gargee avatar Jun 19 '13 16:06 Gargee

I will have a look. In the meantime you may also refer: https://github.com/impetus-opensource/kundera-container/blob/master/src/main/resources/appContext.xml

for such spring configurations. In case not opting for JTA, you need to exlcude transactional attribute configuration from above mentioned "appContext.xml"

-Vivek

mevivs avatar Jun 19 '13 17:06 mevivs