Skip to content

Instantly share code, notes, and snippets.

@mks-d
Last active October 17, 2016 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mks-d/705870ebb9886af4880eaf2911bbb644 to your computer and use it in GitHub Desktop.
Save mks-d/705870ebb9886af4880eaf2911bbb644 to your computer and use it in GitHub Desktop.
ObsResource1_9 cannot be cast to ComplexObsResource1_10
drmac:openmrs-module-visitdocumentsui dimitri$ mvn clean install
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.openmrs.module:visitdocumentsui-omod:jar:1.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-dependency-plugin @ org.openmrs.module:visitdocumentsui-omod:[unknown-version], /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/omod/pom.xml, line 314, column 12
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Visit Documents UI
[INFO] Visit Documents UI API
[INFO] Visit Documents UI API 1.11
[INFO] Visit Documents UI API 2.0
[INFO] Visit Documents UI OMOD
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Visit Documents UI 1.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ visitdocumentsui ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ visitdocumentsui ---
[INFO] Installing /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/pom.xml to /Users/dimitri/.m2/repository/org/openmrs/module/visitdocumentsui/1.1-SNAPSHOT/visitdocumentsui-1.1-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Visit Documents UI API 1.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ visitdocumentsui-api ---
[INFO] Deleting /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/api/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ visitdocumentsui-api ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 6 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ visitdocumentsui-api ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 14 source files to /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/api/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ visitdocumentsui-api ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ visitdocumentsui-api ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/api/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ visitdocumentsui-api ---
[INFO] Surefire report directory: /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/api/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.openmrs.module.visitdocumentsui.obs.ImageDocumentHandlerTest
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/dimitri/.m2/repository/org/slf4j/slf4j-log4j12/1.6.0/slf4j-log4j12-1.6.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/dimitri/.m2/repository/org/slf4j/slf4j-log4j12/1.6.0/slf4j-log4j12-1.6.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
log4j:ERROR A "org.apache.log4j.xml.DOMConfigurator" object is not assignable to a "org.apache.log4j.spi.Configurator" variable.
log4j:ERROR The class "org.apache.log4j.spi.Configurator" was loaded by
log4j:ERROR [org.powermock.core.classloader.MockClassLoader@5cf2baac] whereas object of type
log4j:ERROR "org.apache.log4j.xml.DOMConfigurator" was loaded by [sun.misc.Launcher$AppClassLoader@325e9e34].
log4j:ERROR Could not instantiate configurator [org.apache.log4j.xml.DOMConfigurator].
log4j:WARN No appenders could be found for logger (org.openmrs.obs.handler.AbstractHandler).
log4j:WARN Please initialize the log4j system properly.
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.704 sec
Running org.openmrs.module.visitdocumentsui.obs.ValueComplexTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.365 sec
Running org.openmrs.module.visitdocumentsui.VisitDocumentsContextTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.375 sec
Results :
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ visitdocumentsui-api ---
[INFO] Building jar: /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/api/target/visitdocumentsui-api-1.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ visitdocumentsui-api ---
[INFO] Installing /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/api/target/visitdocumentsui-api-1.1-SNAPSHOT.jar to /Users/dimitri/.m2/repository/org/openmrs/module/visitdocumentsui-api/1.1-SNAPSHOT/visitdocumentsui-api-1.1-SNAPSHOT.jar
[INFO] Installing /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/api/pom.xml to /Users/dimitri/.m2/repository/org/openmrs/module/visitdocumentsui-api/1.1-SNAPSHOT/visitdocumentsui-api-1.1-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Visit Documents UI API 1.11 1.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ visitdocumentsui-api-1.11 ---
[INFO] Deleting /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/api-1.11/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ visitdocumentsui-api-1.11 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/api-1.11/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ visitdocumentsui-api-1.11 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/api-1.11/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ visitdocumentsui-api-1.11 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/api-1.11/src/test/resources
[INFO] skip non existing resourceDirectory /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/api-1.11/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ visitdocumentsui-api-1.11 ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ visitdocumentsui-api-1.11 ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ visitdocumentsui-api-1.11 ---
[INFO] Building jar: /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/api-1.11/target/visitdocumentsui-api-1.11-1.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ visitdocumentsui-api-1.11 ---
[INFO] Installing /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/api-1.11/target/visitdocumentsui-api-1.11-1.1-SNAPSHOT.jar to /Users/dimitri/.m2/repository/org/openmrs/module/visitdocumentsui-api-1.11/1.1-SNAPSHOT/visitdocumentsui-api-1.11-1.1-SNAPSHOT.jar
[INFO] Installing /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/api-1.11/pom.xml to /Users/dimitri/.m2/repository/org/openmrs/module/visitdocumentsui-api-1.11/1.1-SNAPSHOT/visitdocumentsui-api-1.11-1.1-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Visit Documents UI API 2.0 1.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ visitdocumentsui-api-2.0 ---
[INFO] Deleting /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/api-2.0/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ visitdocumentsui-api-2.0 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/api-2.0/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ visitdocumentsui-api-2.0 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/api-2.0/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ visitdocumentsui-api-2.0 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/api-2.0/src/test/resources
[INFO] skip non existing resourceDirectory /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/api-2.0/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ visitdocumentsui-api-2.0 ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ visitdocumentsui-api-2.0 ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ visitdocumentsui-api-2.0 ---
[INFO] Building jar: /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/api-2.0/target/visitdocumentsui-api-2.0-1.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ visitdocumentsui-api-2.0 ---
[INFO] Installing /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/api-2.0/target/visitdocumentsui-api-2.0-1.1-SNAPSHOT.jar to /Users/dimitri/.m2/repository/org/openmrs/module/visitdocumentsui-api-2.0/1.1-SNAPSHOT/visitdocumentsui-api-2.0-1.1-SNAPSHOT.jar
[INFO] Installing /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/api-2.0/pom.xml to /Users/dimitri/.m2/repository/org/openmrs/module/visitdocumentsui-api-2.0/1.1-SNAPSHOT/visitdocumentsui-api-2.0-1.1-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Visit Documents UI OMOD 1.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ visitdocumentsui-omod ---
[INFO] Deleting /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/omod/target
[INFO]
[INFO] --- maven-openmrs-plugin:1.0.1:initialize-module (init) @ visitdocumentsui-omod ---
[INFO]
[INFO] --- maven-dependency-plugin:2.4:unpack-dependencies (Expand moduleApplicationContext and messages) @ visitdocumentsui-omod ---
[INFO] Unpacking /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/api/target/visitdocumentsui-api-1.1-SNAPSHOT.jar to /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/omod/target/classes with includes "**/*" and excludes ""
[INFO]
[INFO] --- maven-dependency-plugin:2.4:unpack (Fetch SASS sources from uicommons) @ visitdocumentsui-omod ---
[INFO] Configured Artifact: org.openmrs.module:uicommons-scss:1.4:zip
[INFO] Unpacking /Users/dimitri/.m2/repository/org/openmrs/module/uicommons-scss/1.4/uicommons-scss-1.4.zip to /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/omod/src/main/compass/sass-external with includes "" and excludes ""
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ visitdocumentsui-omod ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 5 resources
[INFO] Copying 39 resources to web/module
[INFO] Copying 0 resource to web/module
[INFO] Copying 39 resources to web/module
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ visitdocumentsui-omod ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 9 source files to /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/omod/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ visitdocumentsui-omod ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/omod/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ visitdocumentsui-omod ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/omod/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ visitdocumentsui-omod ---
[INFO] Surefire report directory: /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/omod/target/surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.openmrs.module.visitdocumentsui.rest.ComplexObsResource1_10Test
ERROR - Context.getServiceContext(251) |2016-10-17 14:16:52,827| serviceContext is null. Creating new ServiceContext()
Tests run: 4, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 29.346 sec <<< FAILURE!
shouldRunTest(org.openmrs.module.visitdocumentsui.rest.ComplexObsResource1_10Test) Time elapsed: 27.732 sec <<< ERROR!
java.lang.ClassCastException: org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_9.ObsResource1_9 cannot be cast to org.openmrs.module.visitdocumentsui.rest.ComplexObsResource1_10
at org.openmrs.module.visitdocumentsui.rest.ComplexObsResource1_10Test.shouldRunTest(ComplexObsResource1_10Test.java:28)
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:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
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:606)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Running org.openmrs.module.visitdocumentsui.rest.ObsByConceptListSearchHandler1_10Test
Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.484 sec
Running org.openmrs.module.visitdocumentsui.web.controller.VisitDocumentsControllerTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec
Results :
Tests in error:
shouldRunTest(org.openmrs.module.visitdocumentsui.rest.ComplexObsResource1_10Test): org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_9.ObsResource1_9 cannot be cast to org.openmrs.module.visitdocumentsui.rest.ComplexObsResource1_10
Tests run: 14, Failures: 0, Errors: 1, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Visit Documents UI ................................. SUCCESS [ 0.297 s]
[INFO] Visit Documents UI API ............................. SUCCESS [ 15.160 s]
[INFO] Visit Documents UI API 1.11 ........................ SUCCESS [ 1.932 s]
[INFO] Visit Documents UI API 2.0 ......................... SUCCESS [ 2.200 s]
[INFO] Visit Documents UI OMOD ............................ FAILURE [ 37.817 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 58.145 s
[INFO] Finished at: 2016-10-17T14:17:06+02:00
[INFO] Final Memory: 51M/982M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project visitdocumentsui-omod: There are test failures.
[ERROR]
[ERROR] Please refer to /Volumes/Data/Users/dimitri/MEGA/repos/openmrs-module-visitdocumentsui/omod/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 :visitdocumentsui-omod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment