当前位置: 首页 > 知识库问答 >
问题:

从play framework 2.0.8迁移到2.1.0错误无法构建EntityManagerFactory

陶锋
2023-03-14

我已经将play framework从2.0.8迁移到2.1.0,以前一切都很好。现在我得到以下错误:

play.api.expectiontedException:意外异常[persistenceException:[persistenceUnit:hbllnd]无法在play.core.reloadableApplication$$AnonFun$Get$1$$AnonFun$1构建EntityManagerFactory]。application(ApplicationProvider.scala:142)~[play2.10.jar:2.1.0]在onfun$get$1.applic(applicationProvider.scala:106)~[play2.10.jar:2.1.0]在play.core.reloadableApplication$$$anonfun$get$1.applic(applicationProvider.scala:104)~[play2.10.jar:2.1.0]在scala.util.Alper$rightProjection.Flatmap(either.scala:523)[scala-library.jar:na]由:javax.persistenceException:[persistenceUnit:hbllnd]无法在-EntityManager-4.1.3.final.jar:4.1。3.final]在org.hibernate.ejb.ejb3configuration.buildEntityManagerFactory(EJB3Configuration.java:890)~[hibernate-EntityManager-4.1.3.final.jar:4.1.3.final]在org.hibernate.ejb.hibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:57)~[hibernate-EntityManagerFactory-4.1.3.final.final]在ateEntityManagerFactory(persistence.java:47)~[hibernate-jpa-2.0-api.jar:1.0.1.final]在play.db.jpa.jpaplugin.onstart(jpaplugin.java:35)~[play-java-jpa2.10.jar:2.1.0]由:org.hibernate.mappingException:requision列在org.hibernate.mappingmodule列:_ebean_intercept(应该用insert=“false”update=“false”映射)在.3.final]位于org.hibernate.mapping.persistentclass.checkPropertyColumnDuplication(persistentClass.java:703)~[hibernate-core-4.1.3.final.jar:4.1.3.final]在org.hibernate.mapping.persistentClass.checkColumnDuplication(persistentClass.java:725)~[hibernate-core-4.1.3.final.final]在org.hibernate.mapping.persistentClass.java:725)~[hibernate-core-4.1.3.final]在4.1.3.final.jar:4.1.3.final]在org.hibernate.cfg.comfiguration.validate(configuration.java:1294)~[hibernate-core-4.1.3.final.jar:4.1.3.final]

下面是我的persistence.xml

<?xml version="1.0" encoding="UTF-8"?>
 <persistence version="2.0"
   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_2_0.xsd">
 <persistence-unit name="hbllnd" transaction-type="RESOURCE_LOCAL"  >
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <non-jta-data-source>hbllndDS</non-jta-data-source>
    <mapping-file>META-INF/orm.xml</mapping-file>
        <class>models.User</class>
    <properties>
        <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect" />
        <property name="hibernate.show_sql" value="true" />
        <property name="hibernate.ejb.use_class_enhancer" value="true" />
    </properties>
</persistence-unit>
</persistence>

下面是我的application.conf

# This is the main configuration file for the application.
# ~~~~~

# Secret key
# ~~~~~
# The secret key is used to secure cryptographics functions.
 # If you deploy your application to several instances be sure to use the     same key!
application.secret="dAktNi/d>QGan4fFMnaecK;Bspp;DHQ/F5uU?    VM8<wUVpSJ0`;m]efM2E^^bsaFl"

# The application languages
# ~~~~~
application.langs="en"

# Global object class
# ~~~~~
# Define the Global object class for this application.
# Default to Global in the root package.
# global=Global

# Database configuration
# ~~~~~ 
# You can declare as many datasources as you want.
# By convention, the default datasource is named `default`
#
#db.default.driver=org.h2.Driver
#db.default.url="mysql://localhost:3306/test"
#db.default.driver=com.mysql.jdbc.Driver
#db.default.user=""
#db.default.password=""

## HBL L&D
db.hbllnd.url="jdbc:mysql://localhost:3306/hbllnd"
db.hbllnd.driver=com.mysql.jdbc.Driver
db.hbllnd.user="root"
db.hbllnd.pass="root"
db.hbllnd.jndiName=hbllndDS

jpa.hbllnd=hbllnd

# Evolutions
# ~~~~~
# You can disable evolutions if needed
# evolutionplugin=disabled

# Logger
# ~~~~~
# You can also configure logback (http://logback.qos.ch/), by providing a     logger.xml file in the conf directory .

# Root logger:
logger.root=ERROR

# Logger used by the framework:
logger.play=INFO

release.date=20141226
release.version="1.0.1"

# deployment version configuration
include "version.conf"

session.timeout=5
program.expire.days=30

# Logger provided to your application:
logger.application=DEBUG

blog.testMode = true

# SMTP configuration
include "smtp.conf"

# play-easymail configuration
include "play-easymail.conf"

谁能告诉我有什么问题吗??

共有1个答案

方通
2023-03-14

通过禁用JBean解决了它。

 类似资料: