java.lang.ExceptionInInitializerError at org.alfresco.trashcan.TrashcanCleanerTest. <clinit>(TrashcanCleanerTest.java:67) - PullRequest
0 голосов
/ 26 июня 2018

Как я могу решить

java.lang.ExceptionInInitializerError
 at org.alfresco.trashcan.TrashcanCleanerTest.<clinit>(TrashcanCleanerTest.java:67)

Я сбросил https://github.com/Alfresco/alfresco-trashcan-cleaner-module и побежал mvn clean install Не удалось с этим:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.alfresco.trashcan.TrashcanCleanerTest
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 17.477 sec <<< FAILURE! - in org.alfresco.trashcan.TrashcanCleanerTest
testCleanBatch(org.alfresco.trashcan.TrashcanCleanerTest)  Time elapsed: 0.007 sec  <<< ERROR!
java.lang.ExceptionInInitializerError
 at org.alfresco.trashcan.TrashcanCleanerTest.<clinit>(TrashcanCleanerTest.java:67)

testCleanSimple(org.alfresco.trashcan.TrashcanCleanerTest)  Time elapsed: 0 sec  <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class org.alfresco.trashcan.TrashcanCleanerTest


Results :

Tests in error: 
  TrashcanCleanerTest.testCleanBatch » ExceptionInInitializer
  TrashcanCleanerTest.testCleanSimple » NoClassDefFound Could not initialize cla...

Tests run: 2, Failures: 0, Errors: 2, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25.667 s
[INFO] Finished at: 2018-06-26T13:05:46-04:00
[INFO] Final Memory: 76M/3925M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project alfresco-trashcan-cleaner: There are test failures.
[ERROR] 
[ERROR] Please refer to /Users/owiana/Downloads/alfresco-trashcan-cleaner-module-master/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

Не удалось запустить эту строку: private static ApplicationContext applicationContext = ApplicationContextHelper.getApplicationContext();

Вопрос: почему?

Моя Java

$ java -version
java version "1.8.0_152"
Java(TM) SE Runtime Environment (build 1.8.0_152-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)

Возможно, я пытаюсь ошибиться. Какой шаг я пропускаю?

1 Ответ

0 голосов
/ 27 июня 2018

Попробуйте пропустить тесты, выполнив mvn clean install -DskipTests

...