New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Play-2.2.x] some code causes java.lang.VerifyError at runtime #1966

Merged
merged 1 commit into from May 28, 2014

Conversation

Projects
None yet
10 participants
@jroper
Copy link
Member

jroper commented May 28, 2014

code like below has no problem with compilation.
but causes java.lang.VerifyError at runtime.

TestObject object = new TestObject();
object.name = "test";  // get or set string value

try { // in try
    object.id = 100L;  // get or set long value
    String name = object.name;  // get or set string value
} catch (Throwable t) {
    t.printStackTrace();
}

I think generated getter/setter are the reason.

here's test code : https://github.com/kjkmadness/play-test
and CI : https://travis-ci.org/kjkmadness/play-test

@kjkmadness kjkmadness closed this Nov 4, 2013

@kjkmadness kjkmadness reopened this Nov 4, 2013

@kjkmadness

This comment has been minimized.

Copy link

kjkmadness commented Nov 19, 2013

this is a Javassist bug.
see https://issues.jboss.org/browse/JASSIST-212

@tkoeppen

This comment has been minimized.

Copy link

tkoeppen commented Nov 25, 2013

we got a similar problem in our app migrating to play 2.2.0 (java 1.7.0_45)

the workaround with "UseSplitVerifier" discussed in [1] and [2] helped us surviving:

We start our app now as workaround with JVM option: "-XX:-UseSplitVerifier"

[1] http://www.kadeke.be/en/developer-blog/java-lang-verifyerror-stack-map-does-not-match-the-one-at-exception-handler
[2] https://groups.google.com/d/msg/play-framework/eWFwZ75T6wk/EWeGJEA4s0EJ

@jroper

This comment has been minimized.

Copy link
Member

jroper commented Dec 10, 2013

Why this doesn't happen in 2.2.0 is a mystery to me - we upgraded to javassist to 3.18.0 in 2.2.0, and haven't touched it since. Nevertheless, you should be able to work around it by adding the following to your project/plugins.sbt file:

libraryDependencies += "org.javassist" % "javassist" % "3.18.2-GA"
@kjkmadness

This comment has been minimized.

Copy link

kjkmadness commented Dec 13, 2013

you should use -XX:-UseSplitVerifier becasue javassist 3.18.2 has not released yet.
and this problem does happen in 2.2.0

@jensjaeger

This comment has been minimized.

Copy link

jensjaeger commented Feb 4, 2014

Just run into this issue as well (Play 2.2.1).

export _ JAVA_OPTIONS="-XX:-UseSplitVerifier" works. Would be great to have a way to put java options in application.conf.

@huntc

This comment has been minimized.

Copy link
Collaborator

huntc commented Feb 4, 2014

I believe the options are required before startup. Configuration time is too late.

@huntc huntc closed this Feb 4, 2014

@jensjaeger

This comment has been minimized.

Copy link

jensjaeger commented Feb 4, 2014

Hi Christopher,
thanks for your reply.
Is this fixed in 2.2.3? With a new javassist version?

Thanks
Jens

@jroper jroper reopened this Feb 10, 2014

@jroper

This comment has been minimized.

Copy link
Member

jroper commented Feb 10, 2014

We're waiting on a release of javassist 3.18.2 for this.

@iandow

This comment has been minimized.

Copy link

iandow commented Mar 4, 2014

After migrating my project from play-2.1.1 to 2.2.1, not only was I getting the aforementioned VerifyError, but I was also getting the following DataBinder error:

java.lang.IllegalStateException: JSR-303 validated property 'name' does not have a corresponding accessor for data binding - check your DataBinder's configuration (bean property versus direct field access)

Using the SplitVerifier JVM options was an effective workaround to both these errors. I did not need to add a dependency for javassist.

@jroper jroper removed this from the 2.2.3 milestone Apr 10, 2014

@jroper

This comment has been minimized.

Copy link
Member

jroper commented May 27, 2014

@chibash Any plans to make a new release of javassist soon? Play Framework users have been waiting on a release with the fix for https://issues.jboss.org/browse/JASSIST-212 for quite some time now.

@BernhardWenzel

This comment has been minimized.

Copy link

BernhardWenzel commented May 27, 2014

Any idea how to make this work with Java 8?

"VM warning: ignoring option UseSplitVerifier; support was removed in 8.0"

Upgrading to Java 8 brings back the error and that prevents us from using it

@chibash

This comment has been minimized.

Copy link

chibash commented May 27, 2014

@scottmarlow Scott, shall we release a new version of Javassist? Now it's good time to do so.

@BernhardWenzel

This comment has been minimized.

Copy link

BernhardWenzel commented May 27, 2014

To answer my own question: to make this work in Java 8 & Play 2.2 use export JAVA_OPTS="-noverify" instead of export _JAVA_OPTIONS="-XX:-UseSplitVerifier" (that also works with Java 7)

@scottmarlow

This comment has been minimized.

Copy link

scottmarlow commented May 27, 2014

@chibash Chiba, that sounds good to me. :)

@chibash

This comment has been minimized.

Copy link

chibash commented May 27, 2014

Good. So can you release 3.18.2-GA?

@scottmarlow

This comment has been minimized.

Copy link

scottmarlow commented May 27, 2014

I'm getting a weird OS configuration error (something unexpected in my ~/.gnupg/gpg.conf) when I attempt doing the 'git tag -s rel_3_18_2_ga -m"rel_3_18_2_ga" ' I will release 3.18.2-GA soon after I resolve this :)

@scottmarlow

This comment has been minimized.

Copy link

scottmarlow commented May 27, 2014

I released 3.18.2-GA (pushed tag to github 3.18 branch and also pushed to the central release repo.

@chibash

This comment has been minimized.

Copy link

chibash commented May 27, 2014

Thanks, Scott!

@jroper

This comment has been minimized.

Copy link
Member

jroper commented May 28, 2014

Thanks @chibash and @scottmarlow!

Play users, you can now work around this by adding the following to your project/plugins.sbt:

libraryDependencies += "org.javassist" % "javassist" % "3.18.2-GA"
@jroper

This comment has been minimized.

Copy link
Member

jroper commented May 28, 2014

Pull request attached.

@kjkmadness

This comment has been minimized.

Copy link

kjkmadness commented May 28, 2014

@jroper @chibash @scottmarlow
thank you all.

pvlugter added a commit that referenced this pull request May 28, 2014

Merge pull request #1966 from jroper/1966-upgrade-javassist
[Play-2.2.x] some code causes java.lang.VerifyError at runtime

@pvlugter pvlugter merged commit 1534d66 into playframework:master May 28, 2014

1 check passed

default Merged build finished.
Details

jroper added a commit that referenced this pull request May 29, 2014

@jroper jroper added this to the 2.3.0 milestone Sep 12, 2014

@jroper jroper deleted the jroper:1966-upgrade-javassist branch Sep 12, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment