0 Replies Latest reply on Jul 14, 2009 4:33 PM by IVAN BATISTA MORENO

    problem tag convertEntity with Spring and Seam

    IVAN BATISTA MORENO Newbie

      Hi,
      I have problem with tag


      < s:convertEntity/>



      , looking JBoss Sean reference say what must use Seam managed Transactons. I use my managed transaction with spring. not know how do it in components.xml.




      <?xml version="1.0" encoding="UTF-8"?>
      <components xmlns="http://jboss.com/products/seam/components" 
              xmlns:core="http://jboss.com/products/seam/core" 
              xmlns:persistence="http://jboss.com/products/seam/persistence"
              xmlns:security="http://jboss.com/products/seam/security" 
              xmlns:drools="http://jboss.com/products/seam/drools" 
              xmlns:web="http://jboss.com/products/seam/web"
              xmlns:spring="http://jboss.com/products/seam/spring" 
              xmlns:mail="http://jboss.com/products/seam/mail" 
              xmlns:transaction="http://jboss.com/products/seam/transaction"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
              xmlns:ui="http://jboss.com/products/seam/ui"
              xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.1.xsd
              http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.1.xsd
              http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.1.xsd
              http://jboss.com/products/seam/ui http://jboss.com/products/seam/ui-2.1.xsd
              http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.1.xsd
              http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd
              http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.1.xsd
              http://jboss.com/products/seam/spring http://jboss.com/products/seam/spring-2.1.xsd">
             
      
              <core:manager conversation-timeout="120000" concurrent-request-timeout="500" conversation-id-parameter="cid" />
      
          <persistence:managed-hibernate-session 
              name="hibernateSession" auto-create="true" session-factory="#{sessionFactory}"/>
          
              <spring:context-loader config-locations="/WEB-INF/applicationContext.xml" />
              
              <spring:spring-transaction platform-transaction-manager="#{transactionManager}" />
              
              <ui:hibernate-entity-loader session="#{hibernateSession}"/>
              
      </components>





      erro in console




      14/07/2009 10:22:58 com.sun.facelets.FaceletViewHandler handleRenderException
      SEVERE: Error Rendering View[/pagina/usuario.xhtml]
      org.hibernate.TransientObjectException: The instance was not associated with this session
              at org.hibernate.impl.SessionImpl.getIdentifier(SessionImpl.java:1375)
              at org.jboss.seam.persistence.HibernateSessionProxy.getIdentifier(HibernateSessionProxy.java:236)
              at org.jboss.seam.framework.HibernateEntityIdentifier.<init>(HibernateEntityIdentifier.java:13)
              at org.jboss.seam.ui.HibernateEntityLoader.createIdentifier(HibernateEntityLoader.java:28)
              at org.jboss.seam.ui.AbstractEntityLoader.put(AbstractEntityLoader.java:46)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
              at java.lang.reflect.Method.invoke(Unknown Source)
              at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
              at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
              at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:95)
              at org.jboss.seam.util.Work.workInTransaction(Work.java:47)
              at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:89)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
              at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
              at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
              at org.jboss.seam.ui.HibernateEntityLoader_$$_javassist_2.put(HibernateEntityLoader_$$_javassist_2.java)
              at org.jboss.seam.ui.EntityConverter.getAsString(EntityConverter.java:65)
              at org.jboss.seam.ui.converter.PrioritizableConverter.getAsString(PrioritizableConverter.java:67)
              at org.jboss.seam.ui.converter.ConverterChain.getAsString(ConverterChain.java:126)
              at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getFormattedValue(HtmlBasicRenderer.java:448)
              at com.sun.faces.renderkit.html_basic.MenuRenderer.renderOption(MenuRenderer.java:480)
              at com.sun.faces.renderkit.html_basic.MenuRenderer.renderOptions(MenuRenderer.java:759)
              at com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:819)
              at com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:280)
              at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861)
              at org.jboss.seam.ui.util.cdk.RendererBase.renderChild(RendererBase.java:190)
              at org.jboss.seam.ui.util.cdk.RendererBase.renderChildren(RendererBase.java:166)
              at org.jboss.seam.ui.renderkit.ValidateAllRendererBase.doEncodeChildren(ValidateAllRendererBase.java:33)
              at org.jboss.seam.ui.util.cdk.RendererBase.encodeChildren(RendererBase.java:92)
              at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
              at org.jboss.seam.ui.util.cdk.RendererBase.renderChild(RendererBase.java:186)
              at org.jboss.seam.ui.util.cdk.RendererBase.renderChildren(RendererBase.java:166)
              at org.jboss.seam.ui.renderkit.DecorateRendererBase.doEncodeChildren(DecorateRendererBase.java:146)
              at org.jboss.seam.ui.util.cdk.RendererBase.encodeChildren(RendererBase.java:92)
              at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
              at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:277)
              at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258)
              at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:220)
              at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:215)
              at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:120)
              at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
              at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:277)
              at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258)
              at org.ajax4jsf.renderkit.html.AjaxOutputPanelRenderer.encodeChildren(AjaxOutputPanelRenderer.java:78)
              at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:936)
              at javax.faces.render.Renderer.encodeChildren(Renderer.java:148)
              at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:936)
              at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
              at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
              at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
              at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
              at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilte
      r.java:198)
              at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
              at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
              at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
              at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
              at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
              at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
              at java.lang.Thread.run(Unknown Source)