Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@Embedded List<Long> fails to save #4

Open
carchrae opened this issue Sep 19, 2011 · 2 comments
Open

@Embedded List<Long> fails to save #4

carchrae opened this issue Sep 19, 2011 · 2 comments
Assignees

Comments

@carchrae
Copy link

I have something like this in my class
...

@Embedded
List resourceIds;

...

and this exception is thrown when I try to save (using Crud Sienna)

@67ndac4je
Internal Server Error (500) for request GET /admin/resourcegroups/11/
resourceIds/list/add

Oops: SienaException
An unexpected error occured caused by exception SienaException:
java.lang.InstantiationException: java.lang.Long

play.exceptions.UnexpectedException: Unexpected Error
at
play.modules.crudsiena.CrudSienaUtils.addListElement(CrudSienaUtils.java:
48)
at controllers.CRUD.addListElement(CRUD.java:96)
at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:
546)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:500)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:
476)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:
471)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:159)
at Invocation.HTTP Request(Play!)
Caused by: siena.SienaException: java.lang.InstantiationException:
java.lang.Long
at siena.Util.createObjectInstance(Util.java:370)
at
play.modules.crudsiena.CrudSienaUtils.addListElement(CrudSienaUtils.java:
33)
... 7 more
Caused by: java.lang.InstantiationException: java.lang.Long
at java.lang.Class.newInstance0(Class.java:340)
at java.lang.Class.newInstance(Class.java:308)
at siena.Util.createObjectInstance(Util.java:368)
... 8 more

@dwursteisen
Copy link
Contributor

Just for your information : it's not a Siena issue.

In fact, it's seems to be a crud siena issue !

Regarding this file :
https://github.com/mandubian/play-crud-siena/blob/master/src/play/modules/crudsiena/CrudSienaUtils.java

This line can't work with object without no-args constructor (like Long, etc)

Object embedObj = siena.Util.createObjectInstance(embedClass);

@ZiglioUK
Copy link
Collaborator

ZiglioUK commented Nov 1, 2012

Some thoughts regarding embedded collections in Siena:
https://groups.google.com/d/msg/siena-discuss/iuKEZr-cQDU/3oUBoiZS00kJ

@ZiglioUK ZiglioUK self-assigned this Oct 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants