well, here goes my first patch to play ;-))))
https://github.com/playframework/play/pull/45#files_bucket
BTW, at first I configured just-test-cases project to work with play
source code (I removed play.jar and added the reference to the
project), it worked fine a couple of times but then the project
wouldn't start on first request... with this error:
Internal Error (check logs)
[...]
10:09:34,369 TRACE ~ 0ms to apply play.db.DBPlugin@13c6a22 to
models.threeLevels.Address
10:09:34,490 TRACE ~ 120ms to apply play.db.jpa.JPAPlugin@165a3c2 to
models.threeLevels.Address
10:09:34,504 TRACE ~ serve500: begin
10:09:34,549 TRACE ~ 43ms to load template /app/views/errors/500.html
from cache
10:09:34,639 ERROR ~
@64j6ckbnj
Internal Server Error (500) for request GET /favicon.ico
Oops: DuplicateMemberException
An unexpected error occured caused by exception
DuplicateMemberException: duplicate method: count in
models.threeLevels.Address
play.exceptions.UnexpectedException: While applying
play.db.jpa.JPAPlugin@15c07d8 on models.threeLevels.Address
at play.classloading.ApplicationClasses
$ApplicationClass.enhance(ApplicationClasses.java:215)
at
play.classloading.ApplicationClassloader.loadApplicationClass(ApplicationClassloader.java:
142)
at
play.classloading.ApplicationClassloader.getAllClasses(ApplicationClassloader.java:
423)
at play.Play.start(Play.java:418)
at play.Play.detectChanges(Play.java:532)
at play.Invoker$Invocation.init(Invoker.java:164)
at Invocation.HTTP Request(Play!)
Caused by: javassist.bytecode.DuplicateMemberException: duplicate
method: count in models.threeLevels.Address
at javassist.bytecode.ClassFile.testExistingMethod(ClassFile.java:
593)
at javassist.bytecode.ClassFile.addMethod(ClassFile.java:577)
at javassist.CtClassType.addMethod(CtClassType.java:1235)
at play.db.jpa.JPAEnhancer.enhanceThisClass(JPAEnhancer.java:51)
at play.db.jpa.JPAPlugin.enhance(JPAPlugin.java:95)
at play.classloading.ApplicationClasses
$ApplicationClass.enhance(ApplicationClasses.java:212)
... 6 more
10:09:34,640 ERROR ~
@64j6ckbnm
Error during the 500 response generation
Template not found (In /app/views/errors/500.html around line 9)
The template tags/500.html or tags/500.tag does not exist.
play.exceptions.TemplateNotFoundException: Template not found : tags/
500.html or tags/500.tag
at play.templates.GroovyTemplate
$ExecutableTemplate.invokeTag(GroovyTemplate.java:308)
at /app/views/errors/500.html.(line:9)
at play.templates.GroovyTemplate.render(GroovyTemplate.java:203)
at play.server.PlayHandler.serve500(PlayHandler.java:602)
at Invocation.HTTP Request(Play!)
10:09:34,667 TRACE ~ serve500: end
10:09:34,668 TRACE ~ run: end
any idea???
So I just work with the play.jar, and added the ant task from the Run,
External Tools menu on Eclipse...
saludos
sas
> >> > Annotation[] annotations,Map<String, String[]> params) {
>
> >> > if (clazz.getName().equals(Map.class.getName())) {
> >> > return HttpUtils.filterParam(name, params);
> >> > }
> >> > return null;
> >> > }
> >> > }
>
> >> > --
>
> >> > and then in /conf/play.plugins (create it if it's not there) (wouldn't
> >> > it be better in application.conf???)
>
> >> > 50:lib.plugins.binders.MapBinderPlugin
>
> >> > that's it...
>
> >> > and the filterParam function
>
> >> > package lib.utils;
>
> >> > import java.util.Arrays;
> >> > import java.util.LinkedHashMap;
> >> > import java.util.Map;
>
> >> > import play.mvc.Scope;
> >> > import play.templates.JavaExtensions;
>
> >> > public class HttpUtils {
>
> >> > public staticMap<String, String> filterParam(String name,
> >> >Map<String, String[]> params) {
> >> > Map<String, String>map= new LinkedHashMap<String, String>();
> >> > String prefix = name + ".";
> >> > String key, value;
>
> >> > for(Map.Entry<String, String[]> entry: params.entrySet()) {
> >> > key = entry.getKey().toString();
> >> > if (key.startsWith(prefix)) {
> >> > value = JavaExtensions.join(Arrays.asList(entry.getValue()), ",
> >> > ");
> >> > map.put(key, value);
> >> > }
> >> > }
> >> > returnmap;
> >> > }
>
> >> > public staticMap<String, String> filterParam(String name,
> ...
>
> leer más »