[Play2.2-java] upgrade from play2.1, verifyerror

1,634 views
Skip to first unread message

flp

unread,
Oct 18, 2013, 11:49:28 AM10/18/13
to play-fr...@googlegroups.com
After I updated from play 2.1 to play 2.2., I will get now an error, if I want to see sites with access restriction.
Unfortunately I haven't changed anything there from 2.0 and it works fine for 2.0 und 2.1, but it stopped working in 2.2.

I have appended the error description I get.

 
! Internal server error, for (GET) [/admin/leagues/] ->

java.lang.VerifyError: Stack map does not match the one at exception handler 153

Exception Details:
  Location:
    controllers/AdminController.updateGame(Ljava/lang/Long;)Lplay/mvc/Result; @1
53: astore_3
  Reason:
    Type 'models/Game' (current frame, locals[4]) is not assignable to 'models/L
eague' (stack map, locals[4])
  Current Frame:
    bci: @87
    flags: { }
    locals: { 'java/lang/Long', 'java/lang/Long', 'play/data/Form', top, 'models
/Game', long, long_2nd }
    stack: { 'java/lang/IllegalStateException' }
  Stackmap Frame:
    bci: @153
    flags: { }
    locals: { 'java/lang/Long', 'java/lang/Long', 'play/data/Form', top, 'models
/League' }
    stack: { 'java/lang/IllegalStateException' }
  Bytecode:
    0000000: b800 0bc6 0007 b800 0bb0 1300 5abb 005b
    0000010: 5901 b700 5cb8 005d b200 222a b600 11c0
    0000020: 002b 3a04 013a 0519 04b6 025a 3a05 1905
    0000030: 3a04 0937 0519 04b6 024b 3705 1605 b800
    0000040: 334c 1300 2bb8 0014 03bd 0005 b600 184d
    0000050: 2cb6 0019 c000 2b3a 0403 3605 1904 b602
    0000060: 3b36 0515 05b2 0022 2ab6 0011 c000 2b3a
    0000070: 0401 3a05 1904 b602 5a3a 0519 053a 0403
    0000080: 3605 1904 b602 3e36 0515 05a4 000b 2c12
    0000090: 6212 6bb6 001e a700 044e 2cb6 0019 c000
    00000a0: 2b3a 0401 3a05 1904 b602 5e3a 0519 053a
    00000b0: 0409 3705 1904 b602 5f37 0516 052c b600
    00000c0: 19c0 002b 3a04 013a 0519 04b6 0262 3a05
    00000d0: 1905 3a04 0937 0519 04b6 025f 3705 1605
    00000e0: 949a 0013 2c12 6612 6db6 001e 2c12 6512
    00000f0: 6db6 001e a700 044e 2cb6 0020 9900 162b
    0000100: b800 584e 2a2b 2d2c b800 0db8 0076 b800
    0000110: 21b0 2cb6 0019 c000 2b2a b600 772c b600
    0000120: 19c0 002b 3a04 0336 0519 04b6 0259 3605
    0000130: 1505 9900 35b2 0010 2cb6 0019 c000 2b3a
    0000140: 0401 3a05 1904 b602 5a3a 0519 053a 0409
    0000150: 3705 1904 b602 4b37 0516 05b8 0033 b600
    0000160: 11c0 0012 b600 3512 36bb 0037 59b7 0038
    0000170: 1271 b600 3ab2 004e 2cb6 0019 c000 2b3a
    0000180: 0401 3a05 1904 b602 5e3a 0519 053a 0409
    0000190: 3705 1904 b602 5f37 0516 05b8 0033 b600
    00001a0: 11c0 0046 3a04 013a 0519 04b6 024c 3a05
    00001b0: 1905 b600 3a12 74b6 003a b200 4e2c b600
    00001c0: 19c0 002b 3a04 013a 0519 04b6 0262 3a05
    00001d0: 1905 3a04 0937 0519 04b6 025f 3705 1605
    00001e0: b800 33b6 0011 c000 463a 0401 3a05 1904
    00001f0: b602 4c3a 0519 05b6 003a 123c b600 3ab6
    0000200: 003d b800 3eb2 004b 2bb6 004c b600 4db8
    0000210: 000a b0
  Exception Handler Table:
    bci [80, 150] => handler: 153
    bci [154, 244] => handler: 247
  Stackmap Table:
    same_frame(@10)
    full_frame(@150,{Object[#328],Object[#328],Object[#291],Top,Object[#246],Int
eger},{})
    full_frame(@153,{Object[#328],Object[#328],Object[#291],Top,Object[#246]},{O
bject[#196]})
    full_frame(@154,{Object[#328],Object[#328],Object[#291],Top,Object[#246]},{}
)
    full_frame(@244,{Object[#328],Object[#328],Object[#291],Top,Object[#70],Long
},{})
    full_frame(@247,{Object[#328],Object[#328],Object[#291],Top,Object[#456]},{O
bject[#196]})
    same_frame(@248)
    same_frame(@274)
    same_frame_extended(@359)

        at java.lang.Class.getDeclaredMethods0(Native Method) ~[na:1.7.0_45]
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2531) ~[na:1.7.0
_45]
        at java.lang.Class.getMethod0(Class.java:2774) ~[na:1.7.0_45]
        at java.lang.Class.getMethod(Class.java:1663) ~[na:1.7.0_45]
        at org.apache.commons.lang3.reflect.MethodUtils.getMatchingAccessibleMet
hod(MethodUtils.java:511) ~[commons-lang3.jar:3.1]
        at play.core.Router$HandlerInvoker$$anon$7$$anon$2$$anonfun$3.apply(Rout
er.scala:178) ~[play_2.10.jar:2.2.0]
[error] application - Error while rendering default error page
scala.MatchError: java.lang.VerifyError: Stack map does not match the one at exc
eption handler 153
Exception Details:
  Location:
    controllers/AdminController.updateGame(Ljava/lang/Long;)Lplay/mvc/Result; @1
53: astore_3
  Reason:
    Type 'models/Game' (current frame, locals[4]) is not assignable to 'models/L
eague' (stack map, locals[4])
  Current Frame:
    bci: @87
    flags: { }
    locals: { 'java/lang/Long', 'java/lang/Long', 'play/data/Form', top, 'models
/Game', long, long_2nd }
    stack: { 'java/lang/IllegalStateException' }
  Stackmap Frame:
    bci: @153
    flags: { }
    locals: { 'java/lang/Long', 'java/lang/Long', 'play/data/Form', top, 'models
/League' }
    stack: { 'java/lang/IllegalStateException' }
  Bytecode:
    0000000: b800 0bc6 0007 b800 0bb0 1300 5abb 005b
    0000010: 5901 b700 5cb8 005d b200 222a b600 11c0
    0000020: 002b 3a04 013a 0519 04b6 025a 3a05 1905
    0000030: 3a04 0937 0519 04b6 024b 3705 1605 b800
    0000040: 334c 1300 2bb8 0014 03bd 0005 b600 184d
    0000050: 2cb6 0019 c000 2b3a 0403 3605 1904 b602
    0000060: 3b36 0515 05b2 0022 2ab6 0011 c000 2b3a
    0000070: 0401 3a05 1904 b602 5a3a 0519 053a 0403
    0000080: 3605 1904 b602 3e36 0515 05a4 000b 2c12
    0000090: 6212 6bb6 001e a700 044e 2cb6 0019 c000
    00000a0: 2b3a 0401 3a05 1904 b602 5e3a 0519 053a
    00000b0: 0409 3705 1904 b602 5f37 0516 052c b600
    00000c0: 19c0 002b 3a04 013a 0519 04b6 0262 3a05
    00000d0: 1905 3a04 0937 0519 04b6 025f 3705 1605
    00000e0: 949a 0013 2c12 6612 6db6 001e 2c12 6512
    00000f0: 6db6 001e a700 044e 2cb6 0020 9900 162b
    0000100: b800 584e 2a2b 2d2c b800 0db8 0076 b800
    0000110: 21b0 2cb6 0019 c000 2b2a b600 772c b600
    0000120: 19c0 002b 3a04 0336 0519 04b6 0259 3605
    0000130: 1505 9900 35b2 0010 2cb6 0019 c000 2b3a
    0000140: 0401 3a05 1904 b602 5a3a 0519 053a 0409
    0000150: 3705 1904 b602 4b37 0516 05b8 0033 b600
    0000160: 11c0 0012 b600 3512 36bb 0037 59b7 0038
    0000170: 1271 b600 3ab2 004e 2cb6 0019 c000 2b3a
    0000180: 0401 3a05 1904 b602 5e3a 0519 053a 0409
    0000190: 3705 1904 b602 5f37 0516 05b8 0033 b600
    00001a0: 11c0 0046 3a04 013a 0519 04b6 024c 3a05
    00001b0: 1905 b600 3a12 74b6 003a b200 4e2c b600
    00001c0: 19c0 002b 3a04 013a 0519 04b6 0262 3a05
    00001d0: 1905 3a04 0937 0519 04b6 025f 3705 1605
    00001e0: b800 33b6 0011 c000 463a 0401 3a05 1904
    00001f0: b602 4c3a 0519 05b6 003a 123c b600 3ab6
    0000200: 003d b800 3eb2 004b 2bb6 004c b600 4db8
    0000210: 000a b0
  Exception Handler Table:
    bci [80, 150] => handler: 153
    bci [154, 244] => handler: 247
  Stackmap Table:
    same_frame(@10)
    full_frame(@150,{Object[#328],Object[#328],Object[#291],Top,Object[#246],Int
eger},{})
    full_frame(@153,{Object[#328],Object[#328],Object[#291],Top,Object[#246]},{O
bject[#196]})
    full_frame(@154,{Object[#328],Object[#328],Object[#291],Top,Object[#246]},{}
)
    full_frame(@244,{Object[#328],Object[#328],Object[#291],Top,Object[#70],Long
},{})
    full_frame(@247,{Object[#328],Object[#328],Object[#291],Top,Object[#456]},{O
bject[#196]})
    same_frame(@248)
    same_frame(@274)
    same_frame_extended(@359)
 (of class java.lang.VerifyError)
        at play.api.GlobalSettings$class.onError(GlobalSettings.scala:134) ~[pla
y_2.10.jar:2.2.0]
        at play.api.DefaultGlobal$.onError(GlobalSettings.scala:192) [play_2.10.
jar:2.2.0]
        at play.core.server.Server$class.logExceptionAndGetResult$1(Server.scala
:73) [play_2.10.jar:2.2.0]
        at play.core.server.Server$$anonfun$getHandlerFor$4.apply(Server.scala:8
3) [play_2.10.jar:2.2.0]
        at play.core.server.Server$$anonfun$getHandlerFor$4.apply(Server.scala:8
1) [play_2.10.jar:2.2.0]
        at scala.util.Either$RightProjection.flatMap(Either.scala:523) [scala-li
brary.jar:na]

flp

unread,
Oct 23, 2013, 6:44:21 PM10/23/13
to play-fr...@googlegroups.com
push, noone any idea?

Kenny Debrauwer

unread,
Oct 29, 2013, 8:22:23 AM10/29/13
to play-fr...@googlegroups.com
Hello

I had a similar problem with Play! 2.2.0 on java 1.7, not sure if it's the same without knowing your code, but my problem was initializing objects and adding them to my object inside a try-catch clause. I wrote a blog post about my problem and work-around : http://www.kadeke.be/en/developer-blog/java-lang-verifyerror-stack-map-does-not-match-the-one-at-exception-handler

My work-around was extracting the piece of code into a method. It does exactly the same, but the code which adds the newly initialized obect to my container object has just moved to a method.

I hope it'll bring you closer to a solution.

- Kenny

Op donderdag 24 oktober 2013 00:44:21 UTC+2 schreef flp:

Nilanjan Raychaudhuri

unread,
Oct 29, 2013, 5:21:01 PM10/29/13
to play-fr...@googlegroups.com
are you using java 6? Could you please change it to Java 7 and see whether the error goes away? This could be related to Java version

Nilanjan, Developer & Consultant
Typesafe Inc.
Twitter: @nraychaudhuri

kjkmadness

unread,
Oct 31, 2013, 1:47:42 AM10/31/13
to play-fr...@googlegroups.com
I have a similar problem with play 2.2.1 and java7 (7u45).

for reproducing the problem, I created an simple play java project and added some test code.

Application.java : just create a null paramter and throw it to the test class after printing java version.
public static Result index() {
    System.out.println(System.getProperty("java.version"));
    Test.test(createParameter());
    return ok(index.render("Your new application is ready."));
}

Test.java : test class mocking parameter validation and few works.
public class Test {
    
    public static String test(Parameter parameter) {
        if (parameter.param1 == null || parameter.param2 == null) {
            return "";
        }
        try {
            Worker worker = createWorker(parameter.param3);
            WorkResult result1 = worker.work(parameter.param1);
            if (result1 == null) {
                return "";
            }
            return "OK";
        } catch (Exception e) {
           throw new RuntimeException(e);
        }
    }

    private static Worker createWorker(Long id) {
        return new Worker();
    }

    public static class Parameter {
        public String param1;
        public String param2;
        public Long param3;
    }

    public static class Worker {
        public WorkResult work(String param) {
            return new WorkResult();
        }
    }

    public static class WorkResult {
    }
}

when I call http://127.0.0.1:9000, NPE should occur after printing java version.

but I got below..
1.7.0_45
Uncaught error from thread [play-akka.actor.default-dispatcher-12] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[play]
java.lang.VerifyError: Stack map does not match the one at exception handler 80
Exception Details:
[ERROR] [10/31/2013 14:37:23.774] [play-akka.actor.default-dispatcher-12] [ActorSystem(play)] Uncaught error from thread [play-a  Location:
kka.actor.default-dispatcher-12] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled
    controllers/Test.test(Lcontrollers/Test$Parameter;)Ljava/lang/String; @80: astore_1
java.lang.VerifyError: Stack map does not match the one at exception handler 80
  Reason:
Exception Details:
    Type 'java/lang/Long' (current frame, locals[4]) is not assignable to 'java/lang/String' (stack map, locals[4])
  Location:
  Current Frame:
    controllers/Test.test(Lcontrollers/Test$Parameter;)Ljava/lang/String; @80: astore_1
    bci: @44
  Reason:
    flags: { }
    Type 'java/lang/Long' (current frame, locals[4]) is not assignable to 'java/lang/String' (stack map, locals[4])
    locals: { 'controllers/Test$Parameter', top, top, 'controllers/Test$Parameter', 'java/lang/Long' }
  Current Frame:
    stack: { 'java/lang/Exception' }
    bci: @44
  Stackmap Frame:
    flags: { }
    bci: @80
    locals: { 'controllers/Test$Parameter', top, top, 'controllers/Test$Parameter', 'java/lang/Long' }
    flags: { }
    stack: { 'java/lang/Exception' }
    locals: { 'controllers/Test$Parameter', top, top, 'controllers/Test$Parameter', 'java/lang/String' }


I think it's caused by generated getter/setter in try-catch.
because one of the below makes the error disappear
- write getter/setter in code
- remove try-catch

But I wanna user try-catch.
I don't wannt write getter/setter for every classes if it is possible.

what could be a fundamental problem?



2013년 10월 30일 수요일 오전 6시 21분 1초 UTC+9, Nilanjan Raychaudhuri 님의 말:

flp

unread,
Oct 31, 2013, 7:24:02 PM10/31/13
to play-fr...@googlegroups.com
Hey,

thanks for your reply. I'm using Java 7.

The crazy thing I wonder at, I haven't changed anything and it doesn't work anymore. If I switch back to Play 2.1, everything works fine again

flp

unread,
Oct 31, 2013, 7:45:10 PM10/31/13
to play-fr...@googlegroups.com
Through 2.2.1 I get now a different error. But I still have no clue, why it happens.

java.lang.VerifyError: Stack map does not match the one at exception handler 153

 
in method controllers.AdminController.updateGame(Ljava/lang/Long;)Lplay/mvc/Res
ult
; at offset 87
        at java
.lang.Class.getDeclaredMethods0(Native Method) ~[na:1.7.0_03]
        at java
.lang.Class.privateGetDeclaredMethods(Class.java:2442) ~[na:1.7.0
_03
]
        at java
.lang.Class.getMethod0(Class.java:2685) ~[na:1.7.0_03]
        at java
.lang.Class.getMethod(Class.java:1620) ~[na:1.7.0_03]

        at org
.apache.commons.lang3.reflect.MethodUtils.getMatchingAccessibleMet
hod
(MethodUtils.java:511) ~[commons-lang3.jar:3.1]
        at play
.core.Router$HandlerInvoker$$anon$7$$anon$2$$anonfun$3.apply(Rout

er
.scala:178) ~[play_2.10.jar:2.2.1]

[error] application - Error while rendering default error page
scala
.MatchError: java.lang.VerifyError: Stack map does not
match the one at exc
eption handler
153 in method controllers.AdminController.updateGame(Ljava/lang/L
ong
;)Lplay/mvc/Result; at offset 87 (of class java.lang.VerifyError)
        at play
.api.GlobalSettings$class.onError(GlobalSettings.scala:131) ~[pla
y_2
.10.jar:2.2.1]
        at play
.api.DefaultGlobal$.onError(GlobalSettings.scala:189) [play_2.10.
jar
:2.2.1]
        at play
.core.server.Server$class.logExceptionAndGetResult$1(Server.scala
:73) [play_2.10.jar:2.2.1]
        at play
.core.server.Server$$anonfun$getHandlerFor$4.apply(Server.scala:8
3) [play_2.10.jar:2.2.1]
        at play
.core.server.Server$$anonfun$getHandlerFor$4.apply(Server.scala:8
1) [play_2.10.jar:2.2.1]

        at scala
.util.Either$RightProjection.flatMap(Either.scala:523) [scala-li
brary
.jar:na]

RyanT

unread,
Nov 14, 2013, 2:42:09 AM11/14/13
to play-fr...@googlegroups.com
I do have similar errors at various places in my website after upgrading to 2.2.1. I use java 7 latest version. Reverting back to 2.1 works.

A work around is to remove the exception, however, the frustrated thing is I will have to go through all the controller methods (by accessing them from the browser) to make sure all of them works which is very unproductive.

I hope this error will be resolved in the future otherwise I will not upgrade my Play anymore cause I don't know when my code will not work.

Thanks,

김정국

unread,
Nov 14, 2013, 2:52:07 AM11/14/13
to play-fr...@googlegroups.com

Another workaround.

-XX:UseSplitVerifier

add this jvm option.
only with java7. not sure java8

2013. 11. 14. 오후 4:42에 "RyanT" <truongd...@jayeson.com.sg>님이 작성:
--
You received this message because you are subscribed to a topic in the Google Groups "play-framework" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/play-framework/eWFwZ75T6wk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to play-framewor...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

RyanT

unread,
Nov 14, 2013, 3:33:01 AM11/14/13
to play-fr...@googlegroups.com
Thanks. But I have already reverted my code!! Will wait if there is official fix for this.

Thomas Koeppen

unread,
Nov 25, 2013, 12:32:54 PM11/25/13
to play-fr...@googlegroups.com
https://github.com/playframework/playframework/issues/1966 was reported but not yet solved.

-XX:UseSplitVerifier worked for us as well on java7.
Message has been deleted

TonyB

unread,
Dec 5, 2013, 9:40:21 PM12/5/13
to play-fr...@googlegroups.com
Just wanted to give a heads up that this was fixed 3 days ago in Javassist on the master 3.18 branch.  Still no release jar or git tag yet for 3.18.2-GA though.  Doubt I'll have the time to try it myself.


Reply all
Reply to author
Forward
0 new messages