1 Reply Latest reply on Jul 16, 2007 8:40 AM by Carlos Zaniolo

    s:fileupload control problem with Ajax

    Kien Wah Lim Newbie

      Hi,

      I get a NullPointerException when submitting a form that contains s:uploadfile control in Seam 1.2.1GA. Refer code below.

      I can submit the form successfully using the JSF commandButton control. However, when I click on the Ajax4Jsf commandButton, JBoss give a NullPointerException. Has anyone encounter the same problem?

      Thanks.



      <h:form enctype="multipart/form-data">
       <div class="prop">
       <div class="rectangle">
       <table width="100%" cellspacing="1" cellpadding="1" border="1">
       <tr>
       <td>
       <div class="valueInline">
       <h:inputText value="#{entityBean.primaryName}" size="40" />
       </div>
       </td>
       </tr>
       <tr>
       <td colspan="3">
       <div class="name">
       <h:outputLabel for="pictureLogo">Logo</h:outputLabel>
       </div>
       <div class="valueInline">
       <s:fileUpload id="pictureLogo" data="#{entityBean.logo}" size="80" />
       </div>
       </td>
       </tr>
       </table>
       </div>
       <div>
       <a:commandButton value="Save" action="#{restaurantWorker.addRestaurant}" />
       <h:commandButton value="Save" action="#{restaurantWorker.addRestaurant}" />
       </div>
      </h:form>


      Caused by: javax.faces.el.EvaluationException: /addInfo2.xhtml @58,78 action="#{actionBean.method}": javax.ejb.EJBTransactionRolledbackException: java.lang.NullPointerException
      at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:73)
      at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
      ... 44 more
      Caused by: javax.ejb.EJBTransactionRolledbackException: java.lang.NullPointerException
      at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:93)
      at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
      at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
      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:102)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
      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:203)
      at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)
      at $Proxy284.addRestaurant(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:20)
      at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
      at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:72)