subchen / jetbrick-template-2x

Template Engine for Java
http://subchen.github.io/jetbrick-template/
Other
388 stars 99 forks source link

在websphere上报错,帮忙分析一下,谢谢! #33

Closed icevb6 closed 6 years ago

icevb6 commented 8 years ago

[16-11-13 20:57:42:031 CST] 0000012b servlet E com.ibm.ws.webcontainer.servlet.ServletWrapper service Uncaught service() exception thrown by servlet dispatcherServlet: java.lang.IllegalAccessError: sun.reflect.MagicAccessorImpl at java.lang.ClassLoader.defineClassImpl(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:262) at jetbrick.bean.asm.AsmClassLoader.defineClass(AsmClassLoader.java:69) at jetbrick.bean.asm.AsmFactory.generateAccessor(AsmFactory.java:66) at jetbrick.bean.KlassInfo.getAsmAccessor(KlassInfo.java:493) at jetbrick.bean.FieldInfo.get(FieldInfo.java:127) at jetbrick.template.parser.ast.AstText$Jdk6CharArrayEncoder.(AstText.java:276) at jetbrick.template.parser.ast.AstText.execute(AstText.java:214) at jetbrick.template.parser.ast.AstStatementList.execute(AstStatementList.java:212) at jetbrick.template.parser.ast.AstDirectiveIf.execute(AstDirectiveIf.java:43) at jetbrick.template.parser.ast.AstStatementList.execute(AstStatementList.java:212) at jetbrick.template.parser.ast.AstTemplate.execute(AstTemplate.java:37) at jetbrick.template.runtime.InterpretContextImpl.doIncludeCall(InterpretContextImpl.java:132) at jetbrick.template.parser.ast.AstDirectiveInclude.execute(AstDirectiveInclude.java:67) at jetbrick.template.parser.ast.AstStatementList.execute(AstStatementList.java:212) at jetbrick.template.parser.ast.AstTemplate.execute(AstTemplate.java:37) at jetbrick.template.JetTemplateImpl.doInterpret(JetTemplateImpl.java:160) at jetbrick.template.JetTemplateImpl.render(JetTemplateImpl.java:141)

是什么原因导致?asm3.1

subchen commented 8 years ago

你在 websphere 上应该用的是 IBM J9 虚拟机吧? 看上去是ASM反射增强代码用到了 Sun 的部分代码,导致不兼容。

你可以增加下面的代码,把相关的ASM反射增强功能关闭,使用默认的反射功能。

jetbrick.bean.asm.AsmFactory.setThreshold(Integer.MAX_VALUE);
icevb6 commented 8 years ago

大写佩服!