Liferay on AWS Elastic Beanstalk, Configure for RDS and S3

Deploying Liferay on AWS Elastic Beanstalk, Configuring RDS for database,
S3 for data folder and Scaling Liferay using Load Balancer on Cloud

Pre-requisites: 

Creating EBs Instance
  • Create New Application
Click on  AWS Home (Yellow box at t op left corner of page ) and navigate to Elastic Beanstalk service. 
Click “Create New Application” to create your application. Provide necessary info required e.g. shown below
 
 
  • Configure Environment Type
Configure Environment Type as applicable for your application, In below case we are using Web Server, Tomcat 7 with Java 6 on 64 bit Linux machine.
Select Environment Type as Load balancing, auto scaling (utilize the feature of AWS as we want our application to scale up / down depending on load balancer configuration).
  •    Select Application
Since we are doing initial setup of Elastic Beanstalk instance we will select sample application for first time and click continue.
(You can upload your application here but we still need to configure our application war and also complete the setup / configure environment) so we select sample application initially.
  • Configure Environment
Provide Environment Information for your application. E.g. Env you are creating could be Development Env, QA Env, Prod Env, etc. 
  • Create RDS DB
Select check box to “Create RDS DB Instance with this environment” to create database associated with this env
  • Configure EBs Instance
Configure your Instance, Instance type micro are cheap but it depends on application whether it can run on Micro (Micro instances will be slow if application is heavy). In our E.g. we will use m1.large, EC2 Key pair ( Created under Network & Security  to  access  EC2 instance). Provide other necessary details (self-explanatory)
  • RDS Configuration
Select the Instance class for database instance db.m1.micro should also work (but this also depends on your application)
E.g. we will use db.m1.large and allocate min 5 GB storage, give username & password that will be used to access your DB. Remember the default database name is “ebdb” where all the tables will get created. If you need to configure different database name you would need to create separate RDS instance for database where you can have advance configuration option for your database instance. RDS through EBs has limited config.
Select retention setting as desired and Select the availability as Multiple Availability Zones to have instance availability in other zones if you have configured your application for load balancing similar to your application
  • Review Configurations
As last Review Information to check your configuration is proper and Save to complete environment creation.
The environment setup will begin to create your application instance, database instance and this will take 10-15 mins to complete.

You will see below screen where events will be logged to check the status, Wait for the Health to turn in Green.
  • Configure Container option
Once the environment healths turn to green click on configuration & selects Container Option & update your JVM heap size to avoid pergem out of memory issue.
 
  • Modify RDS DB instance
From AWS Home Navigate to RDS, select your Instance and right click to Modify configuration. Provide your Parameter Group (E.g. M1 Parameter Group created to have UTF-8 encoding for tables, default parameter is not UTF-8 and Latin which might create issue later for application, so create your Parameter Group with desired encoding and select for db instance before the tables are created) and Security group (where accessibility to instance is maintained through inbound / outbound rules) Ref:  Working with Security Group
Select Apply Immediately and Continue.
  • Reboot RDS Instance
It will take few mins to modify your RDS check the status and wait till it says “Pending Reboot” and
Then Right Click your RDS instance to “Reboot” it. 
This step is important as RDS Instance needs to be rebooted before tables are created, Reboot will update your DB instance to have UTF-8 encoding and default to tables created thereafter.
 
Importance Details for RDS:
You will get the endpoint (host) & port to access your RDS database instance
User name & Password is the one you had configured earlier
DB Name: ebdb
Your Elastic Beanstalk instance (EBS) & RDS instance are ready for use...
  • Create S3 bucket for storing liferay data folder
From AWS home click on S3 “Create Bucket” provide Bucket Name & Region and click “Create”
Customizing Liferay war that is ready to deploy on AWS EBs instance (Configured to use RDS for database and S3 for liferay data folder)
 

Approach
 
Our goal is to deploy Liferay standalone war on tomcat 7 along with dependencies & additional tomcat configuration but without manual following these steps and automate it as our liferay application war needs to be scalable & should be deployable on other EBS instance when the additional instance is automatically up in Load Balancing.

So we will work on customizing liferay war to automate steps through AWS script & overcome issues, below are steps
Before starting go through below links for understanding AWS EBS way of customization the application
 
1. To start we will create .ebextensions folder which will have your .config file listing the commands it needs to run on EBS instance along with files you need for your application setup.
liferay-*.war is the fresh stand alone war which we will be customizing for it to be ready deploy on AWS EBs
2. Now let’s understand what will be there in the .ebextensions folder
  • ext folder: having all the dependency jar that need to be copied to tomcat7/lib/ext
  • .config: listing your cmds
  • installcmd.sh: having script to install s3cmd on EBS instance this is require for configuring s3
  • .s3cfg: file require for accessing the AWS s3 (this file will have your access_key & security_key) more about .s3cfg & s3cmd
  • catalina.properties, ROOT.xml, server.xml, setenv.sh: These files are copied from liferay-tomcat bundle as we will require to setup tomcat 7
  • portal-ext.properties: file will have properties for pointing liferay home, database config, s3 confg.
3. 01_liferaysetup.config : EBS ebextensions .config file. This file will be read and cmds mentioned will be executed when liferay war is uploaded & getting deployed on tomcat 7
 
To explain in short for cmd in below file,
  • cp will copy files from .ebextensions/ folder to respective path mentioned below
  • chmod for making the file executable with ec2-user
  • mkdir to create folder at desired path
  • chown to change user ownership with right permission for files & folder
  • /bin/bash ./installcmd.sh for running the shell script to install s3cmd
  • s3cmd -c /home/ec2-user/.s3cfg get -f s3://liferay-data/Deploy/*.war /usr/share/tomcat7/deploy
above s3cmd uses the .s3cfg file having your access credentials to access s3 and s3 bucket location where your wars will be present and
destination folder where you want the files to be copied to from s3. ( /usr/share/tomcat7/deploy is default path where the Tomcat7 will be installed in EBs )
4. portal-ext.properties –
  • Make sure liferay home is set correctly which point to stand alone tomcat 7
  • Setup wizard is set false as we don’t want user to see the configuration screen when liferay war will be deployed to other instances when load balancer & scaling is set. (i.e. when liferay war is deployed in new instance it will not find portal-setup-wizard.properties and it will present user with Portal Configuration screen)
  • Set appropriate DB config endpoint with port, credentials for your RDS instance you configured above
  • Set your access credentials of AWS EC2 for configuring s3 and provide bucket name which will be your liferay-data folder
Once you have correctly configured portal-ext.properties add it to your custom liferay-*.war at respective location /WEB-INF/classes/
5. installcmd.sh : It has executable script that will install s3cmd on EBS instance, this cmd is required to access s3 bucket
6. .s3cfg : you can get this config file for s3 by installing s3cmd where you would be required to input access_key, secret_key
Reference Link :  Install s3cmd
Add .ebextensions to Custom Liferay war
 
By now you are aware of .ebextensions, .config file & files required for setting up liferay.
Add this .ebextensions folder once it’s completely ready for your liferay application & add it to root level of your liferay-*.war as shown below in first image & verify your files are present in./ebextensions folder.
Your custom liferay-*.war is now ready to Deploy on AWS EBs 
  • Upload and Deploy Application

Navigate to your environment and Click on “Upload and Deploy”
 
Choose your custom liferay war & give Version Label and click “Deploy”. These versions are maintained and you can see them in All Version where you can manage version and deploy specific version on your environment.
Verify your steps for errors
  • Watch the Logs for any error in AWS EBs instance for your environment (logs can also be viewed by click on Snapshot logs)
  • SSH your EBS instance & verify whether your cmd in .config executed properly by browsing the files & folder, permission, etc
 
AWS References for Advance Setup:

More Blog Entries

Blogs
Hi Ankit,

EXCELLENT post on hosting Liferay on Amazon Bean Stalk. Let me try it when i get time and share my inputs with you. Thanks for contributing. The steps appear very similar to hosting Liferay on JElestic. Have you ever tried that? By the way, what is the performance of Liferay after deploying to Bean Stalk?

With Regards,
Ahamed Hasan
Author of Liferay Cookbook
http://mpowerglobal.com/download-cookbook
Thanks Ahmed, your inputs are welcome and do let me know in case of any queries so it helps others in community who are looking for similar architecture and setup on AWS.
I was unable to run liferay 6.2 on AWS EBs t1.Micro when it is configured to AWS RDS & S3 due to OutOfMemoryError and Could not reserve enough space for object heap because of which tomcat7 startup will fail. However Liferay 6.2 with hypersonic database on Mirco should work by tweaking jvm settings.
Performance / Page rendering is better in AWS m1.medium instance and pretty Good in m1.large instance.

Thanks,
Ankit Pancholi | liferayconnect.blogspot.com
Hello Ankit,

Thank you very much for this excellent post! Me and my team managed to install Liferay on AWS following your steps.

I'm looking at the log files right now, and I've noticed the following warn message:

19:20:26,254 WARN [liferay/document_library_pdf_processor-1][RestStorageService:221] Content-Length of data stream not set, will automatically determine data length in memory

I reviewed my configuration and couldn't figured out what's causing that. Are you having the same message?

Regards,
Juliana Myaki
Thanks Juliana, Glad the steps helped you configure the same.

Yes I was also getting the similar Warning message whenever I was uploading the documents in Liferay. Though it wont break anywhere I think. Its just warning while the document is store in external file system.
Do you encountered issue https://issues.liferay.com/browse/LPS-42849 ?

Thanks,
Denis.
Denis, I did not encountered the issue I was able to successfully upload the document to S3 Storage bucket from portal. The above setup has the Liferay bundle installed on AWS apps server so might be the case Apache Client libraries are updated on AWS.
Can you please attach the source files for the long commands in the PNG images ?
I have pasted below cmds for file 01_liferaysetup.config

container_commands:
01-copy-setenv:
command: "cp .ebextensions/setenv.sh /usr/share/tomcat7/bin"
02-change-mod:
command: "chmod 755 /usr/share/tomcat7/bin/setenv.sh"
03-copy-rootxml:
command: "cp .ebextensions/ROOT.xml /usr/share/tomcat7/conf/Catalina/localhost"
04-change-own:
command: "chown root.tomcat /usr/share/tomcat7/conf/Catalina/localhost/ROOT.xml"
05-copy-serverxml:
command: "cp .ebextensions/server.xml /usr/share/tomcat7/conf"
06-copy-catalina:
command: "cp .ebextensions/catalina.properties /usr/share/tomcat7/conf"
07-make-deploy:
command: "mkdir -p /usr/share/tomcat7/deploy"
08-chg-own:
command: "chown root.tomcat /usr/share/tomcat7/deploy"
09-make-extdir:
command: "mkdir -p /usr/share/tomcat7/lib/ext"
10-copy-extlib:
command: "cp .ebextensions/ext/*.jar /usr/share/tomcat7/lib/ext"
11-change-owner:
command: "chown root.tomcat /usr/share/tomcat7/lib/ext"
12-install-s3cmd:
command: "/bin/bash .ebextensions/installcmd.sh"
13-set-env:
command: "/bin/bash /usr/share/tomcat7/bin/setenv.sh"
14-copy-s3config:
command: "cp .ebextensions/.s3cfg /home/ec2-user/.s3cfg"
15-read-only:
command: "chmod 600 /home/ec2-user/.s3cfg"
16-deploy-war:
command: "s3cmd -c /home/ec2-user/.s3cfg get -f s3://lfr-data/Deploy/*.war /usr/share/tomcat7/deploy"
17-chown-war:
command: "chown -R root.tomcat /usr/share/tomcat7/deploy"
18-chmod-war:
command: "chmod -R 777 /usr/share/tomcat7/deploy"
FYI - anything you put in setenv.sh has zero effect on a Tomcat instance running via elasticbeanstalk. The AWS tomcat startup process does not consult this file.
Yes Narf I encountered similar problem the script in setenv.sh gets executed, but it does not have any effect on EB instance of Tomcat.
The work around is, from AWS home > navigate to your EB instance > click on Configuration > Container Options and specify JVM property. eg.
Initial JVM heap size: 1024m
Maximum JVM heap size: 1024m
Maximum JVM permanent generation size: 512m
Hi Ankit,

I followed your steps but after deployment when I click on the link I get http status 404 from Apache Tomcat. Do you have any clue what the error might be?
I hope you have gone through the blog in detail ? and performed setup applicable to your environment.
which link is giving the error ? and share detail error log so I could provide further input.
If you have deployed custom-liferay.war following above steps in Elastic Beanstalk instance, it will deploy the application in /usr/share/tomcat7/webapps

check the catalina.out log file in /usr/share/tomcat7/logs for error
Hi Ankit,
I followed your instructions on creating the config file to copy the global tomcat jar files to the correct location but getting the following error in the catalina.out log:-

Caused by: java.lang.NoClassDefFoundError: com/liferay/portal/kernel/bean/BeanLocator

I am using the t1.micro instance, with no RDS or S3, just using the HSQL database as supplied by Liferay. The war file is the Liferay6.2.1 war file and I extracted the global jars from the Liferay6.2.1/Tomcat bundle. I tested that the config script is working by including a shell script which writes out to a log and that was successful.

Any suggestions on what I can try next to resolve this problem other than scaling up the instance size?

Thanks
Mashuk
Verify the jar file has this class definition ? it could be tomcat class loading issue.
Also check this link: https://issues.liferay.com/browse/LPS-28891
If the jar file is placed at correct directory and have the class definition, try restarting the server.
In the container_commands instead of copying the global jar files to an ext folder, I copied them to the /usr/share/tomcat7/lib folder and also used a t2.small instance and that made it work.
Hi Ankit, Have you any experience with deploying portlets on EC2 instances? As far as I have understood, there is a functionality called OpsWorks to deploy Apps to the server. With the default deployment script I couldn't deploy a portlet to liferay. How do you deploy portlets to EC2 instances?
With regards Nish
Using your AWS IAM keys connect to your EC2 instance via winscp or filezilla to upload your portlets war either directly to liferay deploy folder (but there might be permission issue if appropriate permissions is not set on the deploy folder and it might not be able to read it) in that case you can copy war to user home dir and via shell prompt (like putty). give appropriate permission on your war and copy it to your liferay deloy folder. I have'nt got chance to explore/deploy it using OpWorks but If you understand how it works you should be able to figure out the application deployment.
Hi Ankit, I tried to setup liferay on aws beanstalk according your blog, but unfortunately I always have trouble with the liferaysetup_01.config file. Its always the description before the command key that throws an error. I changed them in many ways but everytime I get he same error on a different lines. Last error was this one

Error processing file (Skipping): '.ebextensions/01_liferaysetup.config' - Contains invalid key: '17changeowner'. For information about valid keys, see http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html

Do have an Idea why this is happening and how I can avoid it?
Hi Ankit, I tried to setup liferay on aws beanstalk according your blog, but unfortunately I always have trouble with the liferaysetup_01.config file. Its always the description before the command key that throws an error. I changed them in many ways but everytime I get he same error on a different lines. Last error was this one

Error processing file (Skipping): '.ebextensions/01_liferaysetup.config' - Contains invalid key: '17changeowner'. For information about valid keys, see http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html

Do have an Idea why this is happening and how I can avoid it?
Error processing file (Skipping): '.ebextensions/01_liferaysetup.config' - Contains invalid key: '17changeowner'. For information about valid keys, see

One best way to deal with errors is to run the commands manually first, on your Elastic BeanStalk intances, connect via shell prompt and validate the commands. Alternatively check the error logs on your instance there will be appropriate directory for AWS .ebs where you might find the error details.
Hi Ankit,

Thanks for the excellent post and detailed steps.

Moving forward, can you please tell you have done Liferay setup on AWS with community edition or Enterprise edition ?
If you have used Liferay Enterprise edition, it requires Liferay license. How license deployment will be managed at the time of auto scaling. When a new node enters in the system, how license deployment will be done automatically ?

Please provide your views.

Thanks in advance !!
Hi Ankit, I tried to setup liferay on aws beanstalk according your blog, but unfortunately I always have trouble with the liferaysetup_01.config file. Its always the description before the command key that throws an error. I changed them in many ways but everytime I get he same error on a different lines. Last error was this one

Error processing file (Skipping): '.ebextensions/01_liferaysetup.config' - Contains invalid key: '17changeowner'. For information about valid keys, see http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html

Do have an Idea why this is happening and how I can avoid it?
Hi Ankit, I tried to setup liferay on aws beanstalk according your blog, but unfortunately I always have trouble with the liferaysetup_01.config file. Its always the description before the command key that throws an error. I changed them in many ways but everytime I get he same error on a different lines. Last error was this one

Error processing file (Skipping): '.ebextensions/01_liferaysetup.config' - Contains invalid key: '17changeowner'. For information about valid keys, see http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html

Do have an Idea why this is happening and how I can avoid it?
I have posted some updates to getting LR 7 working on the new EB with Tomcat 8 and Java 8.

https://web.liferay.com/community/forums/-/message_boards/message/80551673
That's Great Tim, Thanks. it will be useful for community.
HI ANKIT PANCHOLI

I have configure liferay portal 7.0 with "S3 Store Configuration" (System Settings).

Now,I am trying to download file from "S3 AWS".

1. Added dependency ( compile group: 'com.amazonaws', name: 'aws-java-sdk-s3', version: '1.11.119' ).
2. included aws-java-sdk-s3-1.11.119.jre7.jar file into tomcat/lib/ext.
3. Deployed my module.
4. Restarted liferay portal server.

After doing above steps, module is not started.
Did you check your module with diag <bundle ID> in Felix Gogo shell, it should tell why your module bundle is not working

https://dev.liferay.com/develop/reference/-/knowledge_base/7-0/using-the-felix-gogo-shell
HI ANKIT PANCHOLI

Thanks for the reply.

I Tried this diag <bundle ID> , I got this

Unresolved requirement: Import-Package: com.amazonaws.auth
Hi Ankit Pancholi - I have managed to setup Liferay 6.2 ce on AWS using EB, everything works fine except the Server Administration tab and Portal instance tabs are blank If click on Server Administration button just a blank page appears. I have downloaded liferay-portal-6.2-ce-ga6-20160112152609836 and tried to install from scrath few times but still facing the same issue. Any recommendations?
Hi Jawad, Did you check the server logs for any error ? catalina.out ?
Are you accessing the liferay instance through IP ? If yes try adding the IP in below properties in portal-ext.properties and check once.
redirect.url.ips.allowed=127.0.0.1,SERVER_IP
Hi Ankit - Thanks for your response. I have added the IP address in portel-ext.properties and restarted the server but getting the same issue. Here is the error in cataline.out
An error occurred at line: [560] in the generated java file: [/usr/share/tomcat7/work/Catalina/localhost/_/org/apache/jsp/html/portlet/admin/view_jsp.java]
The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit

Stacktrace:
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:366)
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:490)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:379)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:341)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:662)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:364)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:743)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:603)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:542)
at com.liferay.portal.servlet.DirectServletPathRegisterDispatcher.include(DirectServletPathRegisterDispatcher.java:55)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:295)
at com.liferay.taglib.util.IncludeTag.doInclude(IncludeTag.java:192)
at com.liferay.taglib.util.IncludeTag.doEndTag(IncludeTag.java:83)
at org.apache.jsp.html.common.themes.portlet_jsp._jspService(portlet_jsp.java:4581)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:743)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:603)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:542)
at com.liferay.portlet.PortletRequestDispatcherImpl.dispatch(PortletRequestDispatcherImpl.java:331)
at com.liferay.portlet.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:128)
at com.liferay.portal.struts.PortletRequestProcessor.doInclude(PortletRequestProcessor.java:370)
at com.liferay.portal.struts.PortletRequestProcessor.doForward(PortletRequestProcessor.java:338)
at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:239)
at org.apache.struts.tiles.TilesRequestProcessor.internalModuleRelativeForward(TilesRequestProcessor.java:341)
at org.apache.struts.action.RequestProcessor.processForward(RequestProcessor.java:572)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:221)
at com.liferay.portal.struts.PortletRequestProcessor.process(PortletRequestProcessor.java:234)
at com.liferay.portlet.StrutsPortlet.include(StrutsPortlet.java:287)
at com.liferay.portlet.StrutsPortlet.doView(StrutsPortlet.java:157)
at com.liferay.portal.kernel.portlet.LiferayPortlet.doDispatch(LiferayPortlet.java:235)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:262)
at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:103)
at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:55)
at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
at com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:597)
at com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:656)
at com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:362)
at org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:1264)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
at com.liferay.portlet.PortletContainerImpl._doRender(PortletContainerImpl.java:638)
at com.liferay.portlet.PortletContainerImpl.render(PortletContainerImpl.java:135)
at com.liferay.portlet.SecurityPortletContainerWrapper.render(SecurityPortletContainerWrapper.java:141)
at com.liferay.portlet.RestrictPortletContainerWrapper.render(RestrictPortletContainerWrapper.java:126)
at com.liferay.portal.kernel.portlet.PortletContainerUtil.render(PortletContainerUtil.java:156)
at com.liferay.portal.layoutconfiguration.util.velocity.TemplateProcessor.processMax(TemplateProcessor.java:171)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:389)
at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:378)
at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:270)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:262)
at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:342)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336)
at org.apache.velocity.Template.merge(Template.java:328)
at org.apache.velocity.Template.merge(Template.java:235)
at com.liferay.portal.velocity.VelocityTemplate.processTemplate(VelocityTemplate.java:112)
at com.liferay.portal.template.AbstractTemplate.processTemplate(AbstractTemplate.java:108)
at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.doProcessTemplate(RuntimePageImpl.java:375)
at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.doDispatch(RuntimePageImpl.java:284)
at com.liferay.portal.layoutconfiguration.util.RuntimePageImpl.getProcessedTemplate(RuntimePageImpl.java:96)
at com.liferay.portal.layoutconfiguration.util.RuntimePageUtil.getProcessedTemplate(RuntimePageUtil.java:38)
at org.apache.jsp.html.portal.layout.view.control_005fpanel_jsp._jspService(control_005fpanel_jsp.java:915)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:439)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:743)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:603)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:542)
at com.liferay.portal.action.LayoutAction.includeLayoutContent(LayoutAction.java:302)
at com.liferay.portal.action.LayoutAction.processLayout(LayoutAction.java:413)
at com.liferay.portal.action.LayoutAction.doExecute(LayoutAction.java:200)
at com.liferay.portal.action.LayoutAction.execute(LayoutAction.java:95)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:168)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:557)
at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:534)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:743)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:485)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:410)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:337)
at com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:161)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
at com.liferay.portal.servlet.filters.uploadservletrequest.UploadServletRequestFilter.processFilter(UploadServletRequestFilter.java:93)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:123)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
at com.liferay.portal.servlet.filters.secure.SecureFilter.processFilter(SecureFilter.java:308)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
at com.liferay.portal.servlet.filters.i18n.I18nFilter.processFilter(I18nFilter.java:254)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
at com.liferay.portal.servlet.filters.etag.ETagFilter.processFilter(ETagFilter.java:86)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
at com.liferay.portal.servlet.filters.jsoncontenttype.JSONContentTypeFilter.processFilter(JSONContentTypeFilter.java:42)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:268)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
at com.liferay.portal.servlet.filters.sso.ntlm.NtlmPostFilter.processFilter(NtlmPostFilter.java:83)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:169)
at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:226)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:185)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)
at com.liferay.portal.servlet.filters.urlrewrite.UrlRewriteFilter.processFilter(UrlRewriteFilter.java:57)
at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:59)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:204)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:109)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:165)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:165)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:185)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)

13:05:57,861 ERROR [http-bio-8080-exec-1][IncludeTag:129] Current URL /group/control_panel?refererPlid=20185&p_p_id=137 generates exception: Unable to compile class for JSP: _An error occurred at line: [560] in the generated java file: [/usr/share/tomcat7/work/Catalina/localhost/_/org/apache/jsp/html/portlet/admin/view_jsp.java]_The code of method jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit__Stacktrace: [Sanitized]
org.apache.jasper.JasperException: Unable to compile class for JSP: _An error occurred at line: [560] in the generated java file: [/usr/share/tomcat7/work/Catalina/localhost/_/org/apache/jsp/html/portlet/admin/view_jsp.java]_The code of method jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit__Stacktrace: [Sanitized]
at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:366)
at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:490)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:379)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:341)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:662)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:364)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:743)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:603)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:542)
Open the file in your Liferay_home/Tomcat_Home/conf/web.xml and search for 'JspServlet'. This should return an xml node of <servlet> containing some <init-param> values. Add an additional <init-param> the same as the below.

<init-param>
<param-name>mappedfile</param-name>
<param-value>false</param-value>
</init-param>

The resulting block of the web.xml file, once you insert the above, should look like below.

<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>fork</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>xpoweredBy</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>mappedfile</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>

Save the file and restart the Tomcat service.
Thanks, Ankit - We tried the suggested solution and restarted the tomcat but still getting the same exception/Error