#1867 new
Cheong Chung Onn

javassist.CannotCompileException: by javassist.bytecode.BadBytecode

Reported by Cheong Chung Onn | August 27th, 2014 @ 11:58 AM

Hi,

I am using the commit eff7570d51b in branch 1.3.x compiled using Java 8 on OSX. I am able to start the application, however upon accessing the application I have an Unexpected Exception due to LocalvariableNamesEnhancer. Below are the stack trace.

Any help will be appreciated

chungonn

@6jbdoc452 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.KioskConsole

play.exceptions.UnexpectedException: While applying play.CorePlugin@57af006c on controllers.KioskConsole
at play.plugins.PluginCollection.enhance(PluginCollection.java:556) at play.classloading.ApplicationClasses$ApplicationClass.enhance(ApplicationClasses.java:240) at play.classloading.ApplicationClassloader.loadApplicationClass(ApplicationClassloader.java:169) at play.classloading.ApplicationClassloader.loadClass(ApplicationClassloader.java:86) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:760) at play.classloading.ApplicationClassloader.loadApplicationClass(ApplicationClassloader.java:170) at play.classloading.ApplicationClassloader.getAllClasses(ApplicationClassloader.java:445) at play.Play.start(Play.java:527) at play.Play.detectChanges(Play.java:653) 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.KioskConsole
at play.CorePlugin.enhance(CorePlugin.java:302) at play.plugins.PluginCollection.enhance(PluginCollection.java:551) ... 12 more Caused by: javassist.CannotCompileException: by javassist.bytecode.BadBytecode: completeVisit (Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V in controllers.KioskConsole: conflict: float and java.lang.String
at javassist.CtBehavior.insertBefore(CtBehavior.java:777) at javassist.CtBehavior.insertBefore(CtBehavior.java:734) at play.classloading.enhancers.LocalvariablesNamesEnhancer.enhanceThisClass(LocalvariablesNamesEnhancer.java:268) at play.CorePlugin.enhance(CorePlugin.java:297) ... 13 more Caused by: javassist.bytecode.BadBytecode: completeVisit (Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V in controllers.KioskConsole: conflict: float and java.lang.String
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:111) at javassist.bytecode.MethodInfo.rebuildStackMap(MethodInfo.java:423) at javassist.bytecode.MethodInfo.rebuildStackMapIf6(MethodInfo.java:405) at javassist.CtBehavior.insertBefore(CtBehavior.java:768) ... 16 more Caused by: javassist.bytecode.BadBytecode: conflict: float and java.lang.String
at javassist.bytecode.stackmap.TypeData$BasicType.setType(TypeData.java:134) at javassist.bytecode.stackmap.Tracer.checkParamTypes(Tracer.java:930) at javassist.bytecode.stackmap.Tracer.doInvokeMethod(Tracer.java:801) at javassist.bytecode.stackmap.Tracer.doOpcode148_201(Tracer.java:597) at javassist.bytecode.stackmap.Tracer.doOpcode(Tracer.java:81) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:187) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:164) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:108) ... 19 more

Comments and changes to this ticket

  • Robert Bakker

    Robert Bakker August 28th, 2014 @ 07:43 PM

    Hi,

    Do you have some small example code that can reproduce this issue?

    regards,

    Robert

  • Cheong Chung Onn

    Cheong Chung Onn August 31st, 2014 @ 07:14 AM

    Hi Robert,

    I am not able to reproduce the problem in a simple project. However, I did explore different approaches hoping to zoom into the problem but then i fail. First I like to mention that the same code runs well on Play 1.2.5.

    Below are my attempts to zoom into the problems though I couldn't figure out the cause then I hope the info can be useful to you. Please let me know what else I can do further.

    Regards
    chungonn

    1. Use Java assist 3.17.1-GA as it has fixed a similar issue https://issues.jboss.org/browse/JASSIST-177. I had problem trying to change Play (framework dependencies.yml) to use that version then I tried to set my project dependencies.yml with the 'force:true' and it does not seems to work.

    2. Try debugging - I found that the problematic method "completeVisit" is enhanced by both PropertiesEnhancer, ControllerEnhancer and LocalvariableEnhancer plugins. And it is the LocalvariableEnhancer that is giving problem. Below is the stacktrace

    Thread play-thread-1)
    owns: Object (id=2891) CtMethod(CtBehavior).insertBefore(String, boolean) line: 777
    CtMethod(CtBehavior).insertBefore(String) line: 734 LocalvariablesNamesEnhancer.enhanceThisClass(ApplicationClasses$ApplicationClass) line: 268 CorePlugin.enhance(ApplicationClasses$ApplicationClass) line: 297
    PluginCollection.enhance(ApplicationClasses$ApplicationClass) line: 551 ApplicationClasses$ApplicationClass.enhance() line: 240 ApplicationClassloader.loadApplicationClass(String) line: 169
    ApplicationClassloader.loadClass(String, boolean) line: 86
    ApplicationClassloader(ClassLoader).loadClass(String) line: 357 ClassLoader.defineClass1(String, byte[], int, int, ProtectionDomain, String) line: not available [native method]
    ApplicationClassloader(ClassLoader).defineClass(String, byte[], int, int, ProtectionDomain) line: 760
    ApplicationClassloader.loadApplicationClass(String) line: 170
    ApplicationClassloader.getAllClasses() line: 445
    ApplicationClassloader.getAssignableClasses(Class) line: 469
    GroovyTemplateCompiler.compile(BaseTemplate) line: 34
    GroovyTemplateCompiler(TemplateCompiler).compile(VirtualFile) line: 28
    TemplateLoader.load(VirtualFile) line: 84
    Router.parse(VirtualFile, String) line: 161 Router.load(String) line: 47
    Router.detectChanges(String) line: 218
    PlayHandler$NettyInvocation.init() line: 182
    PlayHandler$NettyInvocation(Invoker$Invocation).run() line: 287 PlayHandler$NettyInvocation.run() line: 236 Executors$RunnableAdapter.call() line: 511
    ScheduledThreadPoolExecutor$ScheduledFutureTask(FutureTask).run() line: 266
    ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor$ScheduledFutureTask) line: 180
    ScheduledThreadPoolExecutor$ScheduledFutureTask.run() line: 293
    ScheduledThreadPoolExecutor(ThreadPoolExecutor).runWorker(ThreadPoolExecutor$Worker) line: 1142 ThreadPoolExecutor$Worker.run() line: 617
    Thread.run() line: 745

    1. Comment out the entire of code inside 'completeVisit', javassist compiler now throws errors on other controller#action. See stack trace below@6jcgaai9a
      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.ServiceStationConsole

    play.exceptions.UnexpectedException: While applying play.CorePlugin@57af006c on controllers.ServiceStationConsole
    at play.plugins.PluginCollection.enhance(PluginCollection.java:556) at play.classloading.ApplicationClasses$ApplicationClass.enhance(ApplicationClasses.java:240) at play.classloading.ApplicationClassloader.loadApplicationClass(ApplicationClassloader.java:169) at play.classloading.ApplicationClassloader.getAllClasses(ApplicationClassloader.java:445) at play.Play.start(Play.java:527) at play.Play.detectChanges(Play.java:653) 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.ServiceStationConsole
    at play.CorePlugin.enhance(CorePlugin.java:302) at play.plugins.PluginCollection.enhance(PluginCollection.java:551) ... 7 more Caused by: javassist.CannotCompileException: by javassist.bytecode.BadBytecode: done (Lmodels/queue/ServicePoint;Lmodels/dto/RequestDTO;)V in controllers.ServiceStationConsole: inconsistent stack height -2
    at javassist.CtBehavior.insertBefore(CtBehavior.java:777) at javassist.CtBehavior.insertBefore(CtBehavior.java:734) at play.classloading.enhancers.LocalvariablesNamesEnhancer.enhanceThisClass(LocalvariablesNamesEnhancer.java:268) at play.CorePlugin.enhance(CorePlugin.java:297) ... 8 more Caused by: javassist.bytecode.BadBytecode: done (Lmodels/queue/ServicePoint;Lmodels/dto/RequestDTO;)V in controllers.ServiceStationConsole: inconsistent stack height -2
    at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:111) at javassist.bytecode.MethodInfo.rebuildStackMap(MethodInfo.java:423) at javassist.bytecode.MethodInfo.rebuildStackMapIf6(MethodInfo.java:405) at javassist.CtBehavior.insertBefore(CtBehavior.java:768) ... 11 more Caused by: javassist.bytecode.BadBytecode: inconsistent stack height -2
    at javassist.bytecode.stackmap.Tracer.doOpcode(Tracer.java:84) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:187) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:164) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:108) ... 14 more Caused by: java.lang.ArrayIndexOutOfBoundsException: -2
    at javassist.bytecode.stackmap.Tracer.doXLOAD(Tracer.java:279) at javassist.bytecode.stackmap.Tracer.doXLOAD(Tracer.java:275) at javassist.bytecode.stackmap.Tracer.doOpcode0_53(Tracer.java:177) at javassist.bytecode.stackmap.Tracer.doOpcode(Tracer.java:74) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:187) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:164) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:108) at javassist.bytecode.MethodInfo.rebuildStackMap(MethodInfo.java:423) at javassist.bytecode.MethodInfo.rebuildStackMapIf6(MethodInfo.java:405) at javassist.CtBehavior.insertBefore(CtBehavior.java:768) at javassist.CtBehavior.insertBefore(CtBehavior.java:734) at play.classloading.enhancers.LocalvariablesNamesEnhancer.enhanceThisClass(LocalvariablesNamesEnhancer.java:268) at play.CorePlugin.enhance(CorePlugin.java:297) at play.plugins.PluginCollection.enhance(PluginCollection.java:551) at play.classloading.ApplicationClasses$ApplicationClass.enhance(ApplicationClasses.java:240) at play.classloading.ApplicationClassloader.loadApplicationClass(ApplicationClassloader.java:169) at play.classloading.ApplicationClassloader.getAllClasses(ApplicationClassloader.java:445) at play.Play.start(Play.java:527) at play.Play.detectChanges(Play.java:653) at play.Invoker$Invocation.init(Invoker.java:198) at play.server.PlayHandler$NettyInvocation.init(PlayHandler.java:196) at play.Invoker$Invocation.run(Invoker.java:287) at play.server.PlayHandler$NettyInvocation.run(PlayHandler.java:236) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

  • Cheong Chung Onn

    Cheong Chung Onn September 22nd, 2014 @ 10:01 AM

    Hi,

    I attempt to step into Play's LocalvariableNamesEnhancer and here is what I found. The problem seems to be related to StackRecorder. To make the compilation successful, I need to comment out part of the code and it does not matter which part of the code is commented out.

    In the LocalvariableNamesEnhancer#enhanceThisClass, when the localVariableAttribute is a '__stackRecorder' attribute, compute max stack in codeAttribute.computeMaxStack() will throw a BadByteCode exception. Below is the output that is emitted from LocalVariableEnhancer during the compilation.

    The problematic controller action is the completeVisitor method is in Output 1. In output 2 (success compilation), the completeVisitor is has the maxStack of 6.

    This problem is consistent on Ubuntu and OSX with Java 8 (build 1.8.0_20-b26).

    Please let me know if you need more information.

    Regards

    chungonn

    Output 1

    Method getKiosk
    Variables - length 7

    • for variable 'kioskId' in slot=0, sig was 'Ljava/lang/Long;' and is now 'Ljava/lang/Object;'
    • var name kioskId index 0 computeMaxStack 5
    • for variable 'kioskFromId' in slot=1, sig was 'Lmodels/queue/KioskStation;' and is now 'Ljava/lang/Object;'
    • var name kioskFromId index 1 computeMaxStack 5
    • for variable 'kiosk' in slot=2, sig was 'Lmodels/queue/KioskStation;' and is now 'Ljava/lang/Object;'
    • var name kiosk index 2 computeMaxStack 5
    • for variable 'kiosk' in slot=2, sig was 'Lmodels/queue/KioskStation;' and is now 'Ljava/lang/Object;'
    • var name kiosk index 2 computeMaxStack 5
    • for variable 'remoteIp' in slot=3, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name remoteIp index 3 computeMaxStack 5
    • for variable 'e' in slot=2, sig was 'Ljava/lang/Exception;' and is now 'Ljava/lang/Object;'
    • var name e index 2 computeMaxStack 5
    • for variable '__stackRecorder' in slot=6, sig was 'Lorg/apache/commons/javaflow/bytecode/StackRecorder;' and is now 'Ljava/lang/Object;'
    • var name __stackRecorder index 6 computeMaxStack 5

    Method completeVisit
    Variables - length 28

    • for variable 'kioskId' in slot=0, sig was 'Ljava/lang/Long;' and is now 'Ljava/lang/Object;'
    • var name kioskId index 0 computeMaxStack 13
    • for variable 'language' in slot=1, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name language index 1 computeMaxStack 13
    • for variable 'idNo' in slot=2, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name idNo index 2 computeMaxStack 13
    • for variable 'explicitServiceType' in slot=3, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name explicitServiceType index 3 computeMaxStack 13
    • for variable 'targetFacilityPrefix' in slot=4, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name targetFacilityPrefix index 4 computeMaxStack 13
    • for variable 'mobileNumber' in slot=5, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name mobileNumber index 5 computeMaxStack 13
    • for variable 'inputInfoType' in slot=6, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name inputInfoType index 6 computeMaxStack 13
    • for variable 'format' in slot=7, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name format index 7 computeMaxStack 13
    • for variable 'kiosk' in slot=8, sig was 'Lmodels/queue/KioskStation;' and is now 'Ljava/lang/Object;'
    • var name kiosk index 8 computeMaxStack 13
    • for variable 'data' in slot=9, sig was 'Lmodels/dto/RequestDTO;' and is now 'Ljava/lang/Object;'
    • var name data index 9 computeMaxStack 13
    • for variable 'qNo' in slot=10, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name qNo index 10 computeMaxStack 13
    • for variable 'isNotFirstTimeScan' in slot=11, sig was 'Z' and is now 'Z'
    • var name isNotFirstTimeScan index 11 computeMaxStack 13
    • for variable 'results' in slot=12, sig was 'Lutils/Results;' and is now 'Ljava/lang/Object;'
    • var name results index 12 computeMaxStack 13
    • for variable 'visit' in slot=13, sig was 'Lmodels/queue/Visit;' and is now 'Ljava/lang/Object;'
    • var name visit index 13 computeMaxStack 13
    • for variable 'completedAppts' in slot=14, sig was 'Ljava/util/List;' and is now 'Ljava/lang/Object;'
    • var name completedAppts index 14 computeMaxStack 13
    • for variable 'otherAppts' in slot=15, sig was 'Ljava/util/List;' and is now 'Ljava/lang/Object;'
    • var name otherAppts index 15 computeMaxStack 13
    • for variable 'appointments' in slot=16, sig was 'Ljava/util/List;' and is now 'Ljava/lang/Object;'
    • var name appointments index 16 computeMaxStack 13
    • for variable 'screen' in slot=17, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name screen index 17 computeMaxStack 13
    • for variable 'screen' in slot=17, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • for variable 'msgs' in slot=18, sig was '[Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name msgs index 18 computeMaxStack 13
    • for variable 'msgs' in slot=18, sig was '[Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • for variable 'msgs' in slot=18, sig was '[Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • for variable 'printNewTicket' in slot=19, sig was 'Z' and is now 'Z'
    • var name printNewTicket index 19 computeMaxStack 13
    • for variable 'pageTitle' in slot=20, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name pageTitle index 20 computeMaxStack 13
    • for variable 'task' in slot=19, sig was 'Lmodels/task/SmsTask;' and is now 'Ljava/lang/Object;'
    • var name task index 19 computeMaxStack 13
    • for variable 'aztecData' in slot=19, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name aztecData index 19 computeMaxStack 13
    • for variable 'arrivalDate' in slot=20, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name arrivalDate index 20 computeMaxStack 13
    • for variable 'arrivalTime' in slot=21, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name arrivalTime index 21 computeMaxStack 13
    • for variable 'printNewTicket' in slot=22, sig was 'Z' and is now 'Z'
    • var name printNewTicket index 22 computeMaxStack 13
    • for variable 'pageTitle' in slot=23, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name pageTitle index 23 computeMaxStack 13
    • for variable '__stackRecorder' in slot=26, sig was 'Lorg/apache/commons/javaflow/bytecode/StackRecorder;' and is now 'Ljava/lang/Object;' [22 Sep 2014 17:06:16] ERROR [play] -

    @6jikppp4m Internal Server Error (500) for request GET /doctor/login

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

    play.exceptions.UnexpectedException: While applying play.CorePlugin@693fe6c9 on controllers.KioskConsole
    at play.plugins.PluginCollection.enhance(PluginCollection.java:556) at play.classloading.ApplicationClasses$ApplicationClass.enhance(ApplicationClasses.java:240) at play.classloading.ApplicationClassloader.loadApplicationClass(ApplicationClassloader.java:169) at play.classloading.ApplicationClassloader.loadClass(ApplicationClassloader.java:86) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:760) at play.classloading.ApplicationClassloader.loadApplicationClass(ApplicationClassloader.java:170) at play.classloading.ApplicationClassloader.getAllClasses(ApplicationClassloader.java:445) at play.Play.start(Play.java:527) at play.Play.detectChanges(Play.java:653) 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.KioskConsole
    at play.CorePlugin.enhance(CorePlugin.java:302) at play.plugins.PluginCollection.enhance(PluginCollection.java:551) ... 12 more Caused by: javassist.CannotCompileException: by javassist.bytecode.BadBytecode: completeVisit (Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V in controllers.KioskConsole: conflict: top and java.lang.String
    at javassist.CtBehavior.insertBefore(CtBehavior.java:777) at javassist.CtBehavior.insertBefore(CtBehavior.java:734) at play.classloading.enhancers.LocalvariablesNamesEnhancer.enhanceThisClass(LocalvariablesNamesEnhancer.java:274) at play.CorePlugin.enhance(CorePlugin.java:297) ... 13 more Caused by: javassist.bytecode.BadBytecode: completeVisit (Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V in controllers.KioskConsole: conflict: top and java.lang.String
    at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:111) at javassist.bytecode.MethodInfo.rebuildStackMap(MethodInfo.java:423) at javassist.bytecode.MethodInfo.rebuildStackMapIf6(MethodInfo.java:405) at javassist.CtBehavior.insertBefore(CtBehavior.java:768) ... 16 more Caused by: javassist.bytecode.BadBytecode: conflict: top and java.lang.String
    at javassist.bytecode.stackmap.TypeData$BasicType.setType(TypeData.java:134) at javassist.bytecode.stackmap.Tracer.checkParamTypes(Tracer.java:930) at javassist.bytecode.stackmap.Tracer.doInvokeMethod(Tracer.java:801) at javassist.bytecode.stackmap.Tracer.doOpcode148_201(Tracer.java:597) at javassist.bytecode.stackmap.Tracer.doOpcode(Tracer.java:81) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:187) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:199) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:164) at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:108) ... 19 more

    Output 2

    Method getKiosk
    Variables - length 7

    • for variable 'kioskId' in slot=0, sig was 'Ljava/lang/Long;' and is now 'Ljava/lang/Object;'
    • var name kioskId index 0 computeMaxStack 5
    • for variable 'kioskFromId' in slot=1, sig was 'Lmodels/queue/KioskStation;' and is now 'Ljava/lang/Object;'
    • var name kioskFromId index 1 computeMaxStack 5
    • for variable 'kiosk' in slot=2, sig was 'Lmodels/queue/KioskStation;' and is now 'Ljava/lang/Object;'
    • var name kiosk index 2 computeMaxStack 5
    • for variable 'kiosk' in slot=2, sig was 'Lmodels/queue/KioskStation;' and is now 'Ljava/lang/Object;'
    • var name kiosk index 2 computeMaxStack 5
    • for variable 'remoteIp' in slot=3, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name remoteIp index 3 computeMaxStack 5
    • for variable 'e' in slot=2, sig was 'Ljava/lang/Exception;' and is now 'Ljava/lang/Object;'
    • var name e index 2 computeMaxStack 5
    • for variable '__stackRecorder' in slot=6, sig was 'Lorg/apache/commons/javaflow/bytecode/StackRecorder;' and is now 'Ljava/lang/Object;'
    • var name __stackRecorder index 6 computeMaxStack 5

    Method completeVisit
    Variables - length 26

    • for variable 'kioskId' in slot=0, sig was 'Ljava/lang/Long;' and is now 'Ljava/lang/Object;'
    • var name kioskId index 0 computeMaxStack 6
    • for variable 'language' in slot=1, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name language index 1 computeMaxStack 6
    • for variable 'idNo' in slot=2, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name idNo index 2 computeMaxStack 6
    • for variable 'explicitServiceType' in slot=3, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name explicitServiceType index 3 computeMaxStack 6
    • for variable 'targetFacilityPrefix' in slot=4, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name targetFacilityPrefix index 4 computeMaxStack 6
    • for variable 'mobileNumber' in slot=5, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name mobileNumber index 5 computeMaxStack 6
    • for variable 'inputInfoType' in slot=6, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name inputInfoType index 6 computeMaxStack 6
    • for variable 'format' in slot=7, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name format index 7 computeMaxStack 6
    • for variable 'kiosk' in slot=8, sig was 'Lmodels/queue/KioskStation;' and is now 'Ljava/lang/Object;'
    • var name kiosk index 8 computeMaxStack 6
    • for variable 'data' in slot=9, sig was 'Lmodels/dto/RequestDTO;' and is now 'Ljava/lang/Object;'
    • var name data index 9 computeMaxStack 6
    • for variable 'qNo' in slot=10, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name qNo index 10 computeMaxStack 6
    • for variable 'isNotFirstTimeScan' in slot=11, sig was 'Z' and is now 'Z'
    • var name isNotFirstTimeScan index 11 computeMaxStack 6
    • for variable 'results' in slot=12, sig was 'Lutils/Results;' and is now 'Ljava/lang/Object;'
    • var name results index 12 computeMaxStack 6
    • for variable 'visit' in slot=13, sig was 'Lmodels/queue/Visit;' and is now 'Ljava/lang/Object;'
    • var name visit index 13 computeMaxStack 6
    • for variable 'completedAppts' in slot=14, sig was 'Ljava/util/List;' and is now 'Ljava/lang/Object;'
    • var name completedAppts index 14 computeMaxStack 6
    • for variable 'otherAppts' in slot=15, sig was 'Ljava/util/List;' and is now 'Ljava/lang/Object;'
    • var name otherAppts index 15 computeMaxStack 6
    • for variable 'appointments' in slot=16, sig was 'Ljava/util/List;' and is now 'Ljava/lang/Object;'
    • var name appointments index 16 computeMaxStack 6
    • for variable 'screen' in slot=17, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name screen index 17 computeMaxStack 6
    • for variable 'screen' in slot=17, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • for variable 'msgs' in slot=18, sig was '[Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name msgs index 18 computeMaxStack 6
    • for variable 'msgs' in slot=18, sig was '[Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • for variable 'msgs' in slot=18, sig was '[Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • for variable 'printNewTicket' in slot=19, sig was 'Z' and is now 'Z'
    • var name printNewTicket index 19 computeMaxStack 6
    • for variable 'pageTitle' in slot=20, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name pageTitle index 20 computeMaxStack 6
    • for variable 'task' in slot=19, sig was 'Lmodels/task/SmsTask;' and is now 'Ljava/lang/Object;'
    • var name task index 19 computeMaxStack 6
    • for variable 'aztecData' in slot=19, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name aztecData index 19 computeMaxStack 6
    • for variable 'printNewTicket' in slot=20, sig was 'Z' and is now 'Z'
    • var name printNewTicket index 20 computeMaxStack 6
    • for variable 'pageTitle' in slot=21, sig was 'Ljava/lang/String;' and is now 'Ljava/lang/Object;'
    • var name pageTitle index 21 computeMaxStack 6
    • for variable '__stackRecorder' in slot=24, sig was 'Lorg/apache/commons/javaflow/bytecode/StackRecorder;' and is now 'Ljava/lang/Object;'
    • var name __stackRecorder index 24 computeMaxStack 6
  • Cheong Chung Onn

    Cheong Chung Onn September 23rd, 2014 @ 07:03 AM

    I have refactored my code for the the affected controllers. And my code successfully compiles with Play 1.3 RC 1 now. Essentially I refactor into smaller size methods for all the controllers actions that cause the LocalvariableNamesEnhancer to choke. Good to note that these affect controller actions code size ranges from 80 - 270 LOC including comments of course.

  • William

    William August 13th, 2017 @ 08:51 PM

    Sorry, I can’t help you in this matter because I don’t have much information about rushessay writing service review problem. But this would be really nice to know the solution. Because may be in the future if I would face the same difficulty then the solution will be supportive for me as well.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2>Play framework</h2>

Play makes it easier to build Web applications with Java. It is a clean alternative to bloated Enterprise Java stacks. It focuses on developer productivity and targets RESTful architectures. Learn more on the <a href="http://www.playframework.org">http://www.playframework.org</a> website.<br><br>

<h2>Source code is hosted on github</h2>Check out our repository at <a href="http://github.com/playframework/play">http://github.com/playframework/play</a><br><br>

<h2>Contributing, creating a patch</h2> Please read the <a href="http://play.lighthouseapp.com/projects/57987/contributor-guide">contributor guide</a><br><br>

<h2>Reporting Security Vulnerabilities</h2> Since all bug reports are public, please report any security vulnerability directly to <em>guillaume dot bort at gmail dot com</em>.<br><br>

<h2>Creating a bug report</h2> Bug reports are incredibly helpful, so take time to report bugs and request features in our ticket tracker. We’re always grateful for patches to Play’s code. Indeed, bug reports with attached patches will get fixed far quickly than those without any.<br><br>

Please include as much relevant information as possible including the exact framework version you're using and a code snippet that reproduces the problem.<br><br>

Don't have too much expectations. Unless the bug is really a serious "everything is broken" thing, you're creating a ticket to start a discussion. Having a patch (or a branch on Github we can pull from) is better, but then again we'll only pull high quality branches that make sense to be in the core of Play.

Referenced by

Pages