spring+jpa

issue:
2013-12-05 17:20:17.694:INFO::jetty-6.1.26
2013-12-05 17:20:17.850:INFO::No Transaction manager found - if your webapp requires one, please configure one.
2013-12-05 17:20:18.021:INFO:/:Set web app root system property: 'webapp.root' = [D:\projects\fvp\dev\workspace\MFVP\src\main\webapp]
2013-12-05 17:20:18.021:INFO:/:Initializing log4j from [D:\projects\fvp\dev\workspace\MFVP\src\main\webapp\WEB-INF\log4j.properties]
2013-12-05 17:20:18.053:INFO:/:Initializing Spring root WebApplicationContext
2013-12-05 17:20:19 [org.springframework.web.context.ContextLoader]-[ERROR] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [spring/spring-datasource.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No persistence unit with name 'default' found
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)


spring+jpa

solution:
need define default in persistence.xml

http://www.cnblogs.com/luxh/archive/2012/05/24/2516282.html
persistence.xml文件必须定义在classpath路径下的META-INF文件夹中。

你可能感兴趣的:(spring)