播放中出现 GenericSignatureFormatError! Scala 博客示例
我正在学习 Play 的 Scala 博客引擎教程 (yabe) !框架,我在访问注释时遇到了引用 GenericSignatureFormatError : null
的模板执行错误。具体来说,错误页面显示:
Template execution error
Execution error occured in template /app/views/tags/display.html.
Exception raised was GenericSignatureFormatError : null.
In /app/views/tags/display.html (around line 14)
(14) | ${_arg?.comments.size() ?: 'no'}
This exception has been logged with id 666i6ifgg
来自控制台的堆栈跟踪如下。我可以从 github master (43b195),如下:
% git clone https://github.com/playframework/play-scala.git
% cd play-scala/samples-and-tests/yabe
% play dependencies
~ play! 1.2, http://www.playframework.org
~ Resolving dependencies using /home/league/tmp/play-scala/samples-and-tests/yabe/conf/dependencies.yml,
~ play->scala 0.9 (from playLocalModules)
~ Installing resolved dependencies,
~ modules/scala-0.9 -> /usr/local/stow/play-1.2/share/play-1.2/modules/scala-0.9
~ lib/joda-time-1.6.jar
~ Done!
% play run
~ play! 1.2, http://www.playframework.org
~ Warning: conflict on command scala:console
~ Ctrl+C to stop
Listening for transport dt_socket at address: 8000
10:32:01,076 INFO ~ Starting /home/league/tmp/play-scala/samples-and-tests/yabe
10:32:01,079 WARN ~ Declaring modules in application.conf is deprecated. Use dependencies.yml instead (module.scala)
10:32:01,080 INFO ~ Module scala is available (/home/league/tmp/play-scala/samples-and-tests/yabe/../..)
10:32:01,080 INFO ~ Module scala is available (/usr/local/stow/play-1.2/share/play-1.2/modules/scala-0.9)
10:32:02,515 WARN ~ You're running Play! in DEV mode
10:32:02,591 INFO ~ Listening for HTTP on port 9000 (Waiting a first request to start) ...
然后,加载http://localhost:9000/ 会产生上述错误,控制台输出如下:
@666i6ifgg
Internal Server Error (500) for request GET /
Template execution error (In /app/views/tags/display.html around line 14)
Execution error occured in template /app/views/tags/display.html. Exception raised was GenericSignatureFormatError : null.
play.exceptions.TemplateExecutionException
at play.templates.BaseTemplate.throwException(BaseTemplate.java:84)
at play.templates.GroovyTemplate.internalRender(GroovyTemplate.java:236)
at play.templates.GroovyTemplate$ExecutableTemplate.invokeTag(GroovyTemplate.java:346)
at /app/views/Application/index.html.(line:6)
at play.templates.GroovyTemplate.internalRender(GroovyTemplate.java:213)
at play.templates.Template.render(Template.java:26)
at play.mvc.results.RenderTemplate.<init>(RenderTemplate.java:24)
at play.mvc.Controller.renderTemplate(Controller.java:657)
at play.mvc.ControllerDelegate.renderTemplateForScala(ControllerDelegate.java:46)
at play.mvc.results.Template.<init>(Template.scala:12)
at play.mvc.ScalaController.Template(ScalaController.scala:77)
at controllers.Application$.index(app/controllers.scala:27)
at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:540)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:498)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:492)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:469)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:157)
at Invocation.HTTP Request(Play!)
Caused by: java.lang.reflect.GenericSignatureFormatError
at java.beans.FeatureDescriptor.getParameterTypes(FeatureDescriptor.java:385)
at java.beans.MethodDescriptor.setMethod(MethodDescriptor.java:116)
at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:74)
at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:58)
at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1196)
at java.beans.Introspector.getBeanInfo(Introspector.java:423)
at java.beans.Introspector.getBeanInfo(Introspector.java:189)
at java.beans.Introspector.getBeanInfo(Introspector.java:250)
at java.beans.Introspector.<init>(Introspector.java:404)
at java.beans.Introspector.getBeanInfo(Introspector.java:189)
at java.security.AccessController.doPrivileged(Native Method)
at /app/views/tags/display.html.(line:14)
at play.templates.GroovyTemplate.internalRender(GroovyTemplate.java:213)
... 16 more
I'm working my way through the Scala blog engine tutorial (yabe) for Play! Framework, and I encountered a template execution error that refers to GenericSignatureFormatError : null
when accessing comments. Specifically, the error page says:
Template execution error
Execution error occured in template /app/views/tags/display.html.
Exception raised was GenericSignatureFormatError : null.
In /app/views/tags/display.html (around line 14)
(14) | ${_arg?.comments.size() ?: 'no'}
This exception has been logged with id 666i6ifgg
The stack trace from the console is below. I can reproduce the problem within samples-and-tests/
from the github master (43b195), as follows:
% git clone https://github.com/playframework/play-scala.git
% cd play-scala/samples-and-tests/yabe
% play dependencies
~ play! 1.2, http://www.playframework.org
~ Resolving dependencies using /home/league/tmp/play-scala/samples-and-tests/yabe/conf/dependencies.yml,
~ play->scala 0.9 (from playLocalModules)
~ Installing resolved dependencies,
~ modules/scala-0.9 -> /usr/local/stow/play-1.2/share/play-1.2/modules/scala-0.9
~ lib/joda-time-1.6.jar
~ Done!
% play run
~ play! 1.2, http://www.playframework.org
~ Warning: conflict on command scala:console
~ Ctrl+C to stop
Listening for transport dt_socket at address: 8000
10:32:01,076 INFO ~ Starting /home/league/tmp/play-scala/samples-and-tests/yabe
10:32:01,079 WARN ~ Declaring modules in application.conf is deprecated. Use dependencies.yml instead (module.scala)
10:32:01,080 INFO ~ Module scala is available (/home/league/tmp/play-scala/samples-and-tests/yabe/../..)
10:32:01,080 INFO ~ Module scala is available (/usr/local/stow/play-1.2/share/play-1.2/modules/scala-0.9)
10:32:02,515 WARN ~ You're running Play! in DEV mode
10:32:02,591 INFO ~ Listening for HTTP on port 9000 (Waiting a first request to start) ...
Then, loading http://localhost:9000/ produces the error stated above, with this console output:
@666i6ifgg
Internal Server Error (500) for request GET /
Template execution error (In /app/views/tags/display.html around line 14)
Execution error occured in template /app/views/tags/display.html. Exception raised was GenericSignatureFormatError : null.
play.exceptions.TemplateExecutionException
at play.templates.BaseTemplate.throwException(BaseTemplate.java:84)
at play.templates.GroovyTemplate.internalRender(GroovyTemplate.java:236)
at play.templates.GroovyTemplate$ExecutableTemplate.invokeTag(GroovyTemplate.java:346)
at /app/views/Application/index.html.(line:6)
at play.templates.GroovyTemplate.internalRender(GroovyTemplate.java:213)
at play.templates.Template.render(Template.java:26)
at play.mvc.results.RenderTemplate.<init>(RenderTemplate.java:24)
at play.mvc.Controller.renderTemplate(Controller.java:657)
at play.mvc.ControllerDelegate.renderTemplateForScala(ControllerDelegate.java:46)
at play.mvc.results.Template.<init>(Template.scala:12)
at play.mvc.ScalaController.Template(ScalaController.scala:77)
at controllers.Application$.index(app/controllers.scala:27)
at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:540)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:498)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:492)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:469)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:157)
at Invocation.HTTP Request(Play!)
Caused by: java.lang.reflect.GenericSignatureFormatError
at java.beans.FeatureDescriptor.getParameterTypes(FeatureDescriptor.java:385)
at java.beans.MethodDescriptor.setMethod(MethodDescriptor.java:116)
at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:74)
at java.beans.MethodDescriptor.<init>(MethodDescriptor.java:58)
at java.beans.Introspector.getTargetMethodInfo(Introspector.java:1196)
at java.beans.Introspector.getBeanInfo(Introspector.java:423)
at java.beans.Introspector.getBeanInfo(Introspector.java:189)
at java.beans.Introspector.getBeanInfo(Introspector.java:250)
at java.beans.Introspector.<init>(Introspector.java:404)
at java.beans.Introspector.getBeanInfo(Introspector.java:189)
at java.security.AccessController.doPrivileged(Native Method)
at /app/views/tags/display.html.(line:14)
at play.templates.GroovyTemplate.internalRender(GroovyTemplate.java:213)
... 16 more
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我通过切换到 Sun JDK 解决了这个问题。我没有意识到我的 Ubuntu 被设置为使用 OpenJDK。 安装指南声称任一版本都可以工作。也许这是不真实的,或者也许我运气不好,遇到了与这个版本的 OpenJDK 相关的特定错误。
对于遇到此问题的其他人,
update-java-alternatives -l
显示可用的 JDK;我看到:这些来自 Ubuntu 软件包
使用它来选择:
I was able to work around this problem by switching to the Sun JDK. I didn't realize that my Ubuntu was set to use OpenJDK instead. The installation guide claims that either one should work. Perhaps that is untrue, or perhaps I got unlucky with a particular bug related to this version of OpenJDK.
For anyone else having this problem,
update-java-alternatives -l
shows the available JDKs; I see:These come from the Ubuntu packages
Use this to select:
尝试将其更改为:
这
应该可行。
Try changing this:
to
This should work.