Install Liferay with GlassFish Bundle on Gentoo

Installation doc:

Below is what I had done to install Liferay with Glassfish bundle:

  1. Make sure we have java runtime installed
    # emerge -pv virtual/jre
  2. Install apache ant
    # emerge -pv dev-java/ant
  3. Follow the steps in Install Liferay with GlassFish bundle
    When open http://localhost:8080, got an error "service() not found". Then check glassfish/domains/domain1/logs/server.log, it showed that log4j was not found.
  4. Find out about log4j installation:
    % emerge -s log4j
    Searching...  
    [ Results for search key : log4j ]
    [ Applications found : 2 ]
     
    *  dev-java/ant-apache-log4j
          Latest version available: 1.7.0
          Latest version installed: 1.7.0
          Size of files: 6,682 kB
          Homepage:      http://ant.apache.org/
          Description:   Apache Ant's optional tasks depending on log4j
          License:       Apache-2.0

    *  dev-java/log4j
          Latest version available: 1.2.14-r1
          Latest version installed: 1.2.14-r1
          Size of files: 2,706 kB
          Homepage:      http://logging.apache.org/log4j/
          Description:   A low-overhead robust logging package for Java
          License:       Apache-1.1

  5. So we have log4j installed. Find out where the jar file is:
    % equery files dev-java/log4j
    [ Searching for packages matching dev-java/log4j... ]
    * Contents of dev-java/log4j-1.2.14-r1:
    /usr
    /usr/share
    /usr/share/log4j
    /usr/share/log4j/lib
    /usr/share/log4j/lib/log4j.jar
    /usr/share/log4j/package.env
  6. Create a link to the log4j.jar:
    % cd glassfish/lib/
    % ln -s /usr/share/log4j/lib/log4j.jar
    (There should be a better way to fix this error. Since I am not familiar with the setup yet, I would just hack it for now.)
  7. Now restart the service:
    % cd ..
    % bin/asadmin stop-domain
    % bin/asadmin start-domain
  8. Check the localhost:8080 and it should work. For this particular installation, it took less than 1 minute to start. Now we see the liferay running on its bundled HSQLDB database.