The following error is seen int he $SECROOT/tomcat/logs/stdout.log (Windows) catalina.out (Linux) which prevents the Spectrum Report Manager (SRM) from starting.
Sep 18, 2010 11:23:31 AM (Thread-55) (AssetManagerLogging) - (ERROR) - addDeviceModel()
Caused by: org.springframework.dao.DataIntegrityViolationException:
PreparedStatementCallback; SQL [UPDATE entity SET current_model_key=0 WHERE current_model_key=?]; Duplicate entry '0' for key 2; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException:
Duplicate entry '0' for key 2
The fix is to manually remove the duplicate key from MYSQL.
1. Log into the SRM system as the user that owns the Spectrum installation
2. If on Windows, start a bash shell by running "bash -login"
3. cd to the $SPECROOT/mysql/bin directory and enter the following command to log into mysql:
./mysql --defaults-file=../my-spectrum.cnf -uroot -proot reporting
4. Enter the following command at the mysql prompt to delete the duplicate entry:
delete from entity where current_model_key = 0;
5. Restart tomcat