0
votes

I'm getting the error like on https://bugs.launchpad.net/play/+bug/549439. It seems to be an issue with casting an object to a primitive. Is that correct?

I get the error when trying to display a question with its list of answers: <ul> #{list question.answers, as:'answer'} <li>&{answer.content}</li> #{/list} </u1>

I changed to answer.content from answer thinking the issue arose due to casting, but I get the same error.

Here's the stack trace:

Internal Server Error (500) for request GET /showQuestion?qid=1

Execution exception (In /app/controllers/Application.java around line 43) RuntimeException occured : java.lang.OutOfMemoryError: Java heap space

play.exceptions.JavaExecutionException: java.lang.OutOfMemoryError: Java heap space at play.mvc.ActionInvoker.invoke(ActionInvoker.java:231) at Invocation.HTTP Request(Play!) Caused by: java.lang.RuntimeException: java.lang.OutOfMemoryError: Java heap space at play.templates.BaseTemplate.throwException(BaseTemplate.java:93) at play.templates.GroovyTemplate.internalRender(GroovyTemplate.java:257) at play.templates.Template.render(Template.java:26) at play.templates.GroovyTemplate.render(GroovyTemplate.java:187) at play.mvc.results.RenderTemplate.(RenderTemplate.java:24) at play.mvc.Controller.renderTemplate(Controller.java:660) at play.mvc.Controller.renderTemplate(Controller.java:640) at play.mvc.Controller.render(Controller.java:695) at controllers.Application.showQuestion(Application.java:43) at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:548) at play.mvc.ActionInvoker.invoke(ActionInvoker.java:502) at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:478) at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:473) at play.mvc.ActionInvoker.invoke(ActionInvoker.java:161) ... 1 more Caused by: java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:2882) at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100) at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390) at java.lang.StringBuilder.append(StringBuilder.java:119) at play.data.binding.Unbinder.unBind(Unbinder.java:106) at play.data.binding.Unbinder.unBind(Unbinder.java:110)

1

1 Answers

2
votes

No, it's not related to the linked bug, you have a typo in your code. Fix your code to:

... <li>${answer.content}</li> ...

The &{…} syntax is used for fetching translation labels from messages file

BTW Asked you before: try to use tags like playframework-1.x or playframework-2.0 for all questions, it helps a lot for people who wants to help you.