Friday, September 4, 2015
The number one reason SDL Tridion Experience Manager is misconfigured and all the other ten after
Ah, Experience Manager, can't live with it, can't live without it, so here is how you can make your life a little easier, because in my humble experience, I've seen it misconfigured quite a bit.
I thought about, as with the top winners in any category, leaving the number one reason to the very end, yet the thought of spending even a minute making someone wait for that when they are racing around the clock to make something work as soon as possible really won.
So here it is, in order of frequency, at least in my opinion, starting with the most encountered:
1. Storage for Session Preview - (warning, it is a loaded start).
1a. Wrapper setup in cd_storage_conf.xml for Session Preview webservice and wrapper timeout. In a nutshell, since you are working in-session, all data should be stored in the session database, so make sure your storage type is pointing to the Session Preview database and that the Item types are all going to the same place as well (including pages and binaries which on a regular website may typically go to the file system).
<Wrappers>
<Wrapper Name="SessionWrapper">
<!--
Optional: Timeout - The session timeout expressed in milliseconds.
<Timeout>60000</Timeout>
-->
<Storage Type="persistence" Id="sessionDb" dialect="MSSQL" Class="com.tridion.storage.persistence.JPADAOFactory">
<Pool Type="jdbc" Size="10" MonitorInterval="60" IdleTimeout="120" CheckoutTimeout="120" />
<DataSource Class="com.microsoft.sqlserver.jdbc.SQLServerDataSource">
<Property Name="serverName" Value="localhost" />
<Property Name="portNumber" Value="1433" />
<Property Name="databaseName" Value="Tridion_Session_Preview"/>
<Property Name="user" Value="TridionBrokerUser"/>
<Property Name="password" Value="passwordvalue"/>
</DataSource>
</Storage>
</Wrapper>
</Wrappers>
<ItemTypes defaultStorageId="sessionDb" cached="false">
1b. The session timeout is set to 60 seconds by default, even when commented out. I have seen new page creation result in 404's when 60 seconds was not enough time for Session Preview or the staging site to complete the round trip needed by the underlying mechanism and be ready to serve content.
Treat it as a tuning exercise, to find what is the best setting start by doubling this value, and continue to increase or decrease until the proper value is discovered.
<Wrapper Name="SessionWrapper">
<!--
Optional:
Timeout - The session timeout expressed in milliseconds.
-->
<Timeout>120000</Timeout>
1c. Preview DAO bundle in storage
Check the preview storage extension using the data access object model is present in cd_storage_conf.xml
<StorageBindings>
<Bundle src="preview_dao_bundle.xml"/>
</StorageBindings>
2. Storage for website
As above, think about this in three sections, 2a, 2b, 2c.
2a. When it comes to the staging website, there are two flows going on for storage (cd_storage_conf.xml): the site uses the wrapper to read session information and uses the broker to write information to. Make sure both of these are configured. Pay close attention to the naming conventions for each.
Item types however, unlike in the Session Preview configuration, will point to the Content Data store (Broker) database, not the Session Preview database. Specific types may even go to different types of storage, such as file system for simpler websites or the Broker in the case of application driven setups.
2b. Applicable as described in 1b.
2c. Required as described in 1c.
3. Ambient Data Framework configuration claim for Session Preview webservice
Check cd_ambient_conf.xml has the webservice preview cartridge applied and the ambient cartridge commented out.
<Cartridges>
<!-- Example cartridge definition -->
<!--
<Cartridge File="cd_ambient_cartridge_conf.xml"/>
-->
<Cartridge File="cd_webservice_preview_cartridge.xml"/>
</Cartridges>
4. Ambient Data Framework configuration for staging website
Check cd_ambient_conf.xml has both the webservice preview and footprint cartridges applied, plus the PreviewClaimStoreProvider
<Cartridges>
<Cartridge File="cd_webservice_preview_cartridge.xml"/>
<Cartridge File="footprint_cartridge_conf.xml"/>
</Cartridges>
<ClaimStoreProvider>com.tridion.preview.web.ambient.PreviewClaimStoreProvider</ClaimStoreProvider>
5. web.config or web.xml for staging website - preview and ambientdata filter (ensure all content is intercepted for processing and temp content)
Ensure the preview and ambient data filters are present in the staging site configuration, these will intercept all requests for processing and temporary content.
5a. For a java staging site, review all settings here, with special tender love and care for steps 21 and 22. Do make sure to read all instructions referenced in the link below, but to save time, these are lines to watch out for.
http://docs.sdl.com/LiveContent/content/en-US/SDL%20Tridion%20full%20documentation-v1/GUID-3F764ABD-462F-43A8-BB3F-83928CE48215
<listener>
<listener-class>com.tridion.storage.persistence.session.SessionManagementContextListener</listener-class>
</listener>
<filter>
<filter-name>Page Content Filter</filter-name>
<filter-class>com.tridion.preview.web.PageContentFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Page Content Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>Binary Content Filter</filter-name>
<filter-class>com.tridion.preview.web.BinaryContentFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Binary Content Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-name>Ambient Data Framework</filter-name>
<filter-class>com.tridion.ambientdata.web.AmbientDataServletFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Ambient Data Framework</filter-name>
<servlet-name>Content Delivery Web service</servlet-name>
</filter-mapping>
5b. For a .NET staging site, review here, with emphasis on steps 22 and 23. Again, do make sure to read through all steps documented officially, with the highlights below.
http://docs.sdl.com/LiveContent/content/en-US/SDL%20Tridion%20full%20documentation-v1/GUID-77BA0587-F8ED-49FD-A9EE-4A7111B01830
Application pool in classic mode:
<system.web>
<httpModules>
<add type="Tridion.ContentDelivery.AmbientData.HttpModule" name="Tridion.ContentDelivery.AmbientData.HttpModule" />
<add name="Tridion.ContentDelivery.Preview.Web.PreviewContentModule" type="Tridion.ContentDelivery.Preview.Web.PreviewContentModule" />
Application pool in integrated mode:
<system.webServer>
<modules>
<add type="Tridion.ContentDelivery.AmbientData.HttpModule" name="Tridion.ContentDelivery.AmbientData.HttpModule" />
<add name="PreviewContentModule" type="Tridion.ContentDelivery.Preview.Web.PreviewContentModule" />
6. Missing JARs/DLLs
This is another common step easily missed, especially so when upgrading.
A good clue is to look at the version of config files during the steps above, an even better idea is to check the version of the jars / libs directly.
For instance, if upgrading to 2013 SP1 HR1, there are a few required changes.
http://docs.sdl.com/LiveContent/content/en-US/SDL%20Tridion%20full%20documentation-v1/GUID-59F164FB-E69F-4855-ACA8-433D68455208
So pay attention to these:
(.NET)
Tridion.ContentDelivery.Preview.dll
(both .NET and Java)
cd_deployer.jar
cd_preview_web.jar
cd_preview_webservice.jar
7. Bootstrap CMS url script
Look for this script, typically inserted before the closing
I thought about, as with the top winners in any category, leaving the number one reason to the very end, yet the thought of spending even a minute making someone wait for that when they are racing around the clock to make something work as soon as possible really won.
So here it is, in order of frequency, at least in my opinion, starting with the most encountered:
1. Storage for Session Preview - (warning, it is a loaded start).
1a. Wrapper setup in cd_storage_conf.xml for Session Preview webservice and wrapper timeout. In a nutshell, since you are working in-session, all data should be stored in the session database, so make sure your storage type is pointing to the Session Preview database and that the Item types are all going to the same place as well (including pages and binaries which on a regular website may typically go to the file system).
<Wrappers>
<Wrapper Name="SessionWrapper">
<!--
Optional: Timeout - The session timeout expressed in milliseconds.
<Timeout>60000</Timeout>
-->
<Storage Type="persistence" Id="sessionDb" dialect="MSSQL" Class="com.tridion.storage.persistence.JPADAOFactory">
<Pool Type="jdbc" Size="10" MonitorInterval="60" IdleTimeout="120" CheckoutTimeout="120" />
<DataSource Class="com.microsoft.sqlserver.jdbc.SQLServerDataSource">
<Property Name="serverName" Value="localhost" />
<Property Name="portNumber" Value="1433" />
<Property Name="databaseName" Value="Tridion_Session_Preview"/>
<Property Name="user" Value="TridionBrokerUser"/>
<Property Name="password" Value="passwordvalue"/>
</DataSource>
</Storage>
</Wrapper>
</Wrappers>
<ItemTypes defaultStorageId="sessionDb" cached="false">
1b. The session timeout is set to 60 seconds by default, even when commented out. I have seen new page creation result in 404's when 60 seconds was not enough time for Session Preview or the staging site to complete the round trip needed by the underlying mechanism and be ready to serve content.
Treat it as a tuning exercise, to find what is the best setting start by doubling this value, and continue to increase or decrease until the proper value is discovered.
<Wrapper Name="SessionWrapper">
<!--
Optional:
Timeout - The session timeout expressed in milliseconds.
-->
<Timeout>120000</Timeout>
1c. Preview DAO bundle in storage
Check the preview storage extension using the data access object model is present in cd_storage_conf.xml
<StorageBindings>
<Bundle src="preview_dao_bundle.xml"/>
</StorageBindings>
2. Storage for website
As above, think about this in three sections, 2a, 2b, 2c.
2a. When it comes to the staging website, there are two flows going on for storage (cd_storage_conf.xml): the site uses the wrapper to read session information and uses the broker to write information to. Make sure both of these are configured. Pay close attention to the naming conventions for each.
Item types however, unlike in the Session Preview configuration, will point to the Content Data store (Broker) database, not the Session Preview database. Specific types may even go to different types of storage, such as file system for simpler websites or the Broker in the case of application driven setups.
2b. Applicable as described in 1b.
2c. Required as described in 1c.
3. Ambient Data Framework configuration claim for Session Preview webservice
Check cd_ambient_conf.xml has the webservice preview cartridge applied and the ambient cartridge commented out.
<Cartridges>
<!-- Example cartridge definition -->
<!--
<Cartridge File="cd_ambient_cartridge_conf.xml"/>
-->
<Cartridge File="cd_webservice_preview_cartridge.xml"/>
</Cartridges>
4. Ambient Data Framework configuration for staging website
Check cd_ambient_conf.xml has both the webservice preview and footprint cartridges applied, plus the PreviewClaimStoreProvider
<Cartridges>
<Cartridge File="cd_webservice_preview_cartridge.xml"/>
<Cartridge File="footprint_cartridge_conf.xml"/>
</Cartridges>
<ClaimStoreProvider>com.tridion.preview.web.ambient.PreviewClaimStoreProvider</ClaimStoreProvider>
5. web.config or web.xml for staging website - preview and ambientdata filter (ensure all content is intercepted for processing and temp content)
Ensure the preview and ambient data filters are present in the staging site configuration, these will intercept all requests for processing and temporary content.
5a. For a java staging site, review all settings here, with special tender love and care for steps 21 and 22. Do make sure to read all instructions referenced in the link below, but to save time, these are lines to watch out for.
http://docs.sdl.com/LiveContent/content/en-US/SDL%20Tridion%20full%20documentation-v1/GUID-3F764ABD-462F-43A8-BB3F-83928CE48215
<listener>
<listener-class>com.tridion.storage.persistence.session.SessionManagementContextListener</listener-class>
</listener>
<filter>
<filter-name>Page Content Filter</filter-name>
<filter-class>com.tridion.preview.web.PageContentFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Page Content Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>Binary Content Filter</filter-name>
<filter-class>com.tridion.preview.web.BinaryContentFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Binary Content Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-name>Ambient Data Framework</filter-name>
<filter-class>com.tridion.ambientdata.web.AmbientDataServletFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Ambient Data Framework</filter-name>
<servlet-name>Content Delivery Web service</servlet-name>
</filter-mapping>
5b. For a .NET staging site, review here, with emphasis on steps 22 and 23. Again, do make sure to read through all steps documented officially, with the highlights below.
http://docs.sdl.com/LiveContent/content/en-US/SDL%20Tridion%20full%20documentation-v1/GUID-77BA0587-F8ED-49FD-A9EE-4A7111B01830
Application pool in classic mode:
<system.web>
<httpModules>
<add type="Tridion.ContentDelivery.AmbientData.HttpModule" name="Tridion.ContentDelivery.AmbientData.HttpModule" />
<add name="Tridion.ContentDelivery.Preview.Web.PreviewContentModule" type="Tridion.ContentDelivery.Preview.Web.PreviewContentModule" />
Application pool in integrated mode:
<system.webServer>
<modules>
<add type="Tridion.ContentDelivery.AmbientData.HttpModule" name="Tridion.ContentDelivery.AmbientData.HttpModule" />
<add name="PreviewContentModule" type="Tridion.ContentDelivery.Preview.Web.PreviewContentModule" />
6. Missing JARs/DLLs
This is another common step easily missed, especially so when upgrading.
A good clue is to look at the version of config files during the steps above, an even better idea is to check the version of the jars / libs directly.
For instance, if upgrading to 2013 SP1 HR1, there are a few required changes.
http://docs.sdl.com/LiveContent/content/en-US/SDL%20Tridion%20full%20documentation-v1/GUID-59F164FB-E69F-4855-ACA8-433D68455208
So pay attention to these:
(.NET)
Tridion.ContentDelivery.Preview.dll
(both .NET and Java)
cd_deployer.jar
cd_preview_web.jar
cd_preview_webservice.jar
7. Bootstrap CMS url script
Look for this script, typically inserted before the closing