Error "Failed to Load Application Context" When building Metada sharing module

hi all , am trying to build the metadasharing module but am geting errors even before i make any local change. some of the errors are here https://pastebin.com/eaBBgqqe. onother errors is like “DB closed already”

cc @samuel34 @dkayiwa

@mozzy is this class available org/openmrs/module/reporting/query/BaseQuery.class

u could be having some corrupt jars in .m2 for reporting

1 Like

@herbert24 , the class is not available , but i wonder y would it not be available when i have just freshly cloned the module

thats possible if you had are working on a branch for which you have arleady pushed too

@herbert24, your right. though in my case , i only clone from the master , and i never push to my master branch

@k.joseph thanks . let me try deleting the jars and try to download them again

@k.joseph and @herbert24… look this database error while builidng a fresh metadatasharing module without any of my local changes

RROR - SchemaExport.execute(287) |2019-03-19 13:27:56,769| schema export unsuccessful
org.h2.jdbc.JdbcSQLException: Database is already closed (to disable automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the db URL) [90121-135]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
        at org.h2.message.DbException.get(DbException.java:167)
        at org.h2.message.DbException.get(DbException.java:144)
        at org.h2.message.DbException.get(DbException.java:133)
        at org.h2.jdbc.JdbcConnection.checkClosed(JdbcConnection.java:1348)
        at org.h2.jdbc.JdbcConnection.checkClosed(JdbcConnection.java:1323)
        at org.h2.jdbc.JdbcConnection.getAutoCommit(JdbcConnection.java:386)
        at com.mchange.v2.c3p0.impl.NewProxyConnection.getAutoCommit(NewProxyConnection.java:985)
        at org.hibernate.connection.C3P0ConnectionProvider.getConnection(C3P0ConnectionProvider.java:82)
        at org.hibernate.tool.hbm2ddl.SuppliedConnectionProviderConnectionHelper.prepare(SuppliedConnectionProviderConnectionHelper.java:51)
        at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:263)
        at org.hibernate.tool.hbm2ddl.SchemaExport.drop(SchemaExport.java:229)
        at org.hibernate.impl.SessionFactoryImpl.close(SessionFactoryImpl.java:961)
        at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.destroy(AbstractSessionFactoryBean.java:251)
        at org.springframework.orm.hibernate3.LocalSessionFactoryBean.destroy(LocalSessionFactoryBean.java:899)
        at org.openmrs.api.db.hibernate.HibernateSessionFactoryBean.destroy(HibernateSessionFactoryBean.java:192)
        at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:184)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:487)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:463)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:431)
        at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1048)
        at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1022)
        at org.springframework.context.support.AbstractApplicationContext$3.run(AbstractApplicationContext.java:940)

Results :

Tests in error:
  convert_shouldReplaceSourceIfTheFromVersionIsPreOneNine(org.openmrs.module.metadatasharing.converter.ConceptMapConverterTest): File 'D:\openMrs\code\tickets\move-emr%20util%20class\META-363-pure\openmrs-module-metadatasharing\api-test\target\test-classes\testConceptMapXmlFile.xml' does not exist
  convert_shouldReplaceNothingIfTheToVersionIsPostOneNine(org.openmrs.module.metadatasharing.converter.ConceptMapConverterTest): File 'D:\openMrs\code\tickets\move-emr%20util%20class\META-363-pure\openmrs-module-metadatasharing\api-test\target\test-classes\testConceptMapXmlFile.xml' does not exist
  convert_shouldConvertAMessageDownToOneDotSix(org.openmrs.module.metadatasharing.util.VersionConverterTest): File 'D:\openMrs\code\tickets\move-emr%20util%20class\META-363-pure\openmrs-module-metadatasharing\api-test\target\test-classes\VersionConverterTest-metadata-to-16.xml' does not exist
  convert_shouldConvertAMessageFromOneDotSix(org.openmrs.module.metadatasharing.util.VersionConverterTest): File 'D:\openMrs\code\tickets\move-emr%20util%20class\META-363-pure\openmrs-module-metadatasharing\api-test\target\test-classes\VersionConverterTest-metadata-from-16.xml' does not exist
Tests run: 177, Failures: 0, Errors: 4, Skipped: 6

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Metadata Sharing Module ............................ SUCCESS [46:55 min]
[INFO] Metadata Sharing Module API Common ................. SUCCESS [11:44 min]
[INFO] Metadata Sharing Module API 1.9 .................... SUCCESS [01:00 min]
[INFO] Metadata Sharing Module API 1.11 ................... SUCCESS [03:48 min]
[INFO] Metadata Sharing Module API 2.0 .................... SUCCESS [03:10 min]
[INFO] Metadata Sharing Module API ........................ SUCCESS [  0.923 s]
[INFO] Metadata Sharing Module API Test ................... FAILURE [01:31 min]
[INFO] Metadata Sharing Module OMOD ....................... SKIPPED
[INFO] Metadata Sharing Module Integration Test ........... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:08 h
[INFO] Finished at: 2019-03-19T13:27:57+03:00
[INFO] Final Memory: 41M/263M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project metadatasharing-api-test: There are test failures.
[ERROR]
[ERROR] Please refer to D:\openMrs\code\tickets\move-emr util class\META-363-pure\openmrs-module-metadatasharing\api-test\target\surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :metadatasharing-api-test

Remove spaces in your project path and compile again.

1 Like

thanks @dkayiwa, am trying that …ill update the results

woow it worked pretty fine. i had spaces in the name of one of my folders in the project directory

1 Like

that sounds awesome

1 Like