This discussion is archived
1 Reply Latest reply: Sep 10, 2013 11:56 PM by user9501145 RSS

JSF(2.1 & 2.2) upload problem Weblogic 12.1.1

user9501145 Newbie
Currently Being Moderated

Hi all.

 

I'm trying to configure an upload element with JSF, running on Weblogic 12.1.1.

I tried this both with JSF 2.1 (custom component, custom filter) and the new h:inputFile tag in JSF 2.2

And with both implementations I'm getting the same error from Weblogic: weblogic.servlet.utils.fileupload.SizeException: The field myElementId exceeds its maximum permitted  size of 0 characters

 

I already found where the problem is coming from: Weblogic seems to ignore the max-file-size setting(part of the multipart-config tag) in the web.xml

<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
   <multipart-config>
        <location>/tmp</location>
        <max-file-size>20848820</max-file-size>
        <max-request-size>418018841</max-request-size>
        <file-size-threshold>1048576</file-size-threshold>
      </multipart-config>
  </servlet>


Without the <multipart-config> part, nothing happened when clicking the upload button. So Weblogic is using the multipart-config tag, but not the max-file-size tag.

On Glashfish it all works fine. So the configuration seems to be OK. And the problem seems to be Weblogic related.

 

Finally, to doublecheck, we modified the FacesServlet class (JSF 2.2, org.apache.myfaces 2.2.0-SNAPSHOT version) itself with the @MultipartConfig annotation

@MultipartConfig(maxFileSize = 10485760L)

public final class FacesServlet implements Servlet

{

...

 

And this worked!

 

so finally my question :-)

How can I set the maxFileSize on Weblogic in a 'normal' way?  Am I missing something? Is there maybe a weblogic.xml setting for this?

 

 

Thanks,

Jorden

 


Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points