[1.2.4-RC3] UnexpectedException while applying class play.classloading.enhancers.LocalvariablesNamesEnhancer

1,848 views
Skip to first unread message

jbtbnl

unread,
Nov 24, 2011, 10:44:24 AM11/24/11
to play-fr...@googlegroups.com
Play framework 1.2.4 RC3 throws an unexpected error when the following code is included in a controller:

int a = 0;
for(int i = 0; i < 5; i++) {
    a++;
}
 
The stack-trace:

Internal Server Error (500) for request GET /

Oops: UnexpectedException
An unexpected error occured caused by exception UnexpectedException: While applying class play.classloading.enhancers.LocalvariablesNamesEnhancer on controllers.InformationController

play.exceptions.UnexpectedException: While applying play.CorePlugin@4da7234f on controllers.InformationController
at play.plugins.PluginCollection.enhance(PluginCollection.java:511)
at play.classloading.ApplicationClasses$ApplicationClass.enhance(ApplicationClasses.java:235)
at play.classloading.ApplicationClassloader.detectChanges(ApplicationClassloader.java:327)
at play.Play.detectChanges(Play.java:614)
at play.Invoker$Invocation.init(Invoker.java:198)
at Invocation.HTTP Request(Play!)
Caused by: play.exceptions.UnexpectedException: While applying class play.classloading.enhancers.LocalvariablesNamesEnhancer on controllers.InformationController
at play.CorePlugin.enhance(CorePlugin.java:302)
at play.plugins.PluginCollection.enhance(PluginCollection.java:506)
... 5 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 2
at javassist.bytecode.stackmap.Tracer.doOpcode0_53(Tracer.java:163)
at javassist.bytecode.stackmap.Tracer.doOpcode(Tracer.java:94)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:182)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:192)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:141)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:96)
at javassist.bytecode.MethodInfo.rebuildStackMap(MethodInfo.java:416)
at javassist.bytecode.MethodInfo.rebuildStackMapIf6(MethodInfo.java:398)
at javassist.CtBehavior.insertBefore(CtBehavior.java:719)
at javassist.CtBehavior.insertBefore(CtBehavior.java:685)
at play.classloading.enhancers.LocalvariablesNamesEnhancer.enhanceThisClass(LocalvariablesNamesEnhancer.java:296)
at play.CorePlugin.enhance(CorePlugin.java:297)
... 6 more

Please reply whether you are able to reproduce this.

jbtbnl

unread,
Nov 24, 2011, 12:38:49 PM11/24/11
to play-fr...@googlegroups.com
I tried to reproduce in an empty project but I didn't succeed.

I figured out that the initialization of variable a isn't necessary, neither the increment. (so just the for loop)
Changing the name of variable i to something with 5 characters or more solves the issue.

Quite strange!

jbtbnl

unread,
Nov 25, 2011, 10:18:19 AM11/25/11
to play-fr...@googlegroups.com

jbtbnl

unread,
Dec 3, 2011, 10:41:20 AM12/3/11
to play-fr...@googlegroups.com
This bug is still present in the final play 1.2.4, but it has been solved in the master branch.

Morten Kjetland

unread,
Dec 3, 2011, 2:38:34 PM12/3/11
to play-fr...@googlegroups.com

It is solved in the 1.2.x branch. We fixed it right after releasing 1.2.4 so if you checkout 1.2.x branch you basically get 1.2.4 + a bunch of enhancer fixes.

-morten

On Dec 3, 2011 4:41 PM, "jbtbnl" <janten...@gmail.com> wrote:
This bug is still present in the final play 1.2.4, but it has been solved in the master branch.

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/MxFyKk02RQoJ.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.

pomegrn8

unread,
Dec 17, 2011, 1:47:53 PM12/17/11
to play-framework
Can you post here when it will be available in the latest official
version?

Thanks!
Jill

On Dec 3, 11:38 am, Morten Kjetland <m...@kjetland.com> wrote:
> It is solved in the 1.2.x branch. We fixed it right after releasing 1.2.4
> so if you checkout 1.2.x branch you basically get 1.2.4 + a bunch of
> enhancer fixes.
>
> -morten

> On Dec 3, 2011 4:41 PM, "jbtbnl" <jantenbok...@gmail.com> wrote:
>
> > This bug is still present in the final play 1.2.4, but it has been solved
> > in the master branch.
>

> >https://github.com/playframework/play/commit/8823d3827557df3e8bfdbd18...

Ron Gross

unread,
Dec 28, 2011, 4:59:53 AM12/28/11
to play-fr...@googlegroups.com
The bug just reproduced on the latest 1.2.x version. I reverted to an earlier 1.2.x build from a few weeks ago and it resolved the issue.
I updated the bug, it should be reopened.

Stéphane Godbillon

unread,
Dec 28, 2011, 5:09:43 AM12/28/11
to play-fr...@googlegroups.com
Hi,

Can you give us more details (like the complete stack trace, and if
possible the code that fails) ?

Thanks,
--
Stephane Godbillon

> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/play-framework/-/Ldil5Dz20OYJ.

Ron Gross

unread,
Dec 28, 2011, 5:17:03 AM12/28/11
to play-fr...@googlegroups.com
I updated the bug with the complete stack track (from the point of the error onward).
Sadly I can't share the code for my entire controller.

Perhaps if the error message had included a specific method name, I could share the code for that method only.
Please let me know if there's anyway else I can help.

2011/12/28 Stéphane Godbillon <s...@zenexity.fr>

Stéphane Godbillon

unread,
Dec 28, 2011, 5:31:33 AM12/28/11
to play-fr...@googlegroups.com
Ah, I see, thank you. I have already seen this bug; I'm pretty sure a
javassist one (the javassist version embedded in Play 1.2.x is kind of
old now).

Can you try the following please :
- download the latest javassist :
http://sourceforge.net/projects/jboss/files/Javassist/3.15.0-GA/javassist-3.15.0-GA.zip/download
- go in the <play>/framework/lib directory
- copy the javassist.jar from the downloaded archive
- remove javassist-3.9.0.GA.jar
- run your project again. Don't forget to do a play clean before running it.

Let me know if it solves your problem.

Thanks,
--
Stephane Godbillon

Ron Gross

unread,
Dec 28, 2011, 11:11:06 AM12/28/11
to play-fr...@googlegroups.com
At first I thought it doesn't solve anything, but I then ran play deps --sync, and afterwards the problem was gone.
Sorry, it doesn't seem to solve the issue:

1. I deleted javassist-3.9.0.GA.jar
2. I placed javassist.jar in its place
3. Ran play deps --sync just in case
4. Got same error

2011/12/28 Stéphane Godbillon <s...@zenexity.fr>

Ron Gross

unread,
Jan 2, 2012, 10:32:49 AM1/2/12
to play-fr...@googlegroups.com
Not resolved

Whoops - the previous mail is a contradiction. I thought at first the problem was gone, but it's actually not, and I got mixed up when replying earlier.
The problem is not resolved, details in the previous post.

Stéphane Godbillon

unread,
Jan 2, 2012, 10:36:35 AM1/2/12
to play-fr...@googlegroups.com
Ok, I don't have enough information to debug it, so I will prepare a
version with more detailed logs ASAP.
--
Stephane Godbillon

> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/play-framework/-/3kWNJEUs7CAJ.

Ron Gross

unread,
Jan 9, 2012, 5:10:06 AM1/9/12
to play-fr...@googlegroups.com
Ping

Sorry if I'm being annoying, I don't know when 1.2.5 is planned, but if this is not resolved then I won't be able to upgrade to it.

Ron Gross

unread,
Jan 25, 2012, 6:16:22 AM1/25/12
to play-fr...@googlegroups.com
Another ping.

This is a show stopper for us, we can't upgrade to 1.2.5 (whenever it comes out) until this is resolved.

Please suggest an appropriate debugging technique.

On Mon, Jan 9, 2012 at 12:10 PM, Ron Gross <ron....@gmail.com> wrote:
Ping

Sorry if I'm being annoying, I don't know when 1.2.5 is planned, but if this is not resolved then I won't be able to upgrade to it.

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/NCYdyJbPSrUJ.

To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.

Thomas Parle

unread,
Feb 22, 2012, 5:32:15 AM2/22/12
to play-framework
Hi,

I suddenly encoutered the same issue.
To solve it, you can either wait the next version of Play!, or
downgrade your javassist version in dependencies, using the original
of Play! which was for me the 3.9.0.GA.
Upgrading my Hibernate version yesterday had also upgraded the
javassist to 3.12.0.GA transitively, which caused the bug for me.

Thomas

On Jan 25, 12:16 pm, Ron Gross <ron.gr...@gmail.com> wrote:
> Another ping.
>
> This is a *show stopper* for us, we can't upgrade to 1.2.5 (whenever it

Ron Gross

unread,
Feb 22, 2012, 5:35:56 AM2/22/12
to play-fr...@googlegroups.com
Thanks for posting the workaround/fix.

This is the new bug that tracks this issue, it's scheduled to be fixed in 1.2.5.

I updated the bug with your comment.
Reply all
Reply to author
Forward
0 new messages