Saturday, December 13, 2014

How To Set EAR Upload Size for Oracle Enterprise Manager

By default, there is a limit for EAR upload size (~40 MB) in Enterprise Manager. If your ADF application is fairly big, you may face this limitation and will not be able to deploy through Enterprise Manager. Deployment for large EAR would work through WebLogic console, WLST script or directly from JDEV, however sometimes you may need to deploy through Enterprise Manager. I will describe in this post, how you could increase the limit - we are going to extract Enterprise Manager application EAR and change maximum file upload size specified in web.xml.

In my case, the requirement was to be able to deploy ~47 MB EAR file:


When trying to deploy this EAR through Enterprise Manager, I would get the error about maximum file upload size exceeded:


You must navigate to the folder, where applications are deployed for your domain (alternatively, double check in WLS for EM application, where EAR file is stored). There must be one called em.ear, this is the deployment for Enterprise Manager application:


Extract this EAR (make sure to create backup), you will find em.war file inside - we need this file:


Extract em.war file now. Navigate to WEB-INF folder, you will find web.xml file there. Open web.xml file for editing:


Search for org.apache.myfaces.trinidad.UPLOAD_MAX_DISK_SPACE parameter in web.xml and change its value to be large enough to accept the size of EAR file you want to deploy. I have set it to 50 MB = 52428800 bytes:


Make sure to pack everything back, and keep original em.war and em.ear files structure:


After all the are changes applied, large EAR file is accepted in Enterprise Manager and we can proceed with the deployment:

3 comments:

Binh Nguyen said...

Thanks, nice post

R said...

Hello Andrejus !

Do you have a blog which talks about pros and cons of using shared-libraries? I have a EAR file which has grown to 41MB due to lot of third party libraries (some are used in other projects too). What is the best approach?
1) Leave it as it is? Benefit is that when EAR is undeployed/redeployed the cleanup is efficient. With shared libraries the hard references may cause issues.
2) Create a new Project, add all libraries there and deploy it as shared library?

I would also like to take this opportunity to thank you for your awesome blog !

Cheers
Ravi

Andrej Baranovskij said...

I would create shared library for third party libs, to minimize size of EAR.

Regards,
Andrejus