Tag: ATG
ATGLogColorizer for Colorizing ATG Server Outputs and Logs
by Frank Kim on Aug.18, 2009, under ATG
Color is wonderful. With color we can immediately recognize patterns, signals, warnings, etc. By using a utility that color codes your logs and server outputs to highlight errors in red, warnings in yellow, etc. you can be much more efficient about how you monitor and search.
Back in the day we used to use DynamoFilter.exe to color code the output of running ATG on the Dynamo Application Server (DAS). Now that people no longer use DAS that application is no longer useful.
Today though I found out about the open source project ATGLogColorizer. This fantastic utility works with JBoss, WebLogic, DAS and WebSphere. It works on Windows, Mac OSX, Solaris and other UNIX variants. It even works on Cygwin.
This is how I start JBoss with ATGLogColorizer on Cygwin.
${ATG}/home/bin/startDynamoOnJBOSS.bat -f -run-in-place -c default -m Foo | ATGLogColorizer.exe'
And this is how I start JBoss with ATGLogColorizer on Mac OS X.
${ATG}/home/bin/startDynamoOnJBOSS.sh -f -run-in-place -c default -m Foo | ATGLogColorizer_v1_2_OSX'
Life has become a little better.
For further reading please see and ATGLogColorizer and ATG Log Colorizer for JBoss.
How to Add Products to Categories using Content Groups
by Frank Kim on Jul.31, 2009, under Commerce, Personalization
Typically after you create a category in your catalog you then add products to the category. The simple way to do that in ATG eCommerce is to use the ACC and add products to the child products property of the category. However there is another way.
In the ATG Commerce Guide to Setting Up a Store documentation you can see in the Viewing the Product Catalog section that a category can have child products but also child product groups.
Child product groups are actually content groups which are described in the Creating Content Groups chapter of the ATG Personalization Guide for Business Users.
Though the documentation shows a content group composed of features you can easily create a content group using the ProductCatalog as a content source and product as a content type.
To create a content group follow the steps in the ATG documentation for Creating New Content Groups except use an item from the ProductCatalog when specifying the Content Type. Then create the targeting rules for this Content Group. Now you can specify this group in the Child products (group) property of a category.
ATG Product Bundles
by Frank Kim on Jul.29, 2009, under Commerce
Out of the box ATG eCommerce does not support product bundles. It does support SKU bundles, i.e. a product can consist of multiple SKU’s.
To support product bundles is pretty simple to implement.
First you create a new type of product for bundles in /atg/commerce/catalog/productCatalog.xml.
<item-descriptor name="product"> <table name="dcs_product"> <property name="type" data-type="enumerated" default="regular"> <attribute name="useCodeForValue" value="false"/> <option value="regular" code="0"/> <option value="bundle" code="1" /> </property> </table>
Then you define your bundles product to have the new products property. This property is simply a list of products that the bundle contains, e.g. Costco organic cotton polo shirt and Nike athletic shorts.
<item-descriptor name="bundle" super-type="product" sub-type-value="bundle"> <table name="betweengo_product_bundle" multi-column-name="seq_num" type="multi" id-column-names="product_bundle_id"> <property name="products" column-name="product_id" data-type="list" component-item-type="product" display-name="Products" category="Bundle" /> </table> </item-descriptor>
A few years ago I did a more advanced version of this implementation which allowed for different numbers of products in one bundle, e.g. two different kinds of shirts and one pair of pants. I did this using the concept of product links which is similar to SKU links that ATG supports.
If you are interested in wanting to implement a more advanced version please contact us.
How to Debug No Output for ATG ForEach
by Frank Kim on Jul.28, 2009, under Page Development
Today I added a feature in my shopping cart JSP page but nothing was showing up. This was because the output of ATG ForEach droplet was blanks.
To debug this I did the following steps.
- I added an empty oparam to see if the ForEach droplet thought the collection was empty.
<dsp:oparam="empty">Empty?</dsp:oparam>
It did not.
- I outputted the count in the output oparam to see if it was looping through the collection.
<dsp:oparam="output"><dsp:valueof param="count"/> <dsp:valueof param="element"/></dsp:oparam>
It was looping through the collection.
- Finally I debugged using Eclipse the ForEach code. The ForEach code can be found in <ATG>/DAS/src/Java/atg/droplet/ForEach.java.
Using the debugger I realized that the element name of the loop was being set to something else which is why <dsp:valueof param=”element”/> was blank.
It turned out that the ForEach droplet was inside another ForEach droplet and in that droplet they set the element name like this.
<dsp:param name="elementName" value="CommerceItem" />
By setting the elementName parameter to something else in my ForEach droplet and then referencing it properly I was finally able to get the expected output.
<dsp:droplet name="/atg/dynamo/droplet/ForEach"> <dsp:param name="array" param="CommerceItem.auxiliaryData.productRef.dvds"/> <dsp:param name="elementName" value="dvd" /> <dsp:oparam name="output"> <dsp:valueof param="dvd.name" /> </dsp:oparam> </dsp:droplet>
By the way ATG documentation suggests not using elementName.
elementNameandindexNameallow you to provide a parameter name other thanelementandindex, respectively. A better way to provide a different parameter name is to use thedsp:setvaluetag.
In our example we would do this instead of setting the elementName param.
<dsp:setvalue param="dvd" paramvalue="element" />
Debug ATG running on JBoss with Eclipse
by Frank Kim on Jul.27, 2009, under Programming
With Eclipse debugging an ATG application running on JBoss is fairly straightforward.
- Configure JBoss to start up with Java options for debugging.
On UNIX you do this by uncommenting this line in <JBoss>/bin/run.conf.
#JAVA_OPTS="$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y"
On Windows you do this by uncommenting this line in <JBoss>/bin/run.bat.
rem set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y %JAVA_OPTS%
- Create a remote Java application debug configuration using the port you specified in step 1. The default port is 8787.
For further reading please see Debugging Nucleus components in JBoss with Eclipse or Remote Debugging with Eclipse. There is also a very complete tutorial from O’Reilly Media called Configuring Eclipse for Remote Debugging.
How to Get Permission to Create Scenarios in ACC
by Frank Kim on Jul.22, 2009, under ACC
Sometimes you will find that you cannot create or duplicate scenarios. You keep clicking on the grayed out New Scenario button and right-clicking on scenarios you want to duplicate but nothing happens.
Fortunately the solution is rather simple and is alluded to in the ATG Personalization Programming Guide – Configuring the Process Editor Server.
First you create a scenarioManager.xml file in your <ATG>/home/localconfig/atg/scenario directory like the following.
<?xml version="1.0" encoding="ISO-8859-1" ?>
<process-manager-configuration>
<process-editor-server>
<server-name>foobar:8850</server-name>
</process-editor-server>
</process-manager-configuration>
Next you replace foobar:8850 with the value of /atg/dynamo/service/ServerName.serverName. You may want to configure the serverName value to something you want because sometimes it might change if for example when you connect via VPN.
Then you restart ATG and reconnect or restart the ACC and you should be able to create and duplicate scenarios.
(Note that when you create the workflowProcessManager.xml file in your <ATG>/home/localconfig/atg/epub/workflow/process directory it can have the exact same contents as the scenarioManager.xml file.)
NameNotFoundExceptions during start up of ATG application on JBoss
by Frank Kim on Jul.21, 2009, under Configuration
When you start up your ATG application on JBoss and see NameNotFoundExceptions like the following it could be because you did not configure your ATG datasources correctly.
Unable to start service "/atg/dynamo/service/jdbc/JTDataSource": atg.nucleus.ServiceException: Unable to resolve reference to JNDI component: java:/atgcore_ds ERROR [nucleusNamespace.atg.dynamo.service.jdbc.JTDataSource] javax.naming.NameNotFoundException: atgcore_ds not bound
To properly configure it create an atg-oracle-ds.xml file. I have a sample one below. atgcore_ds is the datasource for most of the ATG repositories. You will probably need to configure datasources for Catalog A and Catalog B if you are doing eCommerce, e.g. atgcataloga_ds and atgcatalogb_ds. The atg-oracle-ds.xml file will go into your server’s configuration, e.g. <jboss>/server/betweengo/deploy.
<?xml version="1.0" encoding="UTF-8"?> <datasources> <local-tx-datasource> <jndi-name>atgcore_ds</jndi-name> <!-- <connection-url>jdbc:oracle:oci:@Dynamo</connection-url> --> <connection-url>jdbc:oracle:thin:@localhost:1521:orcl</connection-url> <driver-class>oracle.jdbc.driver.OracleDriver</driver-class> <user-name>foo</user-name> <password>bar</password> <min-pool-size>1</min-pool-size> <max-pool-size>4</max-pool-size> </local-tx-datasource> </datasources>
Note that the connection URL should be the same as what you configured in your tnsnames.ora file. If you installed Oracle with a Microsoft Loopback Adapter and pointed the host in your tnsnames.ora configuration to the loopback connection, e.g. 192.168.1.200, then you should do the same in your atg-oracle-ds.xml file.
For further reading please see Getting Started with ATG – jBoss and Oracle and Create Additional JBoss Application Server Configurations.
Create Additional JBoss Application Server Configurations
by Frank Kim on Jul.20, 2009, under JBoss
I thought to create an additional JBoss application server configuration one would have to use some kind of administration tool.
It turned out to be much simpler.
cp -R server/default server/betweengo
If you want to create an ATG application server configuration you can do this.
cp -R server/atg server/betweengo
The only difference between the default server configuration and the atg server configuration is that the latter has two additional datasource XML files for communicating with the SOLID database.
atg/deploy/atg-apps-solid-ds.xml atg/deploy/atg-solid-ds.xml
For further reading please see JBoss configurations to run an application (need active ATG support contract to see this document) or Building Your Own JBoss Configuration or Using JBoss Application Server.
Could Not Install ATG 2007.1
by Frank Kim on Jul.16, 2009, under Configuration
Today I began a contract with Bell Canada on an eCommerce project. This project is using ATG 2007.1 with Oracle 10g (supported environments for ATG 2007.1).
I downloaded the installer from ATG’s product downloads page which is only available if you have purchased a Standard or Premium Support contract. Previously this page was publicly available but now it is hidden. Fortunately I found the link at ATG’s Google group ATG_Tech where they announced that ATG 2007.1 is available.
ATG Support quickly responded to my email to support@atg.com and within a few hours fixed the installer and made available a new installer on the product downloads page.
Lesson learned: Contact ATG Support. They’re good.
Recurring Illegal Access Errors in JBoss when running ATG
by Frank Kim on Jul.14, 2009, under Configuration
I recently installed ATG 2007.1 with no patches on JBoss 4.0.5.GA. When I started it up I continually saw these illegal access errors.
16:01:24,296 INFO [WebappClassLoader] Illegal access: this web application instance has been stopped already. Could not load org.apache.log4j.Level.
The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact.
java.lang.IllegalStateException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1241)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1201)
at org.apache.commons.logging.impl.Log4jProxy$1.run(Log4jProxy.java:66)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.commons.logging.impl.Log4jProxy.threadContextClassLoader(Log4jProxy.java:88)
at org.apache.commons.logging.impl.Log4jProxy.(Log4jProxy.java:94)
at org.apache.commons.logging.impl.Log4JLogger.(Log4JLogger.java:39)
at sun.reflect.GeneratedConstructorAccessor22.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:529)
at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:235)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:372)
at atg.nucleus.logging.commons.CommonsLoggingLogListener.logEvent(CommonsLoggingLogListener.java:106)
at atg.nucleus.GenericService.sendLogEvent(GenericService.java:291)
at atg.nucleus.GenericService.logInfo(GenericService.java:737)
at atg.nucleus.GenericService.logInfo(GenericService.java:715)
at atg.ui.j2edit.model.CachingJ2eeArchiveDirectoryAgent.updateCacheData(CachingJ2eeArchiveDirectoryAgent.java:513)
at atg.ui.j2edit.model.CachingJ2eeArchiveDirectoryAgent.performScheduledTask(CachingJ2eeArchiveDirectoryAgent.java:573)
at atg.service.scheduler.ScheduledJob.runJobs(ScheduledJob.java:441)
at atg.service.scheduler.Scheduler$2handler.run(Scheduler.java:760)
Fortunately this is a common problem and there are many support incidents about it. Problem Report #144586 says that the problem occurs if:
- say “Yes” to deploying Quincy Fund during installation
- use startDynamoOnJBoss to run any other application
The work around is to remove Quincy Funds.ear from the JBoss deployment directory. Or just don’t install Quincy Funds.
If you need to run the Quincy Funds demo then the Error running Quincy Funds demo on JBoss document suggests:
- stop the server
- delete the ATGDAF.ear from the JBoss installation
- start JBoss with the run.bat|sh command; the Quincy Funds demo is automatically started
For further reading please see How to use the startDynamoOnJBOSS script and JBoss configurations to run an application. You may need to have an active ATG support contract to view these and other ATG support documents referenced in this article.







