Comments (9)
Please check out the argument types in your template code. You should provide right key and form types in the template as in this sample.
from play2-crud.
Yes, I am using
@(key: Long, simpleForm: Form[Voeding])
and Voeding is a model
It also only happens when I go to the edit page, the create page works fine.
from play2-crud.
Please turn DEBUG logging for "play.utils.crud" package on and paste detailed logs here.
from play2-crud.
[info] play - database [default] connected at jdbc:h2:db/development
[debug] p.u.c.CRUDManager - initialize <-
[info] p.u.m.c.ClasspathScanningConverterRegistry - Converter:class java.lang.Integer : play.utils.meta.convert.IntegerConverter@47de2fa7
[info] p.u.m.c.ClasspathScanningConverterRegistry - Converter:class java.lang.Double : play.utils.meta.convert.DoubleConverter@6aa3821a
[info] p.u.m.c.ClasspathScanningConverterRegistry - Converter:class java.lang.Long : play.utils.meta.convert.LongConverter@12300a7b
[info] play - Application started (Dev)
[debug] p.u.c.RouterCrudController - editForm <- Voeding, 1
[debug] p.u.c.CRUDController - editForm() <-1
[debug] p.u.c.CRUDController - model : Simple [key=1, name=qsddqs]
[error] play - Cannot invoke the action, eventually got an error: java.lang.IllegalArgumentException: argument type mismatch
[error] application -
! @6i7a7k6gh - Internal server error, for (GET) [/app/Voeding/1/edit] ->
play.api.Application$$anon$1: Execution exception[[IllegalArgumentException: argument type mismatch]]
at play.api.Application$class.handleError(Application.scala:293) ~[na:na]
at play.api.DefaultApplication.handleError(Application.scala:399) [na:na]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$2$$anonfun$applyOrElse$3.apply(PlayDefaultUpstreamHandler.scala:261) [na:na]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$2$$anonfun$applyOrElse$3.apply(PlayDefaultUpstreamHandler.scala:261) [na:na]
at scala.Option.map(Option.scala:145) [na:na]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$2.applyOrElse(PlayDefaultUpstreamHandler.scala:261) [na:na]
Caused by: java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_05]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_05]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_05]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_05]
at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:191) ~[na:na]
at play.utils.crud.TemplateController.call(TemplateController.java:97) ~[na:na]
I think I have noticed the error
[debug] p.u.c.CRUDController - model : Simple [key=1, name=qsddqs]
But I am not sure how I could fix this?
from play2-crud.
:) Search for "Simple" in your code and replace with "Voeding". It's probably in your Controller class but may be more.
from play2-crud.
Yeah my controller class is just
package controllers;
import play.mvc.Controller;
import play.mvc.Result;
import play.api.i18n.*;
public class Application extends Controller {
public static Result index() {
return ok(views.html.index.render());
}
public static Result changeLanguage(String langCode) {
changeLang(langCode);
return ok(views.html.index.render());
}
}
routes is just
# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~
# Home page
# Home page
GET / controllers.Application.index()
GET /language controllers.Application.changeLanguage(lang ?= "en")
# CRUD Controllers
-> /app play.crud.Routes
# REST API
-> /api play.rest.Routes
#Assets
GET /assets/*file controllers.Assets.at(path="/public", file)
For the rest, I can't find Simple anywhere.
from play2-crud.
Any other occurences of "Simple"? What about DAOs?
from play2-crud.
I don't think I have ever defined a DAO, also I have just refreshed and now I just get
[info] play - database [default] connected at jdbc:h2:db/development
[debug] p.u.c.CRUDManager - initialize <-
[info] p.u.m.c.ClasspathScanningConverterRegistry - Converter:class java.lang.Integer : play.utils.meta.convert.IntegerConverter@188f72bf
[info] p.u.m.c.ClasspathScanningConverterRegistry - Converter:class java.lang.Double : play.utils.meta.convert.DoubleConverter@79c64afd
[info] p.u.m.c.ClasspathScanningConverterRegistry - Converter:class java.lang.Long : play.utils.meta.convert.LongConverter@44d5aba3
[info] play - Application started (Dev)
[debug] p.u.c.RouterCrudController - editForm <- Voeding, 1
[debug] p.u.c.CRUDController - editForm() <-1
[debug] p.u.c.CRUDController - model : Voeding [key=1, name=qsddqs]
[error] play - Cannot invoke the action, eventually got an error: java.lang.IllegalArgumentException: argument type mismatch
[error] application -
! @6i7aakn1p - Internal server error, for (GET) [/app/Voeding/1/edit] ->
play.api.Application$$anon$1: Execution exception[[IllegalArgumentException: argument type mismatch]]
at play.api.Application$class.handleError(Application.scala:293) ~[na:na]
at play.api.DefaultApplication.handleError(Application.scala:399) [na:na]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$2$$anonfun$applyOrElse$3.apply(PlayDefaultUpstreamHandler.scala:261) [na:na]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$2$$anonfun$applyOrElse$3.apply(PlayDefaultUpstreamHandler.scala:261) [na:na]
at scala.Option.map(Option.scala:145) [na:na]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$2.applyOrElse(PlayDefaultUpstreamHandler.scala:261) [na:na]
Caused by: java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_05]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_05]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_05]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_05]
at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:191) ~[na:na]
at play.utils.crud.TemplateController.call(TemplateController.java:97) ~[na:na]
As you can see
[debug] p.u.c.CRUDController - model : Voeding [key=1, name=qsddqs]
is now reporting the correct model
from play2-crud.
Can you please fork the project and add your problem sample as a separate sample project under samples folder so I can have a closer look.
from play2-crud.
Related Issues (20)
- Custom pages HOT 2
- Guice configuration errors: Could not find suitable constructor in controllers HOT 5
- Update HOT 3
- Not working with 2.3 HOT 3
- value RouterCrudController is not a member HOT 6
- GlobalCRUDSettings onStart is not working HOT 3
- Guice warning while extending CRUDController HOT 1
- Wrong Parameter type for the editForm method HOT 3
- Unresolved dependency error HOT 9
- generate a select tag? HOT 1
- Multiple database servers support HOT 1
- Project status? HOT 2
- Extension for Twixt HOT 3
- CRUDControllers in a module fail to render HOT 4
- NumberFormatException: null when using the create REST API controller
- Problem run-time with Java 6 HOT 1
- java.lang.NullPointerException when attempting to edit entity HOT 1
- Can not get play2-crud working with Play 2.5.1 + Scala 2.11.7 HOT 1
- DepShield Deprecation Notice
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from play2-crud.