ERROR org.springframework.web.context.ContextLoader- Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException: Could not parse mapping document from input stream
Reason: Plugin folder has multiple version of the same plugin. E.g.
Solution:
- Delete the older versions of the plugin jars. I.e. keep only one file per JAR.
- Restart Tomcat server.
Error: "Invocation of init method failed; nested exception is liquibase.exception.DatabaseException:" com.mysql.MysqlDataTruncation: Data : Data too long for column 'AUTHOR' at row.
Reason: Due to failure of changeset "<changeSet id="vgaikwad" author="Add import rights to all roles having create, update and delete rights on resource" dbms="mysql">"
Solution:
- Stop OpenSpecimen service (Tomcat)
- Login to Database.
- Fire this query: alter table databasechangelog change author author varchar(255);
- Start OpenSpecimen service (Tomcat)
Error: Caused by: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [INSERT INTO OS_SC_SPMN_REQUESTS(REQUESTOR, REQUESTOR_EMAIL, REQUESTOR_INSTITUTE, REASON, SHIPPING_ADDR, COMMENTS, IDENTIFIER) VALUES(?, ?, ?, ?, ?, ?, ?)]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'os_20.os_sc_spmn_requests' doesn't exist
Reason: The database table expected by the specimen request form is missing.
Solution:
- Login to the database.
- Run the query:
- Adding the missing table:
CREATE TABLE OS_SC_SPMN_REQUESTS (REQUESTOR VARCHAR(255), REQUESTOR_EMAIL VARCHAR(255), REQUESTOR_INSTITUTE VARCHAR(255), REASON TEXT, SHIPPING_ADDR TEXT, COMMENTS TEXT, IDENTIFIER BIGINT NOT NULL);