Tuesday, March 30, 2010

ATG 9.1 on Mac OS X 10.6

Using the instructions from Ronald Pulleman (which focus on ATG 2007.1), I tried installing ATG 9.1 on Mac OS X 10.6.2. Below are the instructions for reproducing what worked for me.

Make sure you know what is officially supported by ATG, since Mac OS X is not. Also make sure you have the Installation Guide handy, part of the ATG 9.1 documentation set.

Below I refer to the .profile file for adjusting environment variables. Make sure you apply these environment variable changes each time. If you do not use bash, then replace .profile with whatever your shell reads on startup.

Install and configure MySQL

  • Have MySQL installed; I picked MySQL 5.1.45 (64-bit), but 5.1.32 would have been supported.
  • Add this your .profile:
    export MYSQL_HOME=/usr/local/mysql-5.1.45-osx10.6-x86_64
    export PATH=$MYSQL_HOME/bin:$PATH
  • In your System Preferences application, start MySQL and make it start automatically at boot.
  • Change the password of the root user, for obvious reasons:
    mysqladmin -p -u root PASSWORD newpass
  • Make MySQL use the InnoDB engine by default, this is required for ATG: Create the file /etc/mysql/my.cnf with the following contents:
    [mysqld]
    default-storage-engine=innodb
    sql-mode=TRADITIONAL

Install and configure JBoss

  • Install JBoss; I used JBoss 4.2.3-GA (community edition), while the (paid) JBoss EAP 4.2.0 CP05 would be the ATG-supported version.
  • Add this to your .profile:
    export JBOSS_HOME=$HOME/jboss-4.2.3.GA
    export PATH=$JBOSS_HOME/bin:$PATH
  • Modify the JVM arguments in the startup script, if you want to comply with the ATG recommendations for JVM parameters. Edit the bin/run.sh file and modify the JAVA_OPTS setting as follows:
    JAVA_OPTS="-server -Xms2048m -Xmx3072m -XX:MaxPermSize=768m -XX:MaxNewSize=768m -Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.rmi.client.gcInterval=3600000"

Integrate MySQL with JBoss

  • Download the MySQL JDBC driver Connector/J, I got version 5.1.12.
  • Copy the Connector/J JAR file to the server/atg/lib directory under the JBoss home directory:
    cp ~/Downloads/mysql-connector-java-5.1.12/mysql-connector-java-5.1.12-bin.jar $JBOSS_HOME/server/atg/lib/

Install and configure ATG

  • Download ATG 9.1 from the ATG support site, this is a JAR file.
  • Unpack it and then execute the contained .bin file:
    unzip ATG9.1.jar
    sh ATG9.1.bin
    Choose JBoss as the application server. I suggest you make sure there is no space in the name of the destination director (I chose ~/atg-9.1).
  • Put your license keys in the home/localconfig/ directory (below the ATG installation directory).
  • Create the file home/bin/dasEnv.sh with just one line in it:
    export ATGJRE=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Commands/java
  • Create the file home/localconfig/atg/dynamo/service/jdbc/JTDataSource.properties with the following contents:
    JNDIName=java:/MySqlDS
    $class=atg.nucleus.JNDIReference

Initialize the ATG database

  • Under the JBoss directory, create the file server/atg/deploy/mysql-ds.xml with the following contents:
    <datasources>
      <local-tx-datasource>
        <jndi-name>MySqlDS</jndi-name>
        <connection-url>jdbc:mysql://127.0.0.1:3306/atg000</connection-url>
        <driver-class>com.mysql.jdbc.Driver</driver-class>
        <user-name>atg</user-name>
        <password>atgpass</password>
        <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
        <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name>
        <metadata>
          <type-mapping>mySQL</type-mapping>
        </metadata>
      </local-tx-datasource>
    </datasources>
  • Log in to the MySQL command line client mysql:
    mysql -p -u root
  • Create a database user for ATG:
    USE mysql
    INSERT INTO user (host, user, password) VALUES ('%', 'atg', PASSWORD('atgpass'));
  • Create a database for ATG:
    CREATE DATABASE atg000;
  • Allow the atg user all access privileges on the atg000 database:
    GRANT ALL PRIVILEGES ON atg000.* TO atg;
    FLUSH PRIVILEGES;
  • Exit the mysql client (you can use Ctrl-D).
  • Create the ATG data structures in the database by executing the DDL scripts on MySQL (this typically takes less than a minute):
    cat DAS/sql/install/mysql/das_ddl.sql DPS/sql/install/mysql/dps_ddl.sql DSS/sql/install/mysql/dss_ddl.sql DCS/sql/install/mysql/dcs_ddl.sql | mysql -D atg000 -u atg -patgpass

Run ATG

  • Deploy an ATG application to JBoss.
  • Start JBoss: Go to the JBoss directory and execute:
    bin/run.sh -c atg
  • Using a browser visit http://127.0.0.1:8080/dyn/admin/ to see the DynAdmin tool.

11 comments:

  1. Hi Ernst,

    Thanks for the post. Just wondering if you could give me some direction on a jboss and mysql problem on the mac os x 10.6.
    I have a jboss server that needs to be started when the server boots up. This jboss server needs the mysql server to be running to function properly. Handing this dependency was easy under the StartupItems program. But launchd does not support handling such dependencies directly. It leaves that to the daemon itself. Do you have any ideas on how this could be handled?

    -Abhilash

    ReplyDelete
  2. Abhi,

    You could just start both from the same plist. That would be the simple-but-not-so-beautiful approach that is likely to work like a charm.

    If that is not acceptable, go find a real expert, I'm not the one.

    Cheers,


    Ernst

    ReplyDelete
  3. Have you tried to apply any patch? I tried p1 and p2, both giving some errors...

    ReplyDelete
  4. Yaozhong: No, I have not (yet) tried to apply a patch. What is the error you get?

    ReplyDelete
  5. Copy & Paste from the terminal:
    =======================
    ATG9.1_p1 yaozhong$ bin/install.sh
    Please shutdown Dynamo before running InstallPatch.
    Please enter 'y' to continue InstallPatch, 'n' to cancel InstallPatch.


    y
    Error: Error: no product installed.
    ====================
    one more issue: after I ran "startDynamoOnJBOSS.sh -m MotorpriseJSP DafEar.Admin", following is showing in JBoss log (there are more, I'm just pasting one), any idea how to proceed next? Appreciate your help!
    ============

    17:16:24,131 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

    --- Packages waiting for a deployer ---
    org.jboss.deployment.DeploymentInfo@86456183 { url=file:/usr/local/jboss-eap-4.3/jboss-as/server/atg/deploy/ATG.ear/ }
    deployer: null
    status: null
    state: INIT_WAITING_DEPLOYER
    watch: file:/usr/local/jboss-eap-4.3/jboss-as/server/atg/deploy/ATG.ear/
    altDD: null
    lastDeployed: 1282770984125
    lastModified: 1282770981000
    mbeans:
    ==================

    ReplyDelete
  6. By the way, how did you create the atg folder under $JBOSS_HOME/server? ATG installation didn't seem to do anything to this folder, I just manually created it by copying "minimal" folder and added couple files mentioned above.

    ReplyDelete
  7. I think I got both issues taken care of:
    1. For the patch problem, I referenced https://community.atg.com/docs/DOC-1082 and modified /installconfig/config.xml; the patch did get installed, but PITH ruleset failed as Mac OS X is not supported. I briefly looked at the rule file, nothing seems to be that important (permissions, etc.); so I just ignored that (or maybe manually do them later).
    2. The second issue went away after I recreated atg folder under /server by duplicating default (instead of minimal).

    ReplyDelete
  8. Yaozhong, is there anything in the patch that is definitely worth the upgrade? Everything's running fine without it so I wanted to see if it's even worth considering.

    ReplyDelete
  9. Hi Ernst,

    Have you tried installing the DCS-UI9_1 (Merchendising Server) after installing ATG9.1 ?

    At the point where you have to provide the target directory it keeps asking for a valid ATG 9.1 directory.
    It seems to properly detect the directory where ATG9.1 gets installed but doesn't like it.
    It gets stuck there.

    Dan

    ReplyDelete
  10. hi...Im student from Informatics engineering nice article,
    thanks for sharing :)

    ReplyDelete