1
votes

im trying to upload a file with like this:

        <h:form>
            <rich:fileUpload fileUploadListener="#{bean.test}"
                id="upload" acceptedTypes="jpeg, jpg, gif, png, bmp">
                <a4j:ajax event="uploadcomplete" render="preview" />
            </rich:fileUpload>

        </h:form>

But I always get the Error:

 Servlet.service() for servlet [Faces Servlet] in context with path [/project] threw exception
java.lang.UnsupportedOperationException
at javax.faces.context.FacesContext.getExceptionHandler(FacesContext.java:280)
at javax.faces.context.FacesContextWrapper.getExceptionHandler(FacesContextWrapper.java:354)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:119) 
at ......

I used the before, and it worked fine. I just cant see my mistake.

The Upload Box of it shows, I can add a file. The error appears when i push "upload" and the listener-method (public void test(FileUploadEvent event){..}) is not called.

any idea how i can solve this?

1
Are yo using RichFaces 4.1 with MyFaces Orchestra? See also community.jboss.org/message/633078BalusC
Im using RichFaces 4.1 with TomCat v7.0. But that cant be the problem, because im using the same versions for the other project(small, not so many libraries) too, where fileUpload works.user1338413
So, you're not using MyFaces Orchestra at all?BalusC
oh sorry. im using MyFaces Orchestra 1.4.user1338413
Okay, there is the cause of the problem. See thus the aforelinked JBoss forum link.BalusC

1 Answers

0
votes

I had a similar issue and it turned out that in my packaged war file apart from myfaces-orchestra-core20 I also got myfaces-orchestra-core12 which slipped in from another dependency.

Having only that declared in my pom.xml file:

<dependency>
      <groupId>org.apache.myfaces.orchestra</groupId>
      <artifactId>myfaces-orchestra-core20</artifactId>
      <version>1.5</version>
</dependency>

and Richfaces verison 4.3.7.Final made it finally work.