Transaction on JpaContainer

Hi,
I’m using Spring Roo and Hibernate with JpaContainer

I tried to save an EntityItem passed from Table but

I got this error

com.vaadin.data.Property$ConversionException: java.lang.IllegalStateException: Not allowed to create transaction on shared EntityManager - use Spring transactions or EJB CMT instead
	at com.vaadin.addon.jpacontainer.JPAContainerItem$ItemProperty.setValue(JPAContainerItem.java:260)
	at com.vaadin.ui.AbstractField.commit(AbstractField.java:241)
	at com.vaadin.ui.Form.commit(Form.java:339)
	at it.s26.web.component.FormAnagrafiche$2.buttonClick(FormAnagrafiche.java:104)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:490)
	at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
	at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1193)
	at com.vaadin.ui.Button.fireClick(Button.java:525)
	at com.vaadin.ui.Button.changeVariables(Button.java:198)
	at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(AbstractCommunicationManager.java:1297)
	at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1217)
	at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:733)
	at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:296)
	at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:501)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.IllegalStateException: Not allowed to create transaction on shared EntityManager - use Spring transactions or EJB CMT instead
	at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:198)
	at $Proxy197.getTransaction(Unknown Source)
	at com.vaadin.addon.jpacontainer.provider.MutableLocalEntityProvider.runInTransaction(MutableLocalEntityProvider.java:112)
	at com.vaadin.addon.jpacontainer.provider.MutableLocalEntityProvider.updateEntityProperty(MutableLocalEntityProvider.java:198)
	at com.vaadin.addon.jpacontainer.JPAContainer.containerItemPropertyModified(JPAContainer.java:1018)
	at com.vaadin.addon.jpacontainer.JPAContainerItem$ItemProperty.setValue(JPAContainerItem.java:253)
	... 34 more

These are my files;

applicationContext.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd         http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd         http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd         http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd         http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
    <!--
        This will automatically locate any and all property files you have
        within your classpath, provided they fall under the META-INF/spring
        directory. The located property files are parsed and their values can
        then be used within application context files in the form of
        ${propertyKey}.
    -->
    <context:property-placeholder location="classpath*:META-INF/spring/*.properties"/>
    <!--
        Turn on AspectJ @Configurable support. As a result, any time you
        instantiate an object, Spring will attempt to perform dependency
        injection on that object. This occurs for instantiation via the "new"
        keyword, as well as via reflection. This is possible because AspectJ
        is used to "weave" Roo-based applications at compile time. In effect
        this feature allows dependency injection of any object at all in your
        system, which is a very useful feature (without @Configurable you'd
        only be able to dependency inject objects acquired from Spring or
        subsequently presented to a specific Spring dependency injection
        method). Roo applications use this useful feature in a number of
        areas, such as @PersistenceContext injection into entities.
    -->
    <context:spring-configured/>
    <!--
        This declaration will cause Spring to locate every @Component,
        @Repository and @Service in your application. In practical terms this
        allows you to write a POJO and then simply annotate the new POJO as an
        @Service and Spring will automatically detect, instantiate and
        dependency inject your service at startup time. Importantly, you can
        then also have your new service injected into any other class that
        requires it simply by declaring a field for your service inside the
        relying class and Spring will inject it. Note that two exclude filters
        are declared. The first ensures that Spring doesn't spend time
        introspecting Roo-specific ITD aspects. The second ensures Roo doesn't
        instantiate your @Controller classes, as these should be instantiated
        by a web tier application context. Refer to web.xml for more details
        about the web tier application context setup services.
        
        Furthermore, this turns on @Autowired, @PostConstruct etc support. These 
        annotations allow you to use common Spring and Java Enterprise Edition 
        annotations in your classes without needing to do any special configuration. 
        The most commonly used annotation is @Autowired, which instructs Spring to
        dependency inject an object into your class.
    -->
    <context:component-scan base-package="it.s26">
        <context:exclude-filter expression=".*_Roo_.*" type="regex"/>
        <context:exclude-filter expression="org.springframework.stereotype.Controller" type="annotation"/>
    </context:component-scan>
    <bean class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" id="dataSource">
        <property name="driverClassName" value="${database.driverClassName}"/>
        <property name="url" value="${database.url}"/>
        <property name="username" value="${database.username}"/>
        <property name="password" value="${database.password}"/>
        <property name="validationQuery" value="SELECT 1 FROM DUAL"/>
        <property name="testOnBorrow" value="true"/>
    </bean>
    <bean class="org.springframework.orm.jpa.JpaTransactionManager" id="transactionManager">
        <property name="entityManagerFactory" ref="entityManagerFactory"/>
    </bean>
    <tx:annotation-driven mode="aspectj" transaction-manager="transactionManager"/>
    <bean class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" id="entityManagerFactory">
        <property name="dataSource" ref="dataSource"/>
    </bean>
</beans>


persistence.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="persistenceUnit" transaction-type="RESOURCE_LOCAL">
        <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <properties>
            <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>
            <!-- value="create" to build a new database on each run; value="update" to modify an existing database; value="create-drop" means the same as "create" but also drops tables when Hibernate closes; value="validate" makes no changes to the database -->
            <property name="hibernate.hbm2ddl.auto" value="update"/>
            <property name="hibernate.ejb.naming_strategy" value="org.hibernate.cfg.ImprovedNamingStrategy"/>
            <property name="hibernate.connection.charSet" value="UTF-8"/>
            <property name="hibernate.show_sql" value="true"/>
            
            <!-- Uncomment the following two properties for JBoss only -->
            <!-- property name="hibernate.validator.apply_to_ddl" value="false" /-->
            <!-- property name="hibernate.validator.autoregister_listeners" value="false" /-->
        </properties>
    </persistence-unit>
</persistence>


Form



public class FormAnagrafiche extends Form {


			private EntityItem<Anagrafiche> anagItem;
			
	        public FormAnagrafiche(EntityItem<Anagrafiche> anagItem) {

	        		this.anagItem = anagItem;
	        		setImmediate(true);
...
	            // Set up buffering
	            setWriteThrough(false); // we want explicit 'apply'
	            setInvalidCommitted(false); // no invalid values in datamodel
	            setItemDataSource(this.anagItem); // bind to POJO 
...
	            Button apply = new Button("Save", new Button.ClickListener() {
	                public void buttonClick(ClickEvent event) {
	                		try {
	                			validate();
	                			commit();
        		            } catch (InvalidValueException invException) {
        		                logger.log(Level.SEVERE, "Trade contains invalid values: " + invException.getMessage());
        		            } catch (SourceException srcException) {
        		                logger.log(Level.SEVERE,"Error committing changes to trade: " + srcException.getMessage());
        		            }
        		            
	                }
...

Where is the error?

Thanks