1 Reply Latest reply on Dec 16, 2007 12:23 AM by Mirko Adari

    <transaction:ejb-transaction/> breaks icefaces file upload

    Indrek Altpere Newbie

      To be precise, icefaces file upload gets broken and possibly some other things too that we haven't experienced yet.
      We use seam 2.0.0GA, icefaces 1.7DR#3 from svn, jsf 1.2 on glassfish v2

      When uploading file, some odd exception of "EJB not found" is thrown.

      I have posted full stacktrace already at icefaces forum at
      http://www.icefaces.org/JForum/posts/list/6613.page

      Example source
      http://www.flamebox.org/fserver/soovexample.rar
      Example ear package
      http://www.flamebox.org/fserver/soov.ear

      When executed, simple page is displayed where you can select file to upload, upload it, and also see the progress of the upload.

      Ear has <transaction:ejb-transaction/> in components.xml

      When I upload the file and icefaces component tries to send content to browser, exceptions

      NRU-org.jboss.seam.transaction.EjbSynchronizations: Cannot load from BACKUPSTORE FOR Key: <3e90c03b00a81f-ffffffffd01e540c-1>
       EJB5018: An exception was thrown during an ejb invocation on [EjbSynchronizations]
       javax.ejb.NoSuchObjectLocalException: The EJB does not exist. session-key: 3e90c03b00a81f-ffffffffd01e540c-1
       at com.sun.ejb.containers.StatefulSessionContainer._getContext(StatefulSessionContainer.java:2400)
       at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:1675)
       at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1229)
       at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:195)
       at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:127)
       at $Proxy218.afterTransactionBegin(Unknown Source)
       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 org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
       at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
       at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:76)
       at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
       at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
       at org.javassist.tmp.java.lang.Object_$$_javassist_0.afterTransactionBegin(Object_$$_javassist_0.java)
       at org.jboss.seam.transaction.UTTransaction.begin(UTTransaction.java:40)
       at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:566)
       at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsBeforePhase(SeamPhaseListener.java:307)
       at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:142)
       at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116)
       at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
       at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
       at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.execute(PersistentFacesState.java:248)
       at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState$RenderRunner.run(PersistentFacesState.java:299)
       at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
       at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
       at java.lang.Thread.run(Thread.java:619)
       uncaught exception
       java.lang.IllegalStateException: Could not start transaction
      

      start to occur and also following stacktrace occurs
       Problem in renderResponse: javax.el.ELException: /inputfile.xhtml @22,93 value="File Name: #{inputFileBackerBean.fileName}": javax.ejb.EJBException: nested exception is: java.lang.IllegalStateException: EJB is already associated with an incomplete transaction
       javax.faces.FacesException: javax.el.ELException: /inputfile.xhtml @22,93 value="File Name: #{inputFileBackerBean.fileName}": javax.ejb.EJBException: nested exception is: java.lang.IllegalStateException: EJB is already associated with an incomplete transaction
       at javax.faces.component.UIOutput.getValue(UIOutput.java:176)
       at com.icesoft.faces.renderkit.dom_html_basic.DomBasicInputRenderer.getValue(DomBasicInputRenderer.java:60)
       at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.getValue(DomBasicRenderer.java:156)
       at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeEnd(DomBasicRenderer.java:128)
       at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:836)
       at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:384)
       at com.icesoft.faces.renderkit.dom_html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:92)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
       at com.icesoft.faces.renderkit.dom_html_basic.DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:374)
       at com.icesoft.faces.renderkit.dom_html_basic.GridRenderer.encodeChildren(GridRenderer.java:196)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
       at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:584)
       at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:588)
       at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:588)
       at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:588)
       at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:588)
       at com.icesoft.faces.facelets.D2DFaceletViewHandler.renderResponse(D2DFaceletViewHandler.java:320)
       at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:156)
       at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
       at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
       at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
       at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:18)
       at com.icesoft.faces.webapp.http.core.PageServer$1.respond(PageServer.java:25)
       at com.icesoft.faces.webapp.http.servlet.ServletRequestResponse.respondWith(ServletRequestResponse.java:146)
       at com.icesoft.faces.webapp.http.servlet.ThreadBlockingAdaptingServlet$ThreadBlockingRequestResponse.respondWith(ThreadBlockingAdaptingServlet.java:36)
       at com.icesoft.faces.webapp.http.core.PageServer.service(PageServer.java:30)
       at com.icesoft.faces.webapp.http.core.MultiViewServer.service(MultiViewServer.java:56)
       at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer$Matcher.serviceOnMatch(PathDispatcherServer.java:50)
       at com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:19)
       at com.icesoft.faces.webapp.http.servlet.ThreadBlockingAdaptingServlet.service(ThreadBlockingAdaptingServlet.java:19)
       at com.icesoft.faces.webapp.http.servlet.EnvironmentAdaptingServlet.service(EnvironmentAdaptingServlet.java:29)
       at com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet.service(MainSessionBoundServlet.java:117)
       at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:37)
       at com.icesoft.faces.webapp.http.servlet.PathDispatcher$Matcher.serviceOnMatch(PathDispatcher.java:52)
       at com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:29)
       at com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:76)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
       at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
       at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
       at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
       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:44)
       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:230)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
       at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
       at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
       at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
       at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
       at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
       at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
       at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
       at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
       at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
       at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
       at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
       at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
       at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
       at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
       at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:270)
       at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
       at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
       at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
       at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:339)
       at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:261)
       at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:212)
       at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
       at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
       Caused by: javax.el.ELException: /inputfile.xhtml @22,93 value="File Name: #{inputFileBackerBean.fileName}": javax.ejb.EJBException: nested exception is: java.lang.IllegalStateException: EJB is already associated with an incomplete transaction
       at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76)
       at javax.faces.component.UIOutput.getValue(UIOutput.java:173)
       ... 82 more
      


      When I remove the <transaction:ejb-transaction/> from components.xml, file upload works correctly, when I add it, things stop working.
      Is this seam related issue and how and if can I overcome the EJB not found exception and EJB being associated with incomplete transaction during upload ?