← 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

 

--- Cannot instantiate class com.bme.test.SikuliExampleTest

Such errors usually are created, when imports do not work or some static
stuff cannot be processed.

So take care, that your class path in the TeamCity context has the
sikulixapi jar and all dependencies.

** Description changed:

  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>
+      <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>
+    <dependency>
+         <groupId>com.sikulix</groupId>
+         <artifactId>sikulixapi</artifactId>
+         <version>2.0.4</version>
+     </dependency>

-- 
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)
  ...

  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