I use Smartgwt 6.1 Power and the javassist-3.4.GA library, used by Hibernate to create the EntityManagerFactory, is not compatible with Java 8 byte code.
As I understand, Hibernate is checking the JPA annotations (Entity...) in the byte code of the Class files at run time using Javassist api and the following exception is raised (see complete exception in attachment).
Caused by: java.io.IOException: invalid constant type: 18
at javassist.bytecode.ConstPool.readOne(ConstPool.java:967)
at javassist.bytecode.ConstPool.read(ConstPool.java:910)
at javassist.bytecode.ConstPool.<init>(ConstPool.java:127)
at javassist.bytecode.ClassFile.read(ClassFile.java:630)
at javassist.bytecode.ClassFile.<init>(ClassFile.java:52)
To reproduce the issue, it just needs to create a project with a JPA data source and with lambda expression in the code, it will fail when running the app.
When I update "javassist-3.4.GA" to more recent version "javassist-3.22.0-GA.jar" it works fine. My concern is that this is a hack, since I replace a library provided with Smargwt.
Could you confirm that I can replace the "javassist-3.4.GA" library by "javassist-3.22.0-GA.jar" safely? And possibly apply the fix on your side?
If not, do you have any suggestion to fix this issue?
As I understand, Hibernate is checking the JPA annotations (Entity...) in the byte code of the Class files at run time using Javassist api and the following exception is raised (see complete exception in attachment).
Caused by: java.io.IOException: invalid constant type: 18
at javassist.bytecode.ConstPool.readOne(ConstPool.java:967)
at javassist.bytecode.ConstPool.read(ConstPool.java:910)
at javassist.bytecode.ConstPool.<init>(ConstPool.java:127)
at javassist.bytecode.ClassFile.read(ClassFile.java:630)
at javassist.bytecode.ClassFile.<init>(ClassFile.java:52)
To reproduce the issue, it just needs to create a project with a JPA data source and with lambda expression in the code, it will fail when running the app.
When I update "javassist-3.4.GA" to more recent version "javassist-3.22.0-GA.jar" it works fine. My concern is that this is a hack, since I replace a library provided with Smargwt.
Could you confirm that I can replace the "javassist-3.4.GA" library by "javassist-3.22.0-GA.jar" safely? And possibly apply the fix on your side?
If not, do you have any suggestion to fix this issue?
Comment