question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NoSuchMethodError thrown with Scala 2.12

See original GitHub issue

Summary

When running cucumber tests with cucumber-scala (1.2.5) using Scala 2.12.1 or 2.12.0 a noSuchMethodError is raised on startup

Here is a minimal project that reproduces the behaviour: https://github.com/randomcoder/cucumber-scala-2-12

Expected Behavior

The test cases should run

Current Behavior

The error below is thrown before any tests are executed

Exception in thread "main" java.lang.NoSuchMethodError: cucumber.api.scala.ScalaDsl.$init$(Lcucumber/api/scala/ScalaDsl;)V
	at steps.SimpleScenarioSteps.<init>(SimpleScenarioSteps.scala:6)
	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 cucumber.runtime.scala.ScalaBackend$$anonfun$6.apply(ScalaBackend.scala:62)
	at cucumber.runtime.scala.ScalaBackend$$anonfun$6.apply(ScalaBackend.scala:62)
	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:234)
	at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
	at scala.collection.TraversableLike.map$(TraversableLike.scala:234)
	at scala.collection.AbstractTraversable.map(Traversable.scala:104)
	at cucumber.runtime.scala.ScalaBackend.loadGlue(ScalaBackend.scala:62)
	at cucumber.runtime.Runtime.<init>(Runtime.java:92)
	at cucumber.runtime.Runtime.<init>(Runtime.java:70)
	at cucumber.runtime.Runtime.<init>(Runtime.java:66)
	at cucumber.api.cli.Main.run(Main.java:35)
	at cucumber.api.cli.Main.main(Main.java:18)

Steps to Reproduce (for bugs)

  1. In the sample project execute sbt "run --dry-run --glue steps classpath:feature"

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:6
  • Comments:34 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
jecklgamiscommented, Jul 25, 2017

thanks @mpkorstanje! , looks good with oracle java 8 + scala 2.12.2 + cucucumber-scala 2.0.0-SNAPSHOT https://github.com/jecklgamis/cucumber-jvm-scala-example

2reactions
mpkorstanjecommented, Jul 9, 2017

Propagation delays aside it should be available right now.

Do note the changed groupId

<repository>
    <id>sonatype-snapshots</id>
    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    <snapshots>
        <enabled>true</enabled>
    </snapshots>
</repository>

<dependency>
    <groupId>io.cucumber</groupId>
    <artifactId>cucumber-java</artifactId>
    <version>2.0.0-SNAPSHOT</version>
    <scope>test</scope>
</dependency>
Read more comments on GitHub >

github_iconTop Results From Across the Web

java.lang.NoSuchMethodError: scala.Predef$.refArrayOps
This specific error happens when you use Scala 2.11 JAR files in Scala 2.12 projects. Scalatest is cross compiled with Scala 2.11 and...
Read more >
java.lang.NoSuchMethodError in databricks
During run time, it throws me an error java.lang.NoSuchMethodError. The method exists in the package but still, I am getting this error.
Read more >
Exception in thread "main" java.lang.NoSuchMethodError
The following error is encountered when migrating from Scala - 2.11, Akka - 2.5.14 To Scala - 2.12.10, Akka - 2.5.32 Exception in...
Read more >
Search - appsloveworld
NoSuchMethodError : scala.Predef$.refArrayOps([Ljava/lang/Object ... Switch to Spark 2.4.0 or replace your libraries with scala 2.12 versions.
Read more >
Trying to run ScalaTest compiled with 2.13.0-RC3 causes java ...
The following exception will be thrown. Exception in thread "ScalaTest-dispatcher" java.lang.NoSuchMethodError: scala.collection.JavaConverters.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found