【问题标题】:Playframework [2.6.6] to [2.7.0] causes CreationExceptionPlayframework [2.6.6] 到 [2.7.0] 导致 CreationException
【发布时间】:2019-02-07 13:13:22
【问题描述】:

我尝试将我的 play 2.6.6 应用程序迁移到 2.7.0。我正在使用 Hibernate 4.2.3-Final。有人知道这些异常的原因吗?

GeneralDao.java:71 是:

@Inject
public GeneralDao(JPAApi jpaApi) {}

OnStartup.java:66 与上面类似。

CreationException: Unable to create injector, see the following errors

1) Error injecting constructor, javax.persistence.PersistenceException: Unable to configure EntityManagerFactory
  at play.db.jpa.DefaultJPAApi$JPAApiProvider.<init>(DefaultJPAApi.java:59)
  at play.db.jpa.DefaultJPAApi$JPAApiProvider.class(DefaultJPAApi.java:50)
  while locating play.db.jpa.JPAApi
    for the 1st parameter of dao.GeneralDao.<init>(GeneralDao.java:71)
    for the 2nd parameter of modules.OnStartup.<init>(OnStartup.java:66)
  at modules.OnStartupModule.configure(OnStartupModule.java:10) (via modules: com.google.inject.util.Modules$OverrideModule -> modules.OnStartupModule)
  while locating modules.OnStartup
Caused by: javax.persistence.PersistenceException: Unable to configure EntityManagerFactory
        [cut]
Caused by: java.lang.RuntimeException: Error while reading file:/R:/appDir/target/scala-2.12/classes/
        at org.hibernate.ejb.packaging.NativeScanner.getClassesInJar(NativeScanner.java:131)
        [cut]
Caused by: java.io.IOException: invalid constant type: 18
        [cut]

完整的堆栈跟踪:https://pastebin.com/nEt1iavu

【问题讨论】:

  • 请提供完整堆栈跟踪。您剪下的内容包含重要线索。
  • 我的猜测是 Spring 失败了,因为它遇到了一个“.class”文件,这是一个扫描仪无法处理的新版本。但是,Java 7 中引入了常量池类型 18 ...
  • 最可能的解释是您/您的应用程序堆栈使用了错误版本的 javassist 库。见stackoverflow.com/questions/30313255/…。解决方案:更改版本。 (元解决方案:google 获取异常消息!!!)

标签: java jpa playframework-2.0


【解决方案1】:

更新到 Hibernate 4.2.8-Final 解决了这些错误。

感谢 Stephen C 的提示。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-05
    • 1970-01-01
    相关资源
    最近更新 更多