Foros de discusión

Glassfish 2.1/Liferay setup for MySQL but still using HSQL

Keith Brandon Pemberton, modificado hace 14 años.

Glassfish 2.1/Liferay setup for MySQL but still using HSQL

New Member Mensajes: 12 Fecha de incorporación: 29/05/09 Mensajes recientes
I have been trying to get Liferay to use MySQL as a database backend while running under Glassfish 2.1 but have not been successful yet. I have looked through this forum and the Portal Administrator's guide for assistance on this, but the suggestions so far have not been helpful. Here is what I have done, running under Windows 2003 R2 SP2.
  • Installed MySQL and used the create SQL script provided from the Liferay website to create the lportal schema and tables. Made sure that there were no problems logging as the user I setup and that the user had full permissions to the lportal schema.
  • Installed Glassfish and copied the dependency jar files as well as xercesImpl.jar and the mysql connector jar file to $GLASSFISH_HOME/domains/domain1/lib.
  • Setup a new JDBC Connection Pool and Resource called LiferayPool and jdbc/LiferayPool, respectively, as per the guide instructions on page 40.
  • Deployed the Liferay war file.
  • Created a portal-ext.properties file with the appropriate info and placed that in ../domain1/applications/j2ee-modules/liferay-portal-5.2.3/WEB-INF/classes and restarted the application server.

The server.log file shows that the portal-ext.properties file is read when the liferay application is started, but immediately afterward shows "using HSQL database" and a warning about using this in a production environment.

I would like to not have to uncompress the liferay-portal.war file just to manually change the portal.properties file and then recompress.

Any help is much appreciated!
Keith Brandon Pemberton, modificado hace 14 años.

RE: Glassfish 2.1/Liferay setup for MySQL but still using HSQL

New Member Mensajes: 12 Fecha de incorporación: 29/05/09 Mensajes recientes
I was able to get this to work by copying the entire portal.properties file and pasting it into a portal-ext.properties file. I then commented out the HSQL database and uncommented the MySQL database lines. After a server restart, the server.log file showed that it was using the MySQL Dialect.

I don't know that that is how it is supposed to work, but that is what worked for me. My impression was that I just had to add the jdbc lines into the portal-ext.properties file.

Hope this helps someone, though.
thumbnail
Olaf Kock, modificado hace 14 años.

RE: Glassfish 2.1/Liferay setup for MySQL but still using HSQL

Liferay Legend Mensajes: 6396 Fecha de incorporación: 23/09/08 Mensajes recientes
Copying all of portal.properties definitely is not necessary, but there are some things to think about:

  • from 5.2 on database configuration is done through portal(-ext).properties instead of jndi via the appserver (unless explicitly configured in portal-ext.properties to use jndi)
  • There are some portlets coming separate from liferay, they may need configuration too - I recall that the WOL portlets run on HSQL by default. Don't let yourself believe that all of the portal runs HSQL just because you see HSQL mentioned in the logs
  • You can easily check if you have configured the correct database if your liferay-user has CREATE TABLE permissions and you start with an empty database. After startup check if/where the default database content has been created (may need "schema.run.enabled=true" and "schema.run.minimal=true" settings in portal-ext.properties)
  • remember you need the database driver (you do not have a problem with this - I've just added it here to make the list a little bit more comprehensive)
Keith Brandon Pemberton, modificado hace 14 años.

RE: Glassfish 2.1/Liferay setup for MySQL but still using HSQL

New Member Mensajes: 12 Fecha de incorporación: 29/05/09 Mensajes recientes
Just to update this posting, I had tried getting liferay to use MySQL on Glassfish again and I think the key that finally worked for me was to not specify all the JDBC connection information in the portal-ext.properties file. I created the connection pool and JDBC resource through the glassfish admin console and then only specified the JNDI connection name in the portal-ext.properties file. I was trying to setup the JDBC resources in the admin console and also in the portal-ext.properties file before. Thanks, again!
S L B, modificado hace 14 años.

RE: Liferay setup for MySQL but still using HSQL

Junior Member Mensajes: 25 Fecha de incorporación: 28/07/08 Mensajes recientes
I was just majorly bummed to find out that a site I had setup for my family had this bug when running under tomcat 6. So, fyi, it's not just glassfish.

I found out when I dumped my db before upgrading to 5.2.3 and noticing that there wasn't any data inside except for what the liferay db creation script put there. Seems like a pretty huge bug to have missed. Time to switch to jndi connection pools and pray that the import/export function works or figure out how to use the mysql migration tool. This is just a huge hassle.