Sage CRM: Troubleshooting Tomcat Issues

How to Troubleshoot Tomcat Issues in Sage CRM

Troubleshooting Tomcat issues can be a challenge as the Tomcat service may appear to be running fine, but you are still having Tomcat related problems in Sage CRM. The two biggest indications that the Tomcat service isn’t running correctly is that you are unable to use your interactive dashboards and you are unable to export groups or search list to Excel. This Sage CRM service can be problematic as it requires a very specific version of Java and a lot of permissions in IIS and its Windows service. You may even find that the Tomcat’s configuration file needs to be modified slightly to correct some connection issue. A lot of these troubleshooting items will require Sage CRM to be down for short periods of time, so I recommend troubleshooting Tomcat when no one is in the system.

The first step to troubleshooting the Tomcat service is to make sure the service is currently running. Open up your list of Windows services by going to Start, click on Run, then type in ‘Services.msc’. Find the service called ‘Apache Tomcat CRMTomcat6’. NOTE: CRM in the name will be the name of your Sage CRM instance. Make sure under status, it has the service listed as Started. If it has no status, right click on the service and click Start. If the service is stuck on Stopping and seems unresponsive, you can attempt to restart the service by either restarting IIS or going to your task manager and killing the Process. To restart IIS, go to Start, Run, and type in ‘IISReset’. To kill the service, right click on your Windows task bar and then click Start Task Manager. Click the Processes tab. Now right click on the Tomcat6.exe and select End Process. Once the process is gone, go back to your services list and start Tomcat.

The second step to troubleshooting Tomcat is to verify that your webserver has the correct version and patch of Java installed. To check what version you have running, go to Start, Control Panel, and Uninstall a program.  You should be able to scroll down the list and see a Java installed. You only want to see one and it needs to be Java™ 6 Update 27. This patch also needs to be the i586 patch and not the x64 version. If you are unsure what version of the patch you are using, or if the patch is not the correct one, you will need to uninstall all your currently installed Javas patches listed and re-install Java™ 6 Update 27 i586 patch. You should be able to get this from Oracle’s website under the archived patches.

The third step to troubleshooting Tomcat is to give the Windows service and IIS app pool/websites domain admin privileges.  If you are still having trouble with Tomcat after the correct version of Java is installed you will need to go into IIS and Services to make sure you have all the CRM websites and the service running on a domain administrator account. This will take care of any permission issues that Tomcat is running into. To run a service on a specific account, go to Start, Run, and type in ‘Services.msc’. Find the service called ‘Apache Tomcat CRMTomcat6’. NOTE: CRM in the name will be the name of your Sage CRM instance. Right click on the service and go to properties. Go to the log tab, select This Account radio option and assign it to use a domain account. Once you have filled out the user information, click Apply, Ok, and restart the service. To give your website and app pool the needed permissions, go to Start, Run, and type in ‘inetmgr’ to open IIS. On the left side expand your computer, Sites, and Default Web Site.  First click Application Pools, and then right click CRM App Pool from the list. Click Advanced Settings, and  the ellipses next to the Identity option. In the popup screen, select Custom Account, Set. Fill in the domain admin information and click Ok. Now follow the same steps for the CRMRewriter App Pool. Next you need to set the permission on each of the websites for Sage CRM. To do this, click on the website CRM and then select Basic Settings from the right side menu. Click Connect As, select Specific User, and Set. Fill in the Domain Admin information and click Ok. Next double click Authentication from the middle panel and make sure only Anonymous Authentication is enabled, disable all others. To enable or disable an authentication type, right click the name and select the appropriate action. Now right click Anonymous Authentication and select Edit. Select Specific User and Set. Enter the Domain Admins information and click Ok. You will need to follow these steps for the other CRM websites listed below: (The names may vary slightly based on what you called your Sage CRM instance.)

–         CRM

–         crmExchangeSyncEngine

–         crmj

–         crmjspell

–         crmSPSyncEngine

–         crmSyncEngine

–         sdata

Before testing the changes make sure you restart IIS. Go to Start, Run, and type ‘iisreset’.

One last troubleshooting item is to verify that the information in your Tomcat configuration file is correct. To access this file, go to your CRM install directory. Example: “C:Program FilesSageCRM” and click on the folder that has the same name as your instance name for Sage CRM. The default name is CRM. Now drill into the following folders: Tomcat, webapps, crmj (this is based on your installed instance name), and then WEB-INF. Now open the file ‘jdbc.properties’ with notepad. Below is an example of what your file should have in it. The top part of the file will contain a lot of items that start with ‘#’, they can be ignored. Items shown below in “<>” need to be replaced with information from your SQL Server install. NOTE: Make sure you keep a copy of the original information in this file if you are going to attempt to modify it.

jdbc.driver=net.sf.log4jdbc.DriverSpy

jdbc.url=jdbc:log4jdbc:jtds:sqlserver://<SQL Server Name>:<SQL IP>/<CRM Database Name>

jdbc.username=<SQL Sa User Name>

jdbc.password=<SQL Sa Password>

jdbc.minpoolsize=5

jdbc.maxpoolsize=20

jdbc.maxstatementsperconnection=0

jdbc.maxstatements=0

jdbc.sqlgenerator=com.sage.scrm.model.db.util.MSSqlGenerator

jdbc.ddlgenerator=com.sage.scrm.model.metadata.jdbc.MSSqlDDLGenerator

jdbc.connectiontestquery=select @@version

jdbc.isHosted=false

After you have adjusted the file, save the file with the same name, and restart IIS.

Now that you have completed making the adjustments, log into Sage CRM and make sure you are able to use the Sage CRM Tomcat features. You should now see your interactive dashboard working properly. You should be able to be able to export groups and search list to excel. You should also now be able to run mail merges if you are using Sage CRM 7.1 sp2 or newer. While these
items are the most common problems you will run into with Tomcat, you may notice that it’s still not working properly. You may need to re-install your Sage CRM program files again. This will re-install Tomcat as an attempt to fix any problems with it. To do this, run the most recent full install versions you have for Sage CRM and click Change existing install of CRM and select Program Files on the next screen. After this install has run, you will need to re-run all Sage CRM patch installs to get back to your correct version.

Photo by David Haas