voyent
Is inputfile control really working in SEAM 2.0.0.GA  XML
Forum Index -> JBoss Seam Integration
Author Message
edykory


Joined: 27/Nov/2006 00:00:00
Messages: 332
Offline


Hi there everyone,
Sorry for being too lazy to read all the posts about inputfile and SEAM, but they are a little bit too many for me to handle.
My question is very simple. Considering the already posted errors (or not so much "errors") is the IceFaces inputfile implementation production ready for using with Seam 2.0.0?
For us it's a question of using or not using Seam (since there are no other Ajax enabled input file controls for SEAM - at least as far as I know).

Thanx,

Eduard
judy.guglielmin

Joined: 20/Feb/2007 00:00:00
Messages: 1389
Offline


We have 2 separate implementations of it running well. (also tested with Seam-2.0.1 --cr1,cr2 and GA). The first is available from our download site and will probably undergo some modifications when I get around to it soon. The one from download is part of an ear deployment using a stateful session bean.

The other will be available from download shortly but is on our repository if people want to look at it ahead of time. It is a war deployment that can be deployed to AS without seam. So far it has been tested on Tomcat6, Welogic 10, Glassfish v2 and jboss 4.2.x. There has been some question as to use of Glassfish with Seam and this component due to transaction management and we're hoping to find some time to address this shortly(it's a possibility of just not having a required jar).

Bottom line:- it works, but you have to make adjustments for standard request scope when using with Seam. There have also been some recent changes to our code which eliminates some problems with the async components, if you use the latest release.

Newlukai

Joined: 29/Nov/2006 00:00:00
Messages: 125
Offline


Would you please have a look for my post in the Seam forum?

I've a problem when using ice:inputFile. After sending a file to the server another invocation of the bean which got the file results in a "Could not find stateful bean" exception.
judy.guglielmin

Joined: 20/Feb/2007 00:00:00
Messages: 1389
Offline


It's a little easier for me to answer on this forum as I receive automatic notifications...

Anyways, I looked briefly at your posting and the first thing I would do is remove the popupPanel as it has some interesting side effects in standard request scope that are still being worked on. If you look at seam-comp-showcaseWar you can see a "pseudo" popup panel that works well in standard request scope.

NO testing has been done on s:fileupload since we have our own component in ice:fileupload. As far as the exception of not being able to find the stateful bean, you may want to try something similar to the above mentioned example with a stateful session bean managing the inputfile. I should also mention that this example mentioned above has been tested in several different servers (including Liferay and jboss portals).

AFAIK ...the other thing is that the limitation for a single file to be uploaded at a time is due to browser limitations, so this should probably be ensured in your application design.
Newlukai

Joined: 29/Nov/2006 00:00:00
Messages: 125
Offline


Erm, I think I have to take back teh "multiple" when I'm talking about the up-/download functionality I want to implement.

Thanks for your hints. I took all your hints, but still I got this "could not find stateful bean" exception. But this time I had a look to JBoss AS's server.log:

server.log wrote:
2008-04-07 09:45:31,668 DEBUG [org.jboss.seam.contexts.FacesLifecycle] <<< End JSF request for /ares/toDo.seam
2008-04-07 09:45:31,683 DEBUG [com.icesoft.faces.webapp.http.servlet.PathDispatcher] path: /ares/block/receive-updates
2008-04-07 09:45:44,450 DEBUG [com.icesoft.faces.webapp.http.servlet.PathDispatcher] path: /ares/block/send-receive-updates
2008-04-07 09:45:44,450 DEBUG [org.jboss.seam.contexts.FacesLifecycle] >>> Begin JSF request for /ares/toDo.seam
2008-04-07 09:45:44,450 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
2008-04-07 09:45:44,450 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
2008-04-07 09:45:44,450 DEBUG [org.jboss.seam.jsf.SeamPhaseListener] beginning transaction prior to phase: RESTORE_VIEW 1
2008-04-07 09:45:44,450 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
2008-04-07 09:45:44,465 DEBUG [org.jboss.seam.transaction.UTTransaction] beginning JTA transaction
2008-04-07 09:45:44,465 DEBUG [org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager] Attempting to activate; id=4sub52-nntvel-feqqjdfz-1-feqqo5ca-2d
2008-04-07 09:45:44,465 ERROR [org.jboss.seam.jsf.SeamPhaseListener] uncaught exception
java.lang.IllegalStateException: Could not start transaction
at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:581)
at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsBeforePhase(SeamPhaseListener.java:312)
at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:140)
at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:114)
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.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:17)
at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCyclePartial(ReceiveSendUpdates.java:64)
at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:40)
at com.icesoft.faces.webapp.http.core.ViewBoundServer.service(ViewBoundServer.java:65)
at com.icesoft.faces.webapp.http.core.RequestVerifier.service(RequestVerifier.java:44)
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:106)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:35)
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:79)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:445)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:343)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:54)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
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.LoggingFilter.doFilter(LoggingFilter.java:58)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
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.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.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
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:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.ejb.NoSuchEJBException: Could not find stateful bean: 4sub52-nntvel-feqqjdfz-1-feqqo5ca-2d
at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:390)
at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:375)
at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:61)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:206)
at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:119)
at $Proxy365.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:585)
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:107)
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:576)
... 56 more
2008-04-07 09:45:44,465 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.exception.exceptions 


To cause this exception, I upload a file, what proceeds successfully (i. e. the file is saved and then shown in the list of available files) and then click any commandButton or link. Whether it is used for navigation or to call an action doesn't matter.

Perhaps some more code helps to spot the problem.

This page shows the entity and includes a template which is responsible for displaying all available files:
Code:
<ice:form id="showTestactionForDeveloper">
    <ui:include src="inc/messages.xhtml" />
    
    <s:div styleClass="buttonLine">
     <h:commandButton action="backToList" image="img/icon_buttonLine_back.gif" styleClass="graphical" title="#{ares_messages.tooltip_backToList}" />
     
     <h:graphicImage width="3" height="16" value="img/separator_buttonLine.gif" styleClass="separator" />
     
     <ice:commandButton image="img/icon_buttonLine_protocol.gif" styleClass="graphical" partialSubmit="true" actionListener="#{protocolProvider.showProtocolDialog}" title="#{ares_messages.tooltip_showProtocol}" />
     <ice:commandButton image="img/icon_buttonLine_attach.gif" styleClass="graphical" partialSubmit="true" actionListener="#{testactionDeveloper.showUpDownloadDialog}" title="#{ares_messages.tooltip_upDownload}" />
     <h:outputText value="(#{testactionDeveloper.countOfAttachedFiles})" converter="javax.faces.Long" rendered="#{testactionDeveloper.countOfAttachedFiles > 0}" styleClass="fileCounter" />
     
     <h:graphicImage width="3" height="16" value="img/separator_buttonLine.gif" styleClass="separator" />
     
     <h:commandButton action="#{testactionDeveloper.saveTestaction}" image="img/icon_buttonLine_save.gif" styleClass="graphical" title="#{ares_messages.tooltip_saveTestaction}" />
     <h:commandButton action="#{testactionDeveloper.saveTestactionAndNext}" image="img/icon_buttonLine_saveAndNext.gif" styleClass="graphical" rendered="#{testactionDeveloper.testactionsSize > 1}" title="#{ares_messages.tooltip_saveTestactionAndNext}" />
     
     <h:graphicImage width="3" height="16" value="img/separator_buttonLine.gif" styleClass="separator" />
     
     <h:commandButton action="#{testactionDeveloper.prevTestaction}" image="img/icon_buttonLine_left.gif" styleClass="graphical" rendered="#{testactionDeveloper.testactionsSize > 1}" title="#{ares_messages.tooltip_prevTestaction}" />
     <h:outputText value="#{testactionDeveloper.testactionIndexHR} | #{testactionDeveloper.testactionsSize}" styleClass="indexAndSize" />
     <h:commandButton action="#{testactionDeveloper.nextTestaction}" image="img/icon_buttonLine_right.gif" styleClass="graphical" rendered="#{testactionDeveloper.testactionsSize > 1}" title="#{ares_messages.tooltip_nextTestaction}" />
    </s:div>
    
    <s:div styleClass="clearButtonLineFloat" />
    
    <h:panelGrid cellpadding="0" cellspacing="0" border="0" columns="10" rowClasses="tableRowHeader, tableRowContent" styleClass="testaction">  
     <h:outputText value="#{ares_messages.label_testaction_ID}" />
     <h:outputText value="#{ares_messages.label_testaction_TDate}" />
     <h:outputText value="#{ares_messages.label_testaction_TCaseID}" />
     
     <h:outputText value="#{testaction.ID}" />
     <h:outputText value="#{testaction.TDate}" />
 
     <ice:selectOneMenu value="#{testaction.TCaseID}" id="TCaseID" converter="com.idsscheer.ares.converter.TestcaseConverter">
      <s:selectItems value="#{selectMenuHelper.testcases}" var="testcase" label="#{testcase.ID} - #{testcase.token}" />
     </ice:selectOneMenu>
 
    <ui:include src="inc/popup_protocol.xhtml" />
     
    <ui:include src="inc/popup_upDownload.xhtml">
     <ui:param name="fileProvider" value="#{testactionDeveloper}" />
    </ui:include>
 </ice:form>


This is the included template:
Code:
<!-- <ice:panelPopup draggable="true"
   rendered="#{fileProvider.showUpDownloadDialog}"
   visible="#{fileProvider.showUpDownloadDialog}"
   style="width: 700px;"
   autoCentre="true"> -->
   <ice:panelCollapsible expanded="#{fileProvider.showUpDownloadDialog}">
   <f:facet name="header">
    <!-- skipped -->
   </f:facet>
 
   <!-- <f:facet name="body"> -->
    <ice:panelGrid columns="1" cellpadding="0" cellspacing="0" border="0">
     <h:dataTable value="#{fileProvider.attachedFiles}"
      var="attachedFile"
      rendered="#{!empty fileProvider.attachedFiles}"
      styleClass="testactionList" rowClasses="tableRowEven, tableRowOdd"
      style="text-align: center;">
      <h:column>
       <f:facet name="header">
        <h:outputText value="#{ares_messages.label_upDownload_filename}" />
       </f:facet>
       <h:outputText value="#{attachedFile.name}" />
      </h:column>
      <h:column>
       <f:facet name="header">
        <h:outputText value="#{ares_messages.label_upDownload_view}" />
       </f:facet>
       <ice:commandButton image="img/icon_upDownload_view.gif"
        styleClass="graphical" partialSubmit="true"
        action="#{fileProvider.viewFile(attachedFile)}"
        style="width: 16px;" />
      </h:column>
      <h:column>
       <f:facet name="header">
        <h:outputText value="#{ares_messages.label_upDownload_download}" />
       </f:facet>
       <ice:commandButton image="img/icon_upDownload_download.gif"
        styleClass="graphical"
        action="#{fileProvider.downloadFile(attachedFile)}"
        style="width: 16px;" />
      </h:column>
      <h:column>
       <f:facet name="header">
        <h:outputText value="#{ares_messages.label_upDownload_remove}" />
       </f:facet>
       <ice:commandButton image="img/icon_upDownload_remove.gif"
        styleClass="graphical" partialSubmit="true"
        action="#{fileProvider.removeFile(attachedFile)}"
        style="width: 16px;" />
      </h:column>
     </h:dataTable>
     <ice:outputStyle href="css/screen.css" />
     <ice:inputFile actionListener="#{fileProvider.fileUpload.upload}"
      style="margin-top: 30px;" id="upload" />
    </ice:panelGrid>
   <!-- </f:facet> -->
   </ice:panelCollapsible>
  <!-- </ice:panelPopup> -->


The "manager" extends a class which implements general functionality for this and other similar managers. Here's the superclass (I skipped some methods and attributes):

Code:
public abstract class TestactionHandling {
  @PersistenceContext(unitName = "aresDatabase")
  protected transient EntityManager em;
  
  @In
  protected transient FacesContext facesContext;
  
  @In
  protected IUpDownloadService upDownload;
  
  @In(required=false) /* required=false is necessary since the upload
       is done in a separate form, so all this Seam stuff doesn't work */
  @Valid
  protected User user;
  
  @DataModel
  protected List<Testaction> testactions;
  @In(required=false)
  @Out(required=false, scope=ScopeType.SESSION)
  protected Testaction testaction;
  protected int testactionIndex;
  
  protected boolean showUpDownloadDialog = false;
  
  protected UpDownloadFileinfo fileUpload;
 
  
  public String upload(ActionEvent event) {
   InputFile uploadedFile = (InputFile) event.getSource();
   boolean success = false;
   if(uploadedFile.getStatus() == InputFile.SAVED) {
    if(testaction == null) {
     testaction = testactions.get(testactionIndex);
    }
    UpDownloadFileinfo fileInfo = new UpDownloadFileinfo();
    fileInfo.setName(uploadedFile.getFileInfo().getFileName());
    fileInfo.setFile(uploadedFile.getFile());
    fileInfo.setContentType(uploadedFile.getFileInfo().getContentType());
    fileInfo.setTestactionID(testaction.getID());
    success = upDownload.upload(fileInfo);
   }
   if( !success ) {
    return "failed";
   }
   return null;
  }
  
  public List<UpDownloadFileinfo> getAttachedFiles() {
   return upDownload.getAttachedFiles(testaction.getID());
  }
  
  public Long getCountOfAttachedFiles() {
   return upDownload.getCountOfAttachedFiles(testaction.getID());
  }
  
  public String downloadFile(UpDownloadFileinfo selectedFile) {
   UpDownloadFileinfo fileInfo = upDownload.downloadFile(selectedFile);
   
   JavascriptContext.addJavascriptCall(facesContext, "window.open('downloadFile?fileName=" + fileInfo.getName() + "&directory=" + fileInfo.getPath() + "&contentType=" + fileInfo.getContentType() + "', 'downloadFile');");
   
   return null;
  }
  
  public String viewFile(UpDownloadFileinfo selectedFile) {
   UpDownloadFileinfo fileInfo = upDownload.viewFile(selectedFile);
   
   JavascriptContext.addJavascriptCall(facesContext, "window.open('downloadFile?action=view&fileName=" + fileInfo.getName() + "&directory=" + fileInfo.getPath() + "&contentType=" + fileInfo.getContentType() + "', 'downloadFile');");
   
   return null;
  }
  
  public String removeFile(UpDownloadFileinfo selectedFile) {
   upDownload.removeFile(selectedFile);
   return null;
  }
  
  public boolean isShowUpDownloadDialog() {
   return showUpDownloadDialog;
  }
 
  public void setShowUpDownloadDialog(boolean showProtocolDialog) {
   this.showUpDownloadDialog = showProtocolDialog;
  }
 
  @SuppressWarnings("unused")
  public void showUpDownloadDialog(ActionEvent event) {
   showUpDownloadDialog = true;
  }
 
  @SuppressWarnings("unused")
  public void closeUpDownloadDialog(ActionEvent event) {
   showUpDownloadDialog = false;
  }
 
  public UpDownloadFileinfo getFileUpload() {
   if(fileUpload == null) {
    fileUpload = new UpDownloadFileinfo(testaction, testactions, testactionIndex, upDownload);
   }
   return fileUpload;
  }
  
  public void setFileUpload(UpDownloadFileinfo fileUpload) {
   this.fileUpload = fileUpload;
  }
 }
 


Here's the "testactionDeveloper" subclass (it doesn't redefine its superclass methos):
Code:
@Stateful
 @Scope(ScopeType.SESSION)
 @Name("testactionDeveloper")
 public class TestactionDeveloperAction extends TestactionHandling implements TestactionDeveloper, Serializable {
   //nothing of interest here
 }


The "UpDownloadFileinfo" is used for data transfer. That means it represents a file when uploading or downloading a file. The @Name annotation, the additional constructor and the upload method are implemented because it's done similar in the example you mentioned. In the first version this class was a plain getter/setter class.

Code:
@Name("fileUpload")
 public class UpDownloadFileinfo implements IUpDownloadFileinfo {
  private String name;
  private File file;
  private String contentType;
  private long testactionID;
  private long dbFileID;
  
  private Testaction testaction;
  private List<Testaction> testactions;
  private int testactionIndex;
  
  @In
  private IUpDownloadService upDownload;
  
  
  public UpDownloadFileinfo() {
  }
  
  public UpDownloadFileinfo(Testaction testaction, List<Testaction> testactions, int testactionIndex, IUpDownloadService upDownload) {
   this.testaction = testaction;
   this.testactions = testactions;
   this.testactionIndex = testactionIndex;
   this.upDownload = upDownload;
  }
  
  public String upload(ActionEvent event) {
   InputFile uploadedFile = (InputFile) event.getSource();
   boolean success = false;
   if(uploadedFile.getStatus() == InputFile.SAVED) {
    if(testaction == null) {
     testaction = testactions.get(testactionIndex);
    }
    setName(uploadedFile.getFileInfo().getFileName());
    setFile(uploadedFile.getFile());
    setContentType(uploadedFile.getFileInfo().getContentType());
    setTestactionID(testaction.getID());
    success = upDownload.upload(this);
   }
   if( !success ) {
    return "failed";
   }
   return null;
  }
 }


As you can see from the code above I added this addtional constructor which takes four parameters. It was necessary to do this because Seam destroyed its contexts before the upload method was invoked, what caused a NPE.

Just to make it clearer for me (and maybe for you): The upload before and after those changes worked fine. A file was received and saved. After the upload finished the page refreshed and displayed the new file in a list of available files. But when I click any button I'm getting this exception. It happens in the RESTORE_VIEW phase and it seems that the JTA transaction can't be restored (whatever this JTA transaction is good for).

I don't know why this happens, but I thought it would be a good idea to test Seam's file upload component. But it can't work with ICEfaces since the upload component expects a "MultipartRequest" in the responsible servlet but it gets an com.icesoft.faces.webapp.http.servlet.ServletExternalContext.

I hope this information helps you in solving this problem.

Thanks in advance
Jens
judy.guglielmin

Joined: 20/Feb/2007 00:00:00
Messages: 1389
Offline


First, you may want to try it without the panelCollapsible. Personally, whenever I use standard request scope with any of the async components or ajax-push, I start with panelGroup and get it working with it. Then I'll put in some of the fancier components.

Alternatively, there is an example of a stateful session bean for fileupload with the version of seam-comp-showcase available from our download page. (it is the ear deployment version for ICEfaces 1.6.0 release but can be used with any version of ICEfaces post-1.6.0 release).

Newlukai

Joined: 29/Nov/2006 00:00:00
Messages: 125
Offline


I tried ice:panelGroup, didn't work either.

I had a look at the mentioned seam-component-showcase and the new ICEfaces 1.7 component showcase. The real interesting difference is the separation of the "upload" method to an inner class in the seam-component-showcase. The new showcase implements the upload method without an inner class. So I'm wondering if it's really necessary to move the upload method to another class or can I leave it in the original controller?

BTW: Could it be that a timeout setting is responsible for this exception? In order to handle some problems I set the session timeout to 5 minutes. Another thing I changed was pages.xml. I had a lot of "redirect"s instead of "render". This broke "JavascriptContext.add..." so I now use "render" in pages.xml.

I saw that I didn't post the complete stacktrace, it might help, because it shows that "org.jboss.seam.transaction.synchronizations" is the bean that can't be found.

stacktrace wrote:
08:58:09,320 ERROR [SeamPhaseListener] uncaught exception
java.lang.IllegalStateException: Could not start transaction
at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:581)
at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsBeforePhase(SeamPhaseListener.java:312)
at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:140)
at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:114)
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.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:17)
at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCyclePartial(ReceiveSendUpdates.java:64)
at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:40)
at com.icesoft.faces.webapp.http.core.ViewBoundServer.service(ViewBoundServer.java:65)
at com.icesoft.faces.webapp.http.core.RequestVerifier.service(RequestVerifier.java:44)
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:106)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:35)
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:79)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:445)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:343)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:54)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
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.LoggingFilter.doFilter(LoggingFilter.java:58)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
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.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.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
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:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.ejb.NoSuchEJBException: Could not find stateful bean: 4sub52-70ouhh-fewd89tm-1-feweqj5t-80
at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:390)
at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:375)
at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:61)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:206)
at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:119)
at $Proxy1145.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:585)
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:107)
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:576)
... 56 more
08:58:09,336 ERROR [SeamPhaseListener] uncaught exception
java.lang.IllegalStateException: Could not commit transaction
at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:602)
at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsAfterPhase(SeamPhaseListener.java:330)
at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:231)
at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:182)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:17)
at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCyclePartial(ReceiveSendUpdates.java:64)
at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:40)
at com.icesoft.faces.webapp.http.core.ViewBoundServer.service(ViewBoundServer.java:65)
at com.icesoft.faces.webapp.http.core.RequestVerifier.service(RequestVerifier.java:44)
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:106)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:35)
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:79)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:445)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:343)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:54)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
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.LoggingFilter.doFilter(LoggingFilter.java:58)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
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.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.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
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:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.ejb.NoSuchEJBException: Could not find stateful bean: 4sub52-70ouhh-fewd89tm-1-feweqj5t-80
at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:390)
at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:375)
at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:61)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:206)
at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:119)
at $Proxy1145.beforeTransactionCommit(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:585)
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:107)
at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
at org.javassist.tmp.java.lang.Object_$$_javassist_0.beforeTransactionCommit(Object_$$_javassist_0.java)
at org.jboss.seam.transaction.UTTransaction.commit(UTTransaction.java:49)
at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:592)
... 56 more
08:58:09,336 WARN [Component] Exception calling stateful session bean default @Remove method: org.jboss.seam.transaction.synchronizations
javax.ejb.NoSuchEJBException: Could not find stateful bean: 4sub52-70ouhh-fewd89tm-1-feweqj5t-80
at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:390)
at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:375)
at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:61)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateful.StatefulRemoveInterceptor.invoke(StatefulRemoveInterceptor.java:97)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:206)
at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:119)
at $Proxy1145.destroy(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:585)
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:107)
at org.jboss.seam.intercept.ClientSideInterceptor.invoke(ClientSideInterceptor.java:54)
at org.javassist.tmp.java.lang.Object_$$_javassist_0.destroy(Object_$$_javassist_0.java)
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:585)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
at org.jboss.seam.Component.callComponentMethod(Component.java:2082)
at org.jboss.seam.Component.callDefaultRemoveMethod(Component.java:1987)
at org.jboss.seam.Component.destroy(Component.java:1341)
at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:251)
at org.jboss.seam.contexts.Contexts.flushAndDestroyContexts(Contexts.java:394)
at org.jboss.seam.contexts.FacesLifecycle.endRequest(FacesLifecycle.java:112)
at org.jboss.seam.jsf.SeamPhaseListener.afterResponseComplete(SeamPhaseListener.java:513)
at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:196)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:17)
at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.renderCyclePartial(ReceiveSendUpdates.java:64)
at com.icesoft.faces.webapp.http.core.ReceiveSendUpdates.service(ReceiveSendUpdates.java:40)
at com.icesoft.faces.webapp.http.core.ViewBoundServer.service(ViewBoundServer.java:65)
at com.icesoft.faces.webapp.http.core.RequestVerifier.service(RequestVerifier.java:44)
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:106)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:35)
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:79)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:445)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:343)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:54)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
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.LoggingFilter.doFilter(LoggingFilter.java:58)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
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.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.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
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:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:595)
08:58:09,336 ERROR [CachedConnectionValve] Application error: Blocking Servlet did not complete its transaction 
judy.guglielmin

Joined: 20/Feb/2007 00:00:00
Messages: 1389
Offline


It looks like it is trying to perform the @Remove method but can't find the SSB. Really, you might want to simplify things as much as possible and then start adding in complexity --perhaps a phaselistener to check on the state of your bean in question?
Newlukai

Joined: 29/Nov/2006 00:00:00
Messages: 125
Offline


I'll give it a try as soon as I'm at work again.

But the bean that can't be found isn't one of "my beans". It's a bean of Seam. Seam needs this bean "org.jboss.seam.transaction.synchronizations". I debugged into the "SimpleStatefulCache" and it looks like Seam creates this bean on every request. But if the previous request was an upload, this "org.jboss.seam.transaction.synchronizations" isn't created, but requested to destroy. And since it wasn't created, it can't be found which produces this exception. And I don't know why this bean wasn't created at the beginning of the request. Maybe I made a mistake somewhere, maybe inputFile (1.7) doesn't work with Seam2 under certain circumstances.

But as I told I'll test it.
judy.guglielmin

Joined: 20/Feb/2007 00:00:00
Messages: 1389
Offline


The reason the fileupload function is separated from the FileManager class is just for this reason. When you are using asych methods or components, things aren't being managed by Seam, so no transaction may be available. I worked with a different version (using the container) to use manual transaction management, but it isn't all the pretty either. Even with regular seam, when @Asynchronous is being used, users have to make allowances for transaction management. (see the docs).
Newlukai

Joined: 29/Nov/2006 00:00:00
Messages: 125
Offline


Hi,

I did not finish my tests, but while testing I saw this JIRA issue and changed "<core:init transaction-management-enabled="true" />" to "<core:init transaction-management-enabled="false" />". After this change my code (without the changes you proposed) works as expected. So it's obvious that something with Seam transaction is "damaged" while using ice:inputFile. Now I don't know whether it's a mistake I made in my application or is it a bug in ice:inputFile. I don't know anything about those transactions, but using them together with ice:inputFile doesn't work. WHat can I do to find the reason?

Thanks
Newlukai
judy.guglielmin

Joined: 20/Feb/2007 00:00:00
Messages: 1389
Offline


Seam transaction management is enabled by default. The example application (seam-comp-showcase) does work in all instances with transactions enabled for all tested application servers. I am not sure which AS you are using, but perhaps you could deploy this sample app to your AS and see that it does indeed work. As with any async components/push and Seam, you have to design your app based on the knowledge that during the push, the (Seam) contexts may not be available. Also that the state needs to be updated after a push and then rendered.

Newlukai

Joined: 29/Nov/2006 00:00:00
Messages: 125
Offline


judy.guglielmin wrote:
Seam transaction management is enabled by default. The example application (seam-comp-showcase) does work in all instances with transactions enabled for all tested application servers. I am not sure which AS you are using, but perhaps you could deploy this sample app to your AS and see that it does indeed work. 


That's what came up to my mind. I tested it and it ... works. Okay, this tells me that there's something wrong with my app, right?

judy.guglielmin wrote:
As with any async components/push and Seam, you have to design your app based on the knowledge that during the push, the (Seam) contexts may not be available. Also that the state needs to be updated after a push and then rendered. 


Is this what is done with reRender()? I changed my "fileUpload" bean, it now implements all this render and progress stuff, but I've still problems. This is what my bean looks like at the moment:

Code:
@Name("fileUpload")
 public class UpDownloadFileinfo implements Renderable, Serializable {
 	private static final long serialVersionUID = 3364134777913362095L;
 	
 	private String name;
 	private File file;
 	private String contentType;
 	private long testactionID;
 	private long dbFileID;
 	
 	private Testaction testaction;
 	private List<Testaction> testactions;
 	private int testactionIndex;
 	
 //	@In
 //	private IUpDownloadService upDownload;
 	
 	private PersistentFacesState state;    
     private RenderManager renderManager;
     private int percent = -1;
 	
 	
 	public UpDownloadFileinfo() {
 	}
 	
 	public UpDownloadFileinfo(Testaction testaction, List<Testaction> testactions, int testactionIndex, IUpDownloadService upDownload) {
 		this.testaction = testaction;
 		this.testactions = testactions;
 		this.testactionIndex = testactionIndex;
 //		this.upDownload = upDownload;
 		state = PersistentFacesState.getInstance();
 	}
 	
 	public long getDbFileID() {
 		return dbFileID;
 	}
 
 	public void setDbFileID(long dbFileID) {
 		this.dbFileID = dbFileID;
 	}
 
 	public String getName() {
 		return name;
 	}
 
 	public void setName(String name) {
 		this.name = name;
 	}
 
 	public File getFile() {
 		return file;
 	}
 
 	public void setFile(File file) {
 		this.file = file;
 	}
 	
 	public String getPath() {
 		String path = "";
 		
 		if(file != null) {
 			try {
 				path = (new File(file.getParent()).toURI().toURL().getPath());
 			} catch (MalformedURLException e) {
 				e.printStackTrace();
 			}
 		}
 		
 		return path;
 	}
 
 	public String getContentType() {
 		return contentType;
 	}
 
 	public void setContentType(String contentType) {
 		this.contentType = contentType;
 	}
 
 	public long getTestactionID() {
 		return testactionID;
 	}
 
 	public void setTestactionID(long testactionID) {
 		this.testactionID = testactionID;
 	}
 	
 	public String upload(ActionEvent event) {
 		InputFile uploadedFile = (InputFile) event.getSource();
 		boolean success = false;
 		if(uploadedFile.getStatus() == InputFile.SAVED) {
 			if(testaction == null) {
 				testaction = testactions.get(testactionIndex);
 			}
 			setName(uploadedFile.getFileInfo().getFileName());
 			setFile(uploadedFile.getFile());
 			setContentType(uploadedFile.getFileInfo().getContentType());
 			setTestactionID(testaction.getID());
 			success = true;//upDownload.upload(this);
 		}
 		if( !success ) {
 			return "failed";
 		}
 		return null;
 	}
 
 	public void progress(EventObject event) {
 		InputFile ifile = (InputFile) event.getSource(); 
 		this.percent = ifile.getFileInfo().getPercent();
 		reRender();
 	}
 	
 	protected void reRender() {
 		PersistentFacesState _state = PersistentFacesState.getInstance();
 		if(_state != null){
 			state = _state;
 			try{
 				state.execute();
 				state.render();
 			}catch(Exception re){
 				re.printStackTrace();
 			}
 
 		}
 		else {
 		}
 	}
 	
 	@Destroy 
 	public void destroy(){
 	}
 	
 	public PersistentFacesState getState() {
 		return state;
 	}
 
 	public void renderingException(RenderingException renderingException) {
 		renderingException.printStackTrace();
 	}
 	
 	public void setRenderManager(RenderManager renderManager) {
 		if (renderManager !=null) this.renderManager = renderManager;
 	}
 
 	public RenderManager getRenderManager() {
 		return this.renderManager;
 	}
 	
 	public void setPercent(int percent) {
         this.percent = percent;
     }
 
     public int getPercent() {
         return this.percent;
     }
     
 }


This is the page (ice:inputFile is in a ice:panelGrid):
Code:
<ice:inputFile actionListener="#{testactionDeveloper.fileUpload.upload}"
 					progressListener="#{testactionDeveloper.fileUpload.progress}"
 					style="margin-top: 30px;" id="upload" />
 				<ice:outputProgress id="pro"
                                     value="#{fileAdminBean.fileUpload.percent}"/>


Thanks for your help
Newlukai
Newlukai

Joined: 29/Nov/2006 00:00:00
Messages: 125
Offline


Please excuse me for constantly annoying you with this problem and my lack of knowledge. I'm still a student and I promise to read a good book about all that EE stuff (and I visit an English course) ;)

I had the idea to copy & paste your showcase code into my application today.

Test 1: SFSB "inputFileBackerBean". I created the interface "InputFileBacker" and the corresponding class "InputFileBackerBean" in my project and pasted the code from the sample (I only added two System.out.println() calls). I changed the xhtml to:
Code:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:s="http://jboss.com/products/seam/taglib"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:ice="http://www.icesoft.com/icefaces/component"
     template="template.xhtml">
 
 <ui:define name="content">
  <s:div styleClass="formBox">
   <ice:form id="showTestactionForValidator">
     <ice:panelGroup>
       <ice:inputFile
         progressListener="#{inputFileBackerBean.progressMonitor.progress}"
         actionListener="#{inputFileBackerBean.actionMonitor.action}"/>
       <ice:outputProgress id="pro"
         value="#{inputFileBackerBean.percent}"/>
       <ice:outputText
         value="File Name: #{inputFileBackerBean.fileName}"/>
       <ice:outputText
         value="Content Type: #{inputFileBackerBean.contentType}"/>
       <ice:messages/>
     </ice:panelGroup>
    </ice:panelGrid>
   </ice:form>
  </s:div>
 </ui:define>
 </ui:composition>


After starting the server and clicking on "Upload" an exception occured. server.log shows:

server.log wrote:
2008-04-16 16:48:28,732 DEBUG [org.jboss.seam.contexts.FacesLifecycle] <<< End JSF request for /ares/toDo.seam
2008-04-16 16:48:28,748 DEBUG [com.icesoft.faces.webapp.http.servlet.PathDispatcher] path: /ares/block/receive-updated-views
2008-04-16 16:48:28,844 DEBUG [org.jboss.seam.contexts.Lifecycle] >>> Begin call
2008-04-16 16:48:28,844 DEBUG [org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor] ++++ LongLivedSessionPropagationInterceptor
2008-04-16 16:48:28,844 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events
2008-04-16 16:48:28,844 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events
2008-04-16 16:48:28,844 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events
2008-04-16 16:48:28,844 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events
2008-04-16 16:48:28,844 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events
2008-04-16 16:48:28,844 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events
2008-04-16 16:48:28,844 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preSetVariable.inputFileBackerBean
# Seam creates and destroys components
2008-04-16 16:48:28,844 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preDestroy.org.jboss.seam.transaction.transaction
2008-04-16 16:48:28,844 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events
2008-04-16 16:48:28,844 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events
2008-04-16 16:48:28,844 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events
2008-04-16 16:48:28,844 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events
2008-04-16 16:48:28,844 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events
2008-04-16 16:48:28,844 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events
2008-04-16 16:48:28,844 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.postDestroyContext.EVENT
2008-04-16 16:48:28,844 DEBUG [org.jboss.seam.contexts.Lifecycle] <<< End call
2008-04-16 16:48:28,844 INFO [STDOUT] progress
2008-04-16 16:48:28,844 DEBUG [org.jboss.seam.contexts.FacesLifecycle] >>> Begin JSF request for /ares/toDo.seam
2008-04-16 16:48:28,844 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
2008-04-16 16:48:28,844 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
2008-04-16 16:48:28,844 DEBUG [org.jboss.seam.jsf.SeamPhaseListener] beginning transaction prior to phase: RESTORE_VIEW 1
2008-04-16 16:48:28,844 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
2008-04-16 16:48:28,844 DEBUG [org.jboss.seam.transaction.UTTransaction] beginning JTA transaction
2008-04-16 16:48:28,844 DEBUG [org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager] Attempting to activate; id=4sub52-yufk32-ff40mfjk-1-ff40qqlo-15
2008-04-16 16:48:28,844 ERROR [org.jboss.seam.jsf.SeamPhaseListener] uncaught exception
java.lang.IllegalStateException: Could not start transaction
at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:581)
at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsBeforePhase(SeamPhaseListener.java:312)
at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:140)
at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:114)
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:297)
at com.idsscheer.ares.InputFileBackerBean$InnerProgressMonitor.progress(InputFileBackerBean.java:111)
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:585)
at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
at com.icesoft.faces.component.inputfile.InputFile.setProgress(InputFile.java:822)
at com.icesoft.faces.webapp.http.core.UploadServer$ProgressCalculator.potentiallyNotify(UploadServer.java:150)
at com.icesoft.faces.webapp.http.core.UploadServer$ProgressCalculator.progress(UploadServer.java:125)
at com.icesoft.faces.webapp.http.core.UploadServer$1.update(UploadServer.java:45)
at org.apache.commons.fileupload.MultipartStream$ProgressNotifier.notifyListener(MultipartStream.java:136)
at org.apache.commons.fileupload.MultipartStream$ProgressNotifier.noteBytesRead(MultipartStream.java:125)
at org.apache.commons.fileupload.MultipartStream$ItemInputStream.makeAvailable(MultipartStream.java:966)
at org.apache.commons.fileupload.MultipartStream$ItemInputStream.close(MultipartStream.java:906)
at java.io.FilterInputStream.close(FilterInputStream.java:159)
at org.apache.commons.fileupload.util.LimitedInputStream.close(LimitedInputStream.java:153)
at org.apache.commons.fileupload.util.Streams.copy(Streams.java:119)
at org.apache.commons.fileupload.util.Streams.copy(Streams.java:64)
at com.icesoft.faces.component.inputfile.InputFile.upload(InputFile.java:200)
at com.icesoft.faces.webapp.http.core.UploadServer$2.servlet(UploadServer.java:70)
at com.icesoft.faces.webapp.http.servlet.ServletRequestResponse.detectEnvironment(ServletRequestResponse.java:222)
at com.icesoft.faces.webapp.http.core.UploadServer.service(UploadServer.java:48)
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:139)
at com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:35)
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:79)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:654)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:445)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:343)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:292)
at com.icesoft.faces.webapp.xmlhttp.BlockingServlet.service(BlockingServlet.java:54)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
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.LoggingFilter.doFilter(LoggingFilter.java:58)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
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.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.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
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:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.ejb.NoSuchEJBException: Could not find stateful bean: 4sub52-yufk32-ff40mfjk-1-ff40qqlo-15
at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:390)
at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:375)
at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:61)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:206)
at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:119)
at $Proxy233.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:585)
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:107)
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:576)
... 80 more 


Test 2: The example war deployment with "fileAdminBean" (Session bean but not @Stateful). Like in the test above I pasted the sample code (FileAdminBean, FileEntry and InputFileBean) and changed the xhtml to:
Code:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:s="http://jboss.com/products/seam/taglib"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:ice="http://www.icesoft.com/icefaces/component"
     template="template.xhtml">
 
 <ui:define name="content">
  <s:div styleClass="formBox">
   <ice:form id="showTestactionForValidator">
     <ice:panelGroup>
       <ice:inputFile id="inputFileName"
         progressListener="#{fileAdminBean.fileUpload.progress}"
         actionListener="#{fileAdminBean.fileUpload.action}" />
 
       <ice:outputProgress id="pro"
         value="#{fileAdminBean.fileUpload.percent}"/>
       <ice:outputText id="fileName"
         value="Uploading to File Name: #{fileAdminBean.fileUpload.currentFileName}"/>
       <ice:messages/>
     </ice:panelGroup>
    </ice:panelGrid>
   </ice:form>
  </s:div>
 </ui:define>
 </ui:composition>


I started the application and uploaded a file. After uploading an exception occured:

server.log wrote:
2008-04-16 17:07:29,864 DEBUG [org.jboss.seam.contexts.FacesLifecycle] <<< End JSF request for /ares/toDo.seam
2008-04-16 17:07:29,864 DEBUG [org.jboss.seam.contexts.Lifecycle] >>> Begin call
2008-04-16 17:07:29,864 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events
2008-04-16 17:07:29,864 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events
2008-04-16 17:07:29,864 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events
2008-04-16 17:07:29,864 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events
2008-04-16 17:07:29,864 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events
2008-04-16 17:07:29,864 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events
2008-04-16 17:07:29,864 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preSetVariable.fileAdminBean
# Seam creates and destroys components
2008-04-16 17:07:29,864 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.preDestroy.org.jboss.seam.transaction.transaction
2008-04-16 17:07:29,864 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events
2008-04-16 17:07:29,864 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events
2008-04-16 17:07:29,864 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events
2008-04-16 17:07:29,864 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.events
2008-04-16 17:07:29,864 DEBUG [org.jboss.seam.Component] initializing new instance of: org.jboss.seam.core.events
2008-04-16 17:07:29,864 DEBUG [org.jboss.seam.Component] done initializing: org.jboss.seam.core.events
2008-04-16 17:07:29,864 DEBUG [org.jboss.seam.core.Events] Processing event:org.jboss.seam.postDestroyContext.EVENT
2008-04-16 17:07:29,864 DEBUG [org.jboss.seam.contexts.Lifecycle] <<< End call
2008-04-16 17:07:29,864 DEBUG [com.icesoft.faces.webapp.http.servlet.PathDispatcher] path: /ares/block/receive-updated-views
2008-04-16 17:07:29,864 DEBUG [org.jboss.seam.contexts.FacesLifecycle] >>> Begin JSF request for /ares/toDo.seam
2008-04-16 17:07:29,864 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
2008-04-16 17:07:29,864 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
2008-04-16 17:07:29,864 DEBUG [org.jboss.seam.jsf.SeamPhaseListener] beginning transaction prior to phase: RESTORE_VIEW 1
2008-04-16 17:07:29,864 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
2008-04-16 17:07:29,864 DEBUG [org.jboss.seam.transaction.UTTransaction] beginning JTA transaction
2008-04-16 17:07:29,864 DEBUG [org.jboss.ejb3.cache.simple.StatefulSessionFilePersistenceManager] Attempting to activate; id=4sub52-ra9g70-ff41e7or-1-ff41f72x-13
2008-04-16 17:07:29,864 ERROR [org.jboss.seam.jsf.SeamPhaseListener] uncaught exception
java.lang.IllegalStateException: Could not start transaction
at org.jboss.seam.jsf.SeamPhaseListener.begin(SeamPhaseListener.java:581)
at org.jboss.seam.jsf.SeamPhaseListener.handleTransactionsBeforePhase(SeamPhaseListener.java:312)
at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:140)
at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:114)
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:297)
at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.executeAndRender(PersistentFacesState.java:345)
at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState$RenderRunner.run(PersistentFacesState.java:383)
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:595)
Caused by: javax.ejb.NoSuchEJBException: Could not find stateful bean: 4sub52-ra9g70-ff41e7or-1-ff41f72x-13
at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:390)
at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:375)
at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:61)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:206)
at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:119)
at $Proxy232.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:585)
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:107)
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:576)
... 11 more
2008-04-16 17:07:29,864 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.exception.exceptions 


So I really tried to do it "your way" and used your code. But as I'm still faced with this Seam transaction problem I think that I made a mistake in the configuration of my app.
Or could it be possible that it has something to do with EJB transaction? I had this idea because one of your examples uses entity-transaction, not ejb-transaction as I do. And the other one (which uses the container's default transaction) is a WAR deployment, but I have an EAR.

Here's my components.xml:
Code:
<?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:transaction="http://jboss.com/products/seam/transaction"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="
   http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
   http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.0.xsd
   http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
   http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd
   http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd">
  
   <core:init  jndi-pattern="Ares-ear/#{ejbName}/local"
      transaction-management-enabled="true"
      debug="false"
      />
   
   <core:manager concurrent-request-timeout="500"
       conversation-id-parameter="cid"
       conversation-timeout="120000"
       />
   
   <core:resource-loader>
    <core:bundle-names>
     <value>com.idsscheer.ares.resources.ares_messages</value>
    </core:bundle-names>
   </core:resource-loader> 
   
   <transaction:ejb-transaction/>
   
   <persistence:managed-persistence-context name="em" auto-create="true" persistence-unit-jndi-name="java:/entityManagerFactories/aresData"/>
   
   <security:identity authenticate-method="#{login.authenticate}" remember-me="false"/>
   
   <component class="org.jboss.seam.web.MultipartFilter">
    <property name="createTempFiles">true</property>
    <property name="maxRequestSize">1000000</property>
    <property name="urlPattern">*.seam</property>
   </component>
 
   <!-- <component name="upDownload" class="com.idsscheer.ares.business.UpDownloadDatabase" auto-create="true">
    <property name="tempDir">D:\\tempForAres</property>
   </component> -->
   <component auto-create="true" class="com.idsscheer.ares.business.UpDownloadFilesystem" name="upDownload" scope="session">
    <!-- <property name="tempDir">/home/ol/ares/tmp</property>
    <property name="filesDir">/home/ol/ares/filestore</property> -->
    <property name="tempDir">T:\\aresTemp</property>
    <property name="filesDir">T:\\aresAnubisDump</property>
   </component>
 </components>
 
Forum Index -> JBoss Seam Integration
Go to:   
Powered by JForum 2.1.7ice © JForum Team