The error occurs if more then one persistence unit is found. Note that by default, classpath* is used to search for xml files which means that not just folders but also jars added to the classpath are used in the lookup process.
Make sure you have indeed only one persistence unit info declared or add its name to the LocalContainerEMFB.

解决方案 »

  1.   

    看篇文章:http://www.xcopy.net.cn/read.php?201
      

  2.   

    <persistence-unit name="punit"  transaction-type="RESOURCE_LOCAL" /> 
    配置了这个,不是自动搜索本地持久单元吗??为什么不行呢??、!!
      

  3.   

    仔细看下那段英文,和那篇文章!
    TSS上有好几篇文章介绍!就是你这个问题的!
      

  4.   

    <persistence xmlns="http://java.sun.com/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
    version="1.0">
    <persistence-unit name="项目" transaction-type="RESOURCE_LOCAL">
    </persistence-unit>
    </persistence>
    位置是:项目\src\META-INF,并且你的这个目录之下还有别的文件么?
      

  5.   

    只有MANIFEST.MF 和 persistence.xml 文件!!
      

  6.   

    Spring 没有找到persistence.xml.配置LocalContainerEntityManagerFactoryBean的persistenceXmlLocation属性.
    <property name="persistenceXmlLocation" value="classpath:META-INF/persistence.xml" />