← Back to team overview

sikuli-driver team mailing list archive

[Bug 1962734] Re: [2.0.4] Java API: Screen class: maven surefire plugin exception running the test from TeamCity

 

If the Screen class makes problems, then there must be messages or
exceptions. Make sure they are visible.

--- When I remove just the Screen class ...
Removing the class means, that no SikuliX features are run, that might crash.

Most probably in your TeamCity environment there is no accessible real screen or at least a fake screen, that is accepted as non-headless.
SikuliX needs access to a real screen.
If the Screen class is initialised in a screenless environment, an exception is thrown and no features work.

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to SikuliX.
https://bugs.launchpad.net/bugs/1962734

Title:
  [2.0.4] Java API: Screen class: maven surefire plugin exception
  running the test from TeamCity

Status in SikuliX:
  Incomplete

Bug description:
  When I run a test with Sikuli Screen class on a local machine or from
  a local machine into a remote server, the test runs without error, but
  when I run the same test from CI (TeamCity), I get this error:

  Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M5:test (default-test) on project myProject: There are test failures.
  [ERROR]
  [ERROR] Please refer to /root/work/myProject/target/surefire-reports for the individual test results.
  [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
  [ERROR] There was an error in the forked process
  [ERROR]
  [ERROR] Cannot instantiate class com.bme.test.SikuliExampleTest
  [ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
  [ERROR]
  [ERROR] Cannot instantiate class com.bme.test.SikuliExampleTest
  [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:733)
  [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:305)
  [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:265)
  [ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1314)
  [ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1159)
  [ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:932)
  [ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPlu[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
  [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156)
  [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148)
  [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
  [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
  [ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
  [ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
  [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
  [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
  [ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
  [ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:957)
  [ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:289)
  [ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:193)
  [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  [ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  [ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
  [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:282)
  [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:225)
  [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:406)
  [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:347)

  Other tests run from TeamCity also work without errors.
  POM:
  <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-surefire-plugin</artifactId>
       <version>3.0.0-M5</version>
   </plugin>

     <dependency>
          <groupId>com.sikulix</groupId>
          <artifactId>sikulixapi</artifactId>
          <version>2.0.4</version>
      </dependency>

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1962734/+subscriptions



References