Thursday, February 5, 2015

Weblogic Admin Server upload too big

Environment / assumptions in this post:

  • Weblogic 10.3.6
  • Enterprise Manager 11.1.1.6.0
  • Custom ADF Fusion Web Application (EAR file)

In a nutshell, the default upload limit size for Enterprise Manager 11.1.1.x is 40Mb, but it can be changed.

So I was trying to deploy one of our larger custom ADF applications to our Test environment the other day. I was minding my own business when all of a sudden, from behind the bushes, just kidding. No scary animals or nefarious characters here, just an uncooperative Enterprise Manager. In this case, it is Weblogic 10.3.6 and EM version 11.1.1.6.0.

Error when trying to upload the application archive -
"The file could not be uploaded because it is too large"
Turns out there is a rational explanation. There is a baked-in hard limit of 40Mb in the Enterprise Manager ear file controlled by a Trinidad configuration parameter in the web.xml file called:

 org.apache.myfaces.trinidad.UPLOAD_MAX_DISK_SPACE 

You only need to extract the war file from the em.ear file, then modify the web.xml and assemble it all back together.

Here are the steps that worked for our particular install (linux):
  1. Go to where the em.ear file is located, under .../user_projects/applications/<domain>

    cd /u01/app/oracle/product/fmw/user_projects/applications/MyDomain
     
  2. Backup the em.ear file somewhere, just in case you mess up.
  3. Copy the em.ear file to a temp folder:

    mkdir ~/em_tmp
    cp em.ear ~/em_tmp
     
  4. Extract the war file only:

    cd ~/em_tmp
    jar -xvf em.ear em.war
     
  5. Extract the web.xml from the war file:

    jar -xvf em.war WEB-INF/web.xml
     
  6. Modify parameter in WEB-INF/web.xml as follows:

  7. old:
      <context-param>
        <param-name>org.apache.myfaces.trinidad.UPLOAD_MAX_DISK_SPACE</param-name>
        <param-value>40960000</param-value>
      </context-param>
    
    new: set some larger value, e.g. 75mb = 1024 x 1024 x 75 = 78643200
    <context-param>
       <param-name>org.apache.myfaces.trinidad.UPLOAD_MAX_DISK_SPACE</param-name>
       <param-value>78643200</param-value>
    </context-param>


  8. Update the war file

    jar -uvf em.war WEB-INF/web.xml
     
  9. Update the ear file with the new war file

    jar -uvf em.ear em.war
     
  10. Copy the ear file back again, and bounce the admin server
Some relevant links

Trinidad Configuration:
https://myfaces.apache.org/trinidad/devguide/configuration.html

Upload File Portlet Does NOT Warn File Size Limit (Doc ID 1530144.1)
https://support.oracle.com/epmos/faces/DocContentDisplay?id=1530144.1

Bug 16079700 : [WCP11164]UPLOAD FILE PORTLET DOES NOT WARN FILE SIZE LIMIT
https://support.oracle.com/epmos/faces/BugDisplay?id=16079700

1 comment:

  1. Lucky Club Casino Site | Free Bets for new players
    Lucky Club Casino is an amazing online casino that is offering a fantastic gambling experience that is fun to play. You'll enjoy an array of live games luckyclub.live

    ReplyDelete