0

I try to migrate my play 2.6.6 application to 2.7.0. I am using Hibernate 4.2.3-Final. Does anybody know the cause of those Exceptions?

GeneralDao.java:71 is:

@Inject
public GeneralDao(JPAApi jpaApi) {}

OnStartup.java:66 is similar to above.

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]

Full Stacktrace: https://pastebin.com/nEt1iavu

otaku
  • 1
  • 4
  • 1
    Please provide **complete** stacktraces. The stuff you have cut out contains important clues. – Stephen C Feb 07 '19 at 13:46
  • My guess is that Spring is failing because it has encountered a ".class" file that is a new version than the scanner can cope with. But, constant pool type 18 was introduced in Java 7 ... – Stephen C Feb 07 '19 at 13:54
  • The most likely explanation is that you / your application stack are using a faulty version of the javassist library. See https://stackoverflow.com/questions/30313255/reflections-java-8-invalid-constant-type. Solution: change versions. (Meta-solution: google for exception messages!!!) – Stephen C Feb 07 '19 at 23:01

1 Answers1

0

Updating to Hibernate 4.2.8-Final resolved the errors.

Thank you Stephen C for the hint.

otaku
  • 1
  • 4