问题
Play framework 1.2.x starts with the following error:
Oops: UnexpectedException
An unexpected error occured caused by exception UnexpectedException: While applying class play.classloading.enhancers.ContinuationEnhancer on helpers.CheatSheetHelper$2
play.exceptions.UnexpectedException: While applying play.CorePlugin@3444d69d on helpers.CheatSheetHelper$2
at play.plugins.PluginCollection.enhance(PluginCollection.java:556)
at play.classloading.ApplicationClasses$ApplicationClass.enhance(ApplicationClasses.java:235)
at play.classloading.ApplicationClassloader.loadApplicationClass(ApplicationClassloader.java:167)
at play.classloading.ApplicationClassloader.getAllClasses(ApplicationClassloader.java:431)
at play.Play.preCompile(Play.java:600)
at play.Play.init(Play.java:304)
at play.server.Server.main(Server.java:162)
Caused by: play.exceptions.UnexpectedException: While applying class play.classloading.enhancers.ContinuationEnhancer on helpers.CheatSheetHelper$2
at play.CorePlugin.enhance(CorePlugin.java:302)
at play.plugins.PluginCollection.enhance(PluginCollection.java:551)
... 6 more
Caused by: java.lang.RuntimeException: java.io.IOException: invalid constant type: 15
at javassist.CtClassType.getClassFile2(CtClassType.java:203)
at javassist.CtClassType.subtypeOf(CtClassType.java:303)
at javassist.CtClassType.subtypeOf(CtClassType.java:318)
at play.classloading.enhancers.ContinuationEnhancer.enhanceThisClass(ContinuationEnhancer.java:49)
at play.CorePlugin.enhance(CorePlugin.java:297)
... 7 more
Caused by: java.io.IOException: invalid constant type: 15
at javassist.bytecode.ConstPool.readOne(ConstPool.java:1027)
at javassist.bytecode.ConstPool.read(ConstPool.java:970)
at javassist.bytecode.ConstPool.<init>(ConstPool.java:127)
at javassist.bytecode.ClassFile.read(ClassFile.java:693)
at javassist.bytecode.ClassFile.<init>(ClassFile.java:85)
at javassist.CtClassType.getClassFile2(CtClassType.java:190)
... 11 more
回答1:
Play 1.2.5 comes with Javassist 3.9.0 that doesn't fully understand bytecode generated by JDK 8 compiler. Either compile with JDK 7 or upgrade the Javassist library under play/lib/framework/ to Javassist 3.18.0 for example.
回答2:
This can be related to the jdk used to run play. If you use a java8 jdk you probably want to try java7 instead. This solved the Problem for me.
来源:https://stackoverflow.com/questions/20453745/play-1-2-x-unexpectedexception-continuationenhancer-on-helpers-cheatsheethelper