Liferay and Tomcat – part 2

Here are some more detailed steps I took to get Liferay and Tomcat to work together. Then, I’ll share some more interesting data and observations.

For those hardware/OS minded folks, these experiments are being conducted on a Dell Latitude 620 2.33 GHZ Intel Centrino Duo running Windows XP SP 2, 2 GB of RAM.

So to recap, I settled on the technique of replacing Liferay’s suggested ROOT.xml file in conf/Catalina/localhost with an XML file named liferay.xml. I decided not to go with the technique of creating a context.xml file in webapps/liferay/META-INF. Note to reader: these path fragments are relative to what I’ve defined as CATALINA_HOME for this instance of Tomcat.

Well, the next thing that Liferay required that I didn’t have configured was the jaas.config file – it needed to live in the plain old conf directory.

Next step: JAVA_OPTS. It’s important to make sure that you crank the memory settings for Tomcat, and that you give Tomcat a clue as to the location of the jaas.config file.

Next, I followed an instruction I found in the Liferay forums that advised creating the file webapps/liferay/WEB-INF/classes/ with the following content:


I’m not certain if this indeed has the effect it’s supposed to, but it sounded like a reasonable thing to attempt.

Well, I was hopeful and tried cranking up Tomcat – but it died again. Basically, I did not have this line in conf/ configured correctly:


But once I fixed that, the portal tried to load – and the connection to the database blew up.

The reason was simple: I had installed MySQL Community Server 5.0.41, and the default security for MySQL is much stricter that it has been in the past. So, I simply had to create a user and a password, and issue a GRANT ALL on the ‘lportal’ database – then update my Context settings in liferay.xml to include the username and passwords in the JDBC connector data.

Life is good. The portal runs.

Leave a Reply