Data binding and grails

Hi there,

I am evaluating vaadin to develop a new project by using grails.
I have my domain Item:

[i]
[size=2]
package com.geape

class Item {

String name
String description

static constraints = {
}

}
[/size]
[/i]

I have no problem to show the item list in a table with the following code:
[i]
[size=2]
BeanItemContainer<com.geape.Item> container = new BeanItemContainer<com.geape.Item>(com.geape.Item.class, Grails.get(com.geape.ItemService).list());

        // table to hold the detail form rows
        def table = new Table()
        table.containerDataSource = container
        table.selectable = true
        table.editable = false
        table.setSizeFull()
        table.visibleColumns = ["id","name", "description"]

        table.immediate = true

[/size]
[/i]

The result is fine (see capture.png).

I am trying to build a form to edit each item with the following code:
[size=2]
[i]
Form form = new Form();

    // Set form caption and description texts
    
    form.setCaption("Item Form");
    form.setDescription("Item Settings");
    
    // Create an instance of the bean
    com.geape.Item bean = new com.geape.Item();
            
    // Wrap it in a BeanItem
    BeanItem<com.geape.Item> item = new BeanItem<com.geape.Item>(bean);
   [b]

form.itemDataSource=item
[/b]

    layout.addComponent(table)    
    layout.addComponent(form)

[/i]



I get the following error…

[i]
HTTP Status 500 - com.vaadin.server.ServiceException: com.vaadin.data.Buffered$SourceException

type Exception report

message com.vaadin.server.ServiceException: com.vaadin.data.Buffered$SourceException

description The server encountered an internal error that prevented it from fulfilling this request.

exceptionjavax.servlet.ServletException: com.vaadin.server.ServiceException: com.vaadin.data.Buffered$SourceException com.vaadin.server.VaadinServlet.service(VaadinServlet.java:240) com.vaadin.grails.GrailsVaadinServlet.service(GrailsVaadinServlet.groovy) javax.servlet.http.HttpServlet.service(HttpServlet.java:728) com.vaadin.grails.GrailsVaadinServlet.service(GrailsVaadinServlet.groovy) org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.processFilterChain(UrlMappingsFilter.java:394) org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.doFilterInternal(UrlMappingsFilter.java:235) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.obtainContent(GrailsPageFilter.java:206) org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.doFilter(GrailsPageFilter.java:152) javax.servlet.FilterChain$doFilter.call(Unknown Source) org.grails.plugin.resource.DevModeSanityFilter.doFilter(DevModeSanityFilter.groovy:45) org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:69) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.codehaus.groovy.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:67) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)root causecom.vaadin.server.ServiceException: com.vaadin.data.Buffered$SourceException com.vaadin.server.VaadinService.handleExceptionDuringRequest(VaadinService.java:1440) com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1394) com.vaadin.grails.GrailsVaadinServletService.handleRequest(GrailsVaadinServletService.groovy) com.vaadin.server.VaadinServlet.service(VaadinServlet.java:238) com.vaadin.grails.GrailsVaadinServlet.service(GrailsVaadinServlet.groovy) javax.servlet.http.HttpServlet.service(HttpServlet.java:728) com.vaadin.grails.GrailsVaadinServlet.service(GrailsVaadinServlet.groovy) org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.processFilterChain(UrlMappingsFilter.java:394) org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.doFilterInternal(UrlMappingsFilter.java:235) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.obtainContent(GrailsPageFilter.java:206) org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.doFilter(GrailsPageFilter.java:152) javax.servlet.FilterChain$doFilter.call(Unknown Source) org.grails.plugin.resource.DevModeSanityFilter.doFilter(DevModeSanityFilter.groovy:45) org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:69) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.codehaus.groovy.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:67) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343) org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)root causecom.vaadin.data.Buffered$SourceException com.vaadin.ui.AbstractField.setPropertyDataSource(AbstractField.java:637) com.vaadin.ui.Form.bindPropertyToField(Form.java:763) com.vaadin.ui.Form.setItemDataSource(Form.java:734) com.vaadin.ui.Form.setItemDataSource(Form.java:682) app.MyUI.init(MyUI.groovy:136) com.vaadin.ui.UI.doInit(UI.java:614) com.vaadin.server.communication.UIInitHandler.getBrowserDetailsUI(UIInitHandler.java:223) com.vaadin.server.communication.UIInitHandler.synchronizedHandleRequest(UIInitHandler.java:73) com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:37) com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1382) com.vaadin.server.VaadinServlet.service(VaadinServlet.java:238) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) java.lang.Thread.run(Thread.java:744)root causecom.vaadin.data.util.MethodProperty$MethodException com.vaadin.data.util.MethodProperty.getValue(MethodProperty.java:610) com.vaadin.ui.AbstractField.getDataSourceValue(AbstractField.java:299) com.vaadin.ui.AbstractField.setPropertyDataSource(AbstractField.java:629) com.vaadin.ui.Form.bindPropertyToField(Form.java:763) com.vaadin.ui.Form.setItemDataSource(Form.java:734) com.vaadin.ui.Form.setItemDataSource(Form.java:682) app.MyUI.init(MyUI.groovy:136) com.vaadin.ui.UI.doInit(UI.java:614) com.vaadin.server.communication.UIInitHandler.getBrowserDetailsUI(UIInitHandler.java:223) com.vaadin.server.communication.UIInitHandler.synchronizedHandleRequest(UIInitHandler.java:73) com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:37) com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1382) com.vaadin.server.VaadinServlet.service(VaadinServlet.java:238) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) java.lang.Thread.run(Thread.java:744)root causejava.lang.reflect.InvocationTargetException com.vaadin.data.util.MethodProperty.getValue(MethodProperty.java:608) com.vaadin.ui.AbstractField.getDataSourceValue(AbstractField.java:299) com.vaadin.ui.AbstractField.setPropertyDataSource(AbstractField.java:629) com.vaadin.ui.Form.bindPropertyToField(Form.java:763) com.vaadin.ui.Form.setItemDataSource(Form.java:734) com.vaadin.ui.Form.setItemDataSource(Form.java:682) app.MyUI.init(MyUI.groovy:136) com.vaadin.ui.UI.doInit(UI.java:614) com.vaadin.server.communication.UIInitHandler.getBrowserDetailsUI(UIInitHandler.java:223) com.vaadin.server.communication.UIInitHandler.synchronizedHandleRequest(UIInitHandler.java:73) com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:37) com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1382) com.vaadin.server.VaadinServlet.service(VaadinServlet.java:238) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) java.lang.Thread.run(Thread.java:744)root causeorg.hibernate.HibernateException:
No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here com.vaadin.data.util.MethodProperty.getValue(MethodProperty.java:608)
com.vaadin.ui.AbstractField.getDataSourceValue(AbstractField.java:299) com.vaadin.ui.AbstractField.setPropertyDataSource(AbstractField.java:629) com.vaadin.ui.Form.bindPropertyToField(Form.java:763) com.vaadin.ui.Form.setItemDataSource(Form.java:734) com.vaadin.ui.Form.setItemDataSource(Form.java:682) app.MyUI.init(MyUI.groovy:136) com.vaadin.ui.UI.doInit(UI.java:614) com.vaadin.server.communication.UIInitHandler.getBrowserDetailsUI(UIInitHandler.java:223) com.vaadin.server.communication.UIInitHandler.synchronizedHandleRequest(UIInitHandler.java:73) com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:37) com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1382) com.vaadin.server.VaadinServlet.service(VaadinServlet.java:238) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) java.lang.Thread.run(Thread.java:744)note The full stack trace of the root cause is available in the Apache Tomcat/7.0.42 logs.
[/i]
[/size]

Any hint?

Thanks for your help
15229.png