Home » Support » Forum » Verify Error with Java 1.7

Verify Error with Java 1.7

#1

ObjectDB enhanced classes fail when compiled to Java 1.7

[ObjectDB 2.2.9_08 Enhancer]
28 persistable types have been enhanced:
    ...
    com.vaisala.jx.db.gdm.model.SourceType

stack trace from jUnit test

com.vaisala.jx.db.gdm.facade.BaseFacadeTest  Time elapsed: 0 sec  <<< ERROR!
java.lang.VerifyError: Expecting a stackmap frame at branch target 15 in method com.vaisala.jx.db.gdm.model.SourceType.writeObject(Ljava/io/ObjectOutputStream;)V at offset 4
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2308)
at java.lang.Class.getDeclaredField(Class.java:1897)
at com.objectdb.o.UTY.V(UTY.java:416)
at com.objectdb.o.UTY.U(UTY.java:400)
at com.objectdb.o.UTY.T(UTY.java:360)
at com.objectdb.o.TYS.l(TYS.java:168)
at com.objectdb.o.TYM.ae(TYM.java:502)
at com.objectdb.o.TYM.<init>(TYM.java:239)
at com.objectdb.o.OMF.ai(OMF.java:733)
at com.objectdb.jpa.EMF.ai(EMF.java:143)
at com.objectdb.o.OMF.ah(OMF.java:681)
at com.objectdb.jpa.EMF.createEntityManager(EMF.java:160)
at com.vaisala.jx.db.gdm.facade.BaseFacadeTest.setUpClass(BaseFacadeTest.java:176)

 

changing binary format to java 1.6 fixes the problem - unit tests pass.

note - non-enhanced classes work locally in java 1.7 format (pass jUnit tests), but then give similar error when run under GlassFish ..

 

steps to reproduce - open your Guestbook sample application in NetBeans, open project properties, change source/binary from 1.6 to 1.7, change compiler to 1.7, clean, build and deploy to GF - see error as below:

Caused by: java.lang.VerifyError: Expecting a stackmap frame at branch target 15 in method guest.Guest.writeObject(Ljava/io/ObjectOutputStream;)V at offset 4
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.sun.enterprise.deployment.util.TypeUtil.getMethod(TypeUtil.java:399)
at com.sun.enterprise.deployment.MethodDescriptor.getMethod(MethodDescriptor.java:313)
at org.glassfish.ejb.security.application.EJBSecurityManager.convertEJBMethodPermissions(EJBSecurityManager.java:550)
at org.glassfish.ejb.security.application.EJBSecurityManager.loadPolicyConfiguration(EJBSecurityManager.java:256)
at org.glassfish.ejb.security.application.EJBSecurityManager.initialize(EJBSecurityManager.java:317)
at org.glassfish.ejb.security.application.EJBSecurityManager.<init>(EJBSecurityManager.java:190)
at org.glassfish.ejb.security.factory.EJBSecurityManagerFactory.createManager(EJBSecurityManagerFactory.java:209)
at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:229)
... 32 more

 

 

 

#2

Thank you for this report.

Please try build 2.2.9_10 that should enhance correctly Java 1.7 class files.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
#3

I just upgraded to 2.2.9_11. I am using JDK 1.6.0_24. I'm not planning on upgrading to Java7 right now.

I now get the following exception in my client trying to connect to the server:

java.lang.ClassFormatError: StackMapTable format error: bad class index
        at java.lang.Class.getDeclaredFields0(Native Method)
        at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
        at java.lang.Class.getDeclaredField(Class.java:1880)
        at com.objectdb.o.UTY.V(UTY.java:416)
        at com.objectdb.o.UTY.U(UTY.java:400)
        at com.objectdb.o.UTY.T(UTY.java:360)
        at com.objectdb.o.TYS.l(TYS.java:168)
        at com.objectdb.o.TYM.ae(TYM.java:502)
        at com.objectdb.o.TYM.<init>(TYM.java:239)
        at com.objectdb.o.OMF.ai(OMF.java:733)
        at com.objectdb.jpa.EMF.ai(EMF.java:143)
        at com.objectdb.o.OMF.ah(OMF.java:681)
        at com.objectdb.jpa.EMF.createEntityManager(EMF.java:160)

 

#4

Unfortunately the Enhancer fix was broken.

Build 2.2.9_12 fixes it and in addition also applies the new addition only to class files that have been compiled for Java 7.

Thank you for this report.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Post Reply

To post a reply and/or subscribe to update notifications - please login