2017-02-13 15 views
0

У меня есть проект Jenkins, который невозможно запустить из-за невозможности создать экземпляр класса TestNG IReporter, CustomReportListener.java (CRL). Если я удалю все ссылки на него, проект будет работать нормально, но мне нужно вернуть результаты через CRL. Наконец, CRL является частью структуры, которую мы включаем в JAR, и у теста, по-видимому, нет проблем с использованием какого-либо другого класса внутри JAR.Maven Surefire не может создать экземпляр класса IReporter на Jenkins

Главная Ошибка

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project fordna: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test failed: There was an error in the forked process 
[ERROR] org.testng.TestNGException: 
[ERROR] 
[ERROR] Cannot instantiate class com.perficient.util.result.CustomReportListener 
[ERROR] at org.testng.internal.ClassHelper.newInstance(ClassHelper.java:53) 
[ERROR] at org.testng.TestNG.initializeConfiguration(TestNG.java:981) 
[ERROR] at org.testng.TestNG.run(TestNG.java:1089) 
[ERROR] at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:281) 
[ERROR] at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75) 
[ERROR] at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:121) 
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290) 
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242) 
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121) 
[ERROR] Caused by: java.lang.ExceptionInInitializerError 
[ERROR] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
[ERROR] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) 
[ERROR] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 
[ERROR] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) 
[ERROR] at java.lang.Class.newInstance(Class.java:442) 
[ERROR] at org.testng.internal.ClassHelper.newInstance(ClassHelper.java:51) 
[ERROR] ... 8 more 
[ERROR] Caused by: java.lang.NullPointerException 
[ERROR] at sun.awt.shell.Win32ShellFolder2.access$200(Win32ShellFolder2.java:72) 
[ERROR] at sun.awt.shell.Win32ShellFolder2$1.call(Win32ShellFolder2.java:242) 
[ERROR] at sun.awt.shell.Win32ShellFolder2$1.call(Win32ShellFolder2.java:237) 
[ERROR] at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
[ERROR] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
[ERROR] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
[ERROR] at sun.awt.shell.Win32ShellFolderManager2$ComInvoker$3.run(Win32ShellFolderManager2.java:547) 
[ERROR] at java.lang.Thread.run(Thread.java:745) 
[ERROR] -> [Help 1] 

Я пробовал много подходов, в том числе и запустить его на Дженкинс как фристайл работу, и пытается выполнить следующие Surefire параметры, как правило, один на один:

  • <groupId>org.apache.maven.surefire</groupId> <artifactId>surefire-testng</artifactId> <version>2.19.1</version>
  • <useManifestOnlyJar>false</useManifestOnlyJar>
  • <useSystemClassLoader>false</useSystemClassLoader>
  • <reuseForks>false</reuseForks>
  • <forkCount>0</forkCount>

Full (стандарт) строить результаты:

Building in workspace C:\Program Files (x86)\Jenkins\jobs\QA_FOC_Brochures_Alpha\[email protected] 
Updating https://subversion.thecompany.com/svn/automation-test-center/trunk/FunctionalAutomation/ExampleProject at revision '2017-02-13T11:22:42.215 -0500' 
A   target\log4j2.xml 
U   pom.xml 
At revision 3271 

Parsing POMs 
Modules changed, recalculating dependency graph 
Established TCP socket on 56149 
[[email protected]] $ "C:\Program Files\Java\jdk1.8.0_121/bin/java" -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=5001 -cp "C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven33-agent-1.8.1.jar;C:\Maven3.3.9\apache-maven-3.3.9\boot\plexus-classworlds-2.5.2.jar;C:\Maven3.3.9\apache-maven-3.3.9/conf/logging" jenkins.maven3.agent.Maven33Main C:\Maven3.3.9\apache-maven-3.3.9 "C:\Program Files (x86)\Jenkins\war\WEB-INF\lib\remoting-3.4.1.jar" "C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven33-interceptor-1.8.1.jar" "C:\Program Files (x86)\Jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-1.8.1.jar" 56149 
Listening for transport dt_socket at address: 5001 
<===[JENKINS REMOTING CAPACITY]===>channel started 
Executing Maven: -B -f C:\Program Files (x86)\Jenkins\jobs\QA_FOC_Brochures_Alpha\[email protected]\pom.xml clean test -e -DsuiteFile=src/main/test/suites/ca/alpha/desktop/QA_FOC_Brochures_Alpha.xml -Drunvehicle=All Models 
[INFO] Error stacktraces are turned on. 
[INFO] Scanning for projects... 
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.thecompany.automation:example-project:jar:2.0.0-SNAPSHOT 
[WARNING] 'dependencies.dependency.systemPath' for com.thecompany.automation:automation-util:jar should not point at files within the project directory, ${basedir}/src/resources/lib/automation-util-1.18.1.jar will be unresolvable by dependent projects @ line 104, column 16 
[WARNING] 'dependencies.dependency.systemPath' for com.gamma.servicesapi:servicesapi:jar should not point at files within the project directory, ${basedir}/src/resources/lib/ServicesClientLibrary-1.2.112.jar will be unresolvable by dependent projects @ line 111, column 16 
[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] ------------------------------------------------------------------------ 
[INFO] Building ExampleProject 2.0.0-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ example-project --- 
[INFO] Deleting C:\Program Files (x86)\Jenkins\jobs\QA_FOC_Brochures_Alpha\[email protected]\target 
[INFO] 
[INFO] --- build-helper-maven-plugin:3.0.0:add-source (add-source) @ example-project --- 
[INFO] Source directory: C:\Program Files (x86)\Jenkins\jobs\QA_FOC_Brochures_Alpha\[email protected]\src\main\objects added. 
[INFO] Source directory: C:\Program Files (x86)\Jenkins\jobs\QA_FOC_Brochures_Alpha\[email protected]\src\main\test\classes added. 
[INFO] Source directory: C:\Program Files (x86)\Jenkins\jobs\QA_FOC_Brochures_Alpha\[email protected]\src\main\test\suites added. 
[INFO] 
[INFO] --- build-helper-maven-plugin:3.0.0:add-resource (add-resource) @ example-project --- 
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ example-project --- 
[INFO] Using 'UTF-8' encoding to copy filtered resources. 
[INFO] skip non existing resourceDirectory C:\Program Files (x86)\Jenkins\jobs\QA_FOC_Brochures_Alpha\[email protected]\src\main\resources 
[INFO] Copying 19 resources to resources 
[INFO] 
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ example-project --- 
[INFO] Changes detected - recompiling the module! 
[INFO] Compiling 212 source files to C:\Program Files (x86)\Jenkins\jobs\QA_FOC_Brochures_Alpha\[email protected]\target\classes 
[INFO] /C:/Program Files (x86)/Jenkins/jobs/QA_FOC_Brochures_Alpha/[email protected]/src/main/objects/com/alpha/global/Leads.java: Some input files use or override a deprecated API. 
[INFO] /C:/Program Files (x86)/Jenkins/jobs/QA_FOC_Brochures_Alpha/[email protected]/src/main/objects/com/alpha/global/Leads.java: Recompile with -Xlint:deprecation for details. 
[INFO] /C:/Program Files (x86)/Jenkins/jobs/QA_FOC_Brochures_Alpha/[email protected]/src/main/test/classes/com/alpha/global/TC_GUX_BNP.java: C:\Program Files (x86)\Jenkins\jobs\QA_FOC_Brochures_Alpha\[email protected]\src\main\test\classes\com\alpha\global\TC_GUX_BNP.java uses unchecked or unsafe operations. 
[INFO] /C:/Program Files (x86)/Jenkins/jobs/QA_FOC_Brochures_Alpha/[email protected]/src/main/test/classes/com/alpha/global/TC_GUX_BNP.java: Recompile with -Xlint:unchecked for details. 
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ example-project --- 
[INFO] Using 'UTF-8' encoding to copy filtered resources. 
[INFO] skip non existing resourceDirectory C:\Program Files (x86)\Jenkins\jobs\QA_FOC_Brochures_Alpha\[email protected]\src\test\resources 
[INFO] 
[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) @ example-project --- 
[INFO] No sources to compile 
[INFO] 
[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ example-project --- 
[INFO] No tests to run. 
[INFO] Surefire report directory: C:\Program Files (x86)\Jenkins\jobs\QA_FOC_Brochures_Alpha\[email protected]\test-output 
Running TestSuite 
Results : 

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

[JENKINS] Recording test results 
hudson.AbortException: Test reports were found but none of them are new. Did tests run? 
For example, C:\Program Files (x86)\Jenkins\jobs\QA_FOC_Brochures_Alpha\[email protected]\test-output\TEST-TestSuite.xml is 1 hr 51 min old 

    at hudson.tasks.junit.TestResult.parse(TestResult.java:228) 
    at hudson.maven.reporters.SurefireArchiver.postExecute(SurefireArchiver.java:148) 
    at hudson.maven.Maven3Builder$MavenExecutionListener.recordMojoEnded(Maven3Builder.java:623) 
    at hudson.maven.Maven3Builder$MavenExecutionListener.mojoFailed(Maven3Builder.java:656) 
    at hudson.maven.Maven3Builder$JenkinsEventSpy.onEvent(Maven3Builder.java:300) 
    at org.apache.maven.eventspy.internal.EventSpyDispatcher.onEvent(EventSpyDispatcher.java:104) 
    at org.apache.maven.eventspy.internal.EventSpyExecutionListener.mojoFailed(EventSpyExecutionListener.java:138) 
    at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire(DefaultExecutionEventCatapult.java:90) 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:219) 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) 
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) 
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) 
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) 
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) 
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) 
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) 
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) 
    at org.jvnet.hudson.maven3.launcher.Maven33Launcher.main(Maven33Launcher.java:129) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:498) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238) 
    at jenkins.maven3.agent.Maven33Main.launch(Maven33Main.java:176) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:498) 
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:133) 
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:68) 
    at hudson.remoting.UserRequest.perform(UserRequest.java:153) 
    at hudson.remoting.UserRequest.perform(UserRequest.java:50) 
    at hudson.remoting.Request$2.run(Request.java:336) 
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
    at java.lang.Thread.run(Thread.java:745) 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 37.141 s 
[INFO] Finished at: 2017-02-13T11:23:42-05:00 
[INFO] Final Memory: 31M/266M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project example-project: Exception in provider: 
[ERROR] Cannot instantiate class com.thecompany.util.result.CustomReportListener: ExceptionInInitializerError: NullPointerException 
[ERROR] -> [Help 1] 
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project example-project: Exception in provider 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212) 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) 
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) 
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) 
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) 
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) 
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) 
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) 
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) 
    at org.jvnet.hudson.maven3.launcher.Maven33Launcher.main(Maven33Launcher.java:129) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:498) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:330) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:238) 
    at jenkins.maven3.agent.Maven33Main.launch(Maven33Main.java:176) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:498) 
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:133) 
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:68) 
    at hudson.remoting.UserRequest.perform(UserRequest.java:153) 
    at hudson.remoting.UserRequest.perform(UserRequest.java:50) 
    at hudson.remoting.Request$2.run(Request.java:336) 
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
    at java.lang.Thread.run(Thread.java:745) 
Caused by: org.apache.maven.plugin.MojoFailureException: Exception in provider 
    at org.apache.maven.plugin.surefire.SurefirePlugin.assertNoException(SurefirePlugin.java:328) 
    at org.apache.maven.plugin.surefire.SurefirePlugin.handleSummary(SurefirePlugin.java:318) 
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:892) 
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:755) 
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) 
    ... 31 more 
Caused by: org.apache.maven.surefire.booter.SurefireExecutionException: Exception in provider 
    at org.apache.maven.plugin.surefire.InPluginVMSurefireStarter.runSuitesInProcess(InPluginVMSurefireStarter.java:87) 
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1010) 
    at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:862) 
    ... 34 more 
Caused by: org.testng.TestNGException: 
Cannot instantiate class com.thecompany.util.result.CustomReportListener 
    at org.testng.internal.ClassHelper.newInstance(ClassHelper.java:53) 
    at org.testng.TestNG.initializeConfiguration(TestNG.java:981) 
    at org.testng.TestNG.run(TestNG.java:1089) 
    at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:281) 
    at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75) 
    at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:121) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:498) 
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:202) 
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:155) 
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:81) 
    at org.apache.maven.plugin.surefire.InPluginVMSurefireStarter.runSuitesInProcess(InPluginVMSurefireStarter.java:82) 
    ... 36 more 
Caused by: java.lang.ExceptionInInitializerError 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) 
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423) 
    at java.lang.Class.newInstance(Class.java:442) 
    at org.testng.internal.ClassHelper.newInstance(ClassHelper.java:51) 
    ... 49 more 
Caused by: java.lang.NullPointerException 
    at sun.awt.shell.Win32ShellFolder2.access$200(Win32ShellFolder2.java:72) 
    at sun.awt.shell.Win32ShellFolder2$1.call(Win32ShellFolder2.java:242) 
    at sun.awt.shell.Win32ShellFolder2$1.call(Win32ShellFolder2.java:237) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
    at sun.awt.shell.Win32ShellFolderManager2$ComInvoker$3.run(Win32ShellFolderManager2.java:547) 
    ... 1 more 
[ERROR] 
[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 
[JENKINS] Archiving C:\Program Files (x86)\Jenkins\jobs\QA_FOC_Brochures_Alpha\[email protected]\pom.xml to com.thecompany.automation/example-project/2.0.0-SNAPSHOT/example-project-2.0.0-SNAPSHOT.pom 
channel stopped 
Finished: FAILURE 

Далее, если я удалить вызов CRL в моем наборе тестов, он будет пытаться бежать и вернуть эту ошибку вместо , после обращения к одному из статических методов CRL:

Ошибка вызова статического метода CRL

Tests run: 10, Failures: 10, Errors: 0, Skipped: 0, Time elapsed: 12.843 sec <<< FAILURE! - in TestSuite 
init(ca.alpha.desktop.TC_FOC_Brochures) Time elapsed: 0.39 sec <<< FAILURE! 
java.lang.ExceptionInInitializerError 
    at ca.alpha.desktop.TC_FOC_Brochures.init(TC_FOC_Brochures.java:98) 
Caused by: java.lang.NullPointerException 

... с:

Results : 

Failed tests: 
ca.ford.desktop.TC_FOC_Brochures.init(ca.alpha.desktop.TC_FOC_Brochures) 
    Run 1: TC_FOC_Brochures.init:98 ExceptionInInitializer 
    Run 2: TC_FOC_Brochures.init:98 NoClassDefFound Could not initialize class com.thecom... 

Кто-нибудь запустить в ошибку, как это? Куда я иду отсюда? Заранее спасибо.

+0

Не могли бы вы поделиться код вашего CRL? – juherr

+0

Я думаю, что CRL пытается использовать 'JFileChooser': http://stackoverflow.com/questions/23614605/npe-in-win32shellfolder2-access-when-creating-new-jfilechooser-as-local-system-a – juherr

+0

@juherr Да; Я добавил ссылку в начале, где я называю ее аббревиатурой (CRL) –

ответ

2

Заменить строку (которая терпит неудачу из-за javax.swing.filechooser.FileSystemView)

public static final String BACKUP_DIRECTORY = 
     FileSystemView.getFileSystemView().getHomeDirectory().getAbsolutePath() + "\\Selenium Results\\"; 

По

public static final String BACKUP_DIRECTORY = 
     System.getProperty("user.home") + "\\Selenium Results\\"; 

и он должен работать, как ожидалось.

+0

Нам, к сожалению, пришлось вернуться к предыдущему рабочему экземпляру Jenkins и т. Д., Поэтому мне придется попробовать это в будущем. Я дам вам знать, как оно идет. Спасибо. –

0

Если ваш maven правильно компилирует код и файлы .class присутствуют в целевой папке. затем

Упоминание Maven зависимостях:

<dependency> 
<groupId>io.appium</groupId> 
<artifactId>java-client</artifactId> 
<version>2.1.0</version> 
</dependency> 

И сохраните файл и повторите, что позволит решить проблему