Failed to initialize Information Model - "Error creating bean with name 'informationModel' defined in ServletContext" CONTENT_MISSING

Failed to initialize Information Model - "Error creating bean with name 'informationModel' defined in ServletContext" CONTENT_MISSING

book

Article ID: KB0075878

calendar_today

Updated On:

Products Versions
Spotfire Server ALL Versions

Description

Spotfire Server fails to start with the error - Failed to initialize Information Model - "Error creating bean with name 'informationModel' defined in ServletContext" 

Caused by: com.spotfire.server.ServerInitializationException: Failed to initialized Information Model
   at com.spotfire.ws.im.InformationModel.initImpl(InformationModel.java:101)
   at com.spotfire.server.AbstractInitializable.init(AbstractInitializable.java:52)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:601)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1544)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1485)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
   ... 26 more
Caused by: com.spotfire.ws.im.IMException: Failed to get elements of type spotfire.datasource
   at com.spotfire.ws.im.element.LibraryStorage.getAllOfType(LibraryStorage.java:395)
   at com.spotfire.ws.im.element.DataSourceCollection.retrieveAllDataSources(DataSourceCollection.java:256)
   at com.spotfire.ws.im.element.DataSourceCollection.init(DataSourceCollection.java:96)
   at com.spotfire.ws.im.element.ElementModel.init(ElementModel.java:112)
   at com.spotfire.ws.im.InformationModel.initImpl(InformationModel.java:99)
   ... 34 more
Caused by: com.spotfire.ws.library.StorageException, CONTENT_MISSING, c4d779f6-5a31-4ac7-a44b-d19cd86e9222
   at com.spotfire.ws.library.AbstractPersister.loadContent(AbstractPersister.java:890)
   at com.spotfire.ws.library.LibraryManagerImpl.search(LibraryManagerImpl.java:1509)
   at com.spotfire.ws.im.element.LibraryStorage.getAllOfType(LibraryStorage.java:393)
   ... 38 more

Cause:
Inconsistency in database or record missing in the LIB_DATA table but the child record is still present in the LIB_ITEMS table. Generally seen if the database backups did not restore properly or something has been manually deleted from the Spotfire Database.
 

Issue/Introduction

Spotfire Server fails to start with the error - Failed to initialize Information Model - "Error creating bean with name 'informationModel' defined in ServletContext" CONTENT_MISSING

Resolution

Run two queries against the Spotfire database to check if the required rows existed for the item_id xxxxx-xxxxx-xxxxx-xxxxx-xxx
e.g. c4d779f6-5a31-4ac7-a44b-d19cd86e9222:

SELECT count(*) FROM lib_items WHERE item_id = 'c4d779f6-5a31-4ac7-a44b-d19cd86e9222';
> 1 row(s) found

SELECT count(*) FROM lib_data WHERE item_id = 'c4d779f6-5a31-4ac7-a44b-d19cd86e9222';
> 0 row(s) found

Run the following query to check if more than one record is missing.

Select * from  LIB_ITEMS where item_id in (select ITEM_ID from LIB_ITEMS li where li.ITEM_TYPE = 'e3fd5644-07a1-4a09-b05b-1d148f1f6786' and not exists (select 1 from LIB_DATA ld where ld.ITEM_ID = li.ITEM_ID))

If more than one record is missing, check if you can restore the backup.
 
If only once record is missing, delete the record form the LIB_ITEMS table.

Make sure you make backups before you delete any records.

Delete FROM lib_items WHERE item_id = 'c4d779f6-5a31-4ac7-a44b-d19cd86e9222';