ATG 2007.1 on Mac OS X with MySQL

August 13, 2007

For some weeks now ATG 2007.1 is available. My entry about installing ATG on Mac OS X explained how to install ATG 2006.3 on Mac OS X Tiger which is not supported by ATG . It got a few hits, so perhaps an update is needed.

Pre installation

  • Have jboss-4.0.5GA ready. This is the only version supported by ATG 2007.1.
  • Have MySQL ready. Only 5.0.20 is supported. However I have used 5.0.45 and so far it seems to be working fine. Make sure you use the InnoDB engine instead of the MyISAM.
  • Create an ATG user on MySQL in a way you seem fit
  • Add export JBOSS_HOME=<your JBOSS 4.0.5GA path here> to .bash_login. If you use another shell, you know what to do.
  • Take care of your permissions.
  • Download ATG2007.1 for Unix

Installation and configuration

  • Run ATG2007.1.bin
  • When asked to enter the path where to install ATG, remove the space. It will make things easier.
  • When asked for JAVA_HOME use /System/Library/Frameworks/JavaVM.framework/Versions/ 1.5.0/Home or your preferred version.
  • Drop your license files in <ATG folder>/home/localconfig
  • Add the following line export ATGJRE=/System/Library/Frameworks/JavaVM.framework/ Versions/CurrentJDK/Commands/java to dasEnv.sh
  • Copy MySQL JDBC driver (mysql-connector-java-5.0.7-bin.jar) to <JBOSS_HOME>/server/atg/lib
  • Add a mysql-ds.xl to <JBOSS_HOME>/server/atg/deploy and fill in the correct database name etc.
  • Create a file, like this: /home/localconfig/atg/dynamo/service/jdbc/JTDataSource.properties
    The ATG documentation states to create a jbossconfig folder with a change to a manifest to point to that path. I skipped that.
  • Edit this JTDataSource.properties. It should contain:
    JNDIName=java:/MySqlDS
    and
    $class=atg.nucleus.JNDIReference
  • Run datascripts:
    • /Applications/ATG2007.1/DAS/sql/install/mysql/das_ddl.sql
    • /Applications/ATG2007.1/DPS/sql/install/mysql/dps_ddl.sql
    • /Applications/ATG2007.1/DSS/sql/install/mysql/dss_ddl.sql
    • /Applications/ATG2007.1/DCS/sql/install/mysql/dcs_ddl.sql

    I used mysql -D <dbname> < /Applications/ATG2007.1/DAS/sql/install/mysql/ das_ddl.sql --user=<username> --password=<password>

Some notes

Adding Darwin to <ATG folder>/home/bin/DynamoEnv.sh is not something I use anymore as I did in 2006.3. I will assume Solaris. This will make patching easier, as Robert Hellwig found out.

Unlike ATG 2006.3 ATG2007.1 JTDatasource.properties can contain $class=atg.nucleus.JNDIReference

The executing of the SQL scripts was not correct in the previous Blog. The user and password command was wrong. Why didn’t anybody tell me?

On the previous blog entry, I got some questions on how you can tell MySQL to use InnoDB. Check your my.cnf or my.ini file. It’s in the ATG documentation:
ATG Doc


MySQL preference pane

April 5, 2007

When using the MySQL preference pane to start and stop MySQL on my Mac, I was not quickly able to find which script was actually run. This was not configurable. Find and grep did not help me.

It seems that the prefpane goes to /usr/local/mysql/support-files/mysql.server and does a start and stop

Since I use a couple of MySQL versions, setting your symbolic link becomes really important.


SolidDB Storage Engine

March 29, 2007

The ATG Creating Commerce Applications course uses the Solid Embedded Engine. So ofcourse when trying to run the Solid Sql scripts in my MySQL database it fails on the following line:

alter table dynamusic_item_bought set pessimistic

This is only natural since this is a typical Solid statement. When googling to see how I can translate this to MySQL syntax I stumble on the SolidDB Storage Engine for MySQL . He this is new! So when I use MySQL with this storage engine will it accept my SQL statement? I have no idea. I am completely in the dark how MySQL and its storage engines actually work. But hey let’s give it a try. Unfortunately there is only a Windows and a Linux version. But somebody on the net compiled the sources for the PowerPC mac and had created a Mac build. Hoorah.

However the following code fails:

CREATE TABLE `Fiets1` (
`id` varchar(11) NOT NULL , PRIMARY KEY (`id`)
) ENGINE=solidDB DEFAULT CHARSET=latin1;

But this one works

CREATE TABLE `Fiets1` (
`id` INTEGER NOT NULL , PRIMARY KEY (`id`)
) ENGINE=solidDB DEFAULT CHARSET=latin1;

It seems that I cannot do a primary key on a varchar. That’s odd.

Next step is to compile the stuff myself. However although I’m perfectly able to compile the MySQL sources from mysql.org on my MacBook, I get a compile error when downloading the linux sources from the solid website. Must be my inexperience. Solid forums.

So now I’m on Parallels for the remainder 😦 ….


Little ATG annoyances

March 27, 2007

I’m a complete ATG newbie. So perhaps some stuff is due to my inexperience, but things which seem odd to me:

Eclipse ATG plugin

When doing the New ATG Module in Eclipse a manifest is created with

ATG-Required: DAS DPS DSS DAS

There is a double DAS entry there.

ACC

I missed the create J2EE application under the ACC. It seems this is only available if you use DAS. Since I’m using JBoss, this is not available. Why is this?

More items are missing in the ACC. Well the ACC is going the way of the mammoth I guess.

Dynamusic

Positive: It seems that Dynamusic from Developing ATG Applications is going to work. The Solid SQL script creating the Dynamusic tables was accepted by MySQL (after removing the drop statements). At least the first chapter worked. Although you have to use Eclipse in stead of the ACC.


ATG, JBoss and MySQL on Mac OS X

March 25, 2007

Since Mac OS X is not a platform supported by ATG , installation can be… a bit troublesome. Everything ATG related is hard to find with Google so I decided to write this down. This is the installation of the ATG 2006.3 version.

At the end perhaps not everything is necessary, but the result works for me.

I found a lot of tips on Nabble by qmnonic . Thanks for sharing

<EDIT on June 15, 2007>

Steps 7, 8 and 9 are not necessary. So you can skip them

</EDIT>

Pre installation

  • Have jboss-4.0.3SP1 ready. This is the only version supported by ATG.
  • Have MySQL ready. Only 5.0.20 is supported. However I have used 5.0.27 and so far it seems to be working fine. Make sure you use the InnoDB engine instead of the MyISAM. If you don’t, prepare for the infamous 1000 characters unique key problem. I found this on Nabble. Further integration of MySQL and JBoss is described below. However I used an O’Reilly article: JBoss and MySQL
  • Take care of your permissions.
  • Add export JBOSS_HOME=< your JBOSS path here> to .bash_login. If you use another shell, you know what to do.

Installation and configuration

  1. Download the unix installer ATG2006.3.bin and install ATG. Your life will be easier if you do not use the default space.
  2. Drop your license files in <ATG folder>/home/localconfig
  3. Add Darwin to <ATG folder>/home/bin/DynamoEnv.sh as explained in ATG SolutionID atg33147 as follows:
    1. Add: DARWIN_OSDIR_NAME=”Darwin”
    2. Add: elif [ $UNIXFLAVOR = Darwin ]
      then
      OSDIRNAME=$DARWIN_OSDIR_NAME
  4. Added dasEnv.sh to <ATG folder>/home/localconfig/ with the next line
    export ATGJRE=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Commands/java as described on Nabble.
  5. Copy MySQL JDBC driver to <JBOSS_HOME>/server/atg/lib
  6. Add mysql-ds.xl to <JBOSS_HOME>/server/atg/deploy fill in the correct database name etc.
  7. Add MySqlDS datasource to standardjaws.xml as follows:
    <jaws>
    <datasource>java:/MySqlDS</datasource>
    <type-mapping>mySQL</type-mapping>
    </jaws>
  8. Edit standardjbosscmp-jdbc.xml (I guess this is not necessary, since it is for EJB’s. But better safe then sorry. I’ll remove it later to see if still works)
    <jbosscmp-jdbc>
    <defaults>
    <datasource>java:/MySqlDS</datasource>
    <datasource-mapping>mySQL</datasource-mapping>
    </defaults>
    </jbosscmp-jdbc>
  9. Add the following text to login-config.xml (Again I’m not sure is needed, I’ll check this later):
    <application-policy name = “MySqlDbRealm”>
    <authentication>
    <login-module code = “org.jboss.resource.security.ConfiguredIdentityLoginModule”
    flag = “required”>
    <module-option name =”principal”>sa</module-option>
    <module-option name =”userName”>sa</module-option>
    <module-option name =”password”></module-option>
    <module-option name =”managedConnectionFactoryName”>
    jboss.jca:service=LocalTxCM,name=MySqlDS
    </module-option>
    </login-module>
    </authentication>
    </application-policy>
  10. Create a file, like this: /<ATG_HOME>/home/localconfig/atg/dynamo/service/jdbc/JTDataSource.properties
    The ATG documentation states to create a jbossconfig folder with a change to a manifest to point to that path. I skipped that.
  11. Edit this JTDataSource.properties. It should contain:
    JNDIName=java:/MySqlDS
    and should NOT contain
    $class=atg.nucleus.JNDIReference
    This is wrong. error in ATG docs I guess. It results in classnotfoundexception in my case. Leaving it out seems to fix it?!
  12. Run datascripts
    /Applications/ATG 2006.3/DAS/sql/install/mysql/das_ddl.sql
    /Applications/ATG 2006.3/DPS/sql/install/mysql/dps_ddl.sql
    /Applications/ATG 2006.3/DSS/sql/install/mysql/dss_ddl.sql
    I used mysql <dbname> < dss_ddl.sql –user=<user> –password=<password>

After installation

Run by using the startDynamoOnJBOSS.sh script form <ATG_HOME>home/bin folder and use -c atg to use the atg server-config-name.

I sometimes had to delete the ATGDAF.ear from the Deploy folder and retry, when changing some configuration. It seems they are not always recopied.

These steps worked for me to get a basic Nucleus install where the ACC is working correctly.

Good luck