Got feedback or spotted a mistake?

Leave a comment at the end of this page or email contact@krishagni.com

Technical problems and solutions

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 the input stream

Reason: The plugin folder has multiple versions of the same plugin. E.g. 

Solution:

  1. Delete the older versions of the plugin jars. I.e. keep only one file per JAR.
  2. Restart the 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.
    • Run 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);


Error: liquibase.exception.MigrationFailedException: Migration failed for change set db/3.3/schema.xml::Add index for faster lookup on specimen label::ckhilosiya:
    Reason: liquibase.exception.DatabaseException: java.sql.SQLException: ORA-01408: such column list already indexed)

Reason: OpenSpecimen is trying to add an Index on a column that already exists.

Solution:

  • Stop OpenSpecimen service (Tomcat)
  • Log in to the database.
  • Find the name of the index on the column.
  • Run the queries:
    • drop index <INDEX_NAME>;
  • Start OpenSpecimen service (Tomcat)


Error: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'os-liquibase' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is liquibase.exception.MigrationFailedException: Migration failed for change set db/4.0/schema.xml::Move existing CP consent tier statement text to coded consent statement table::mdnasim: Reason: liquibase.exception.DatabaseException: java.sql.SQLException: ORA-12899: value too large for column.

Reason: Consent statement value is too large for the STATEMENT column; table OS_CONSENT_STATEMENTS.

Solution:

  • Stop OpenSpecimen service (Tomcat)
  • Log in to the database.
  • Run the queries:
    • alter table OS_CONSENT_STATEMENTS modify STATEMENT VARCHAR2(4000);
      
  • Start OpenSpecimen service (Tomcat)


Got feedback or spotted a mistake?

Leave a comment at the end of this page or email contact@krishagni.com