lewismj / cucumber

Cucumber Test Framework & Plugin for SBT (BDD Testing in Scala)
Other
41 stars 18 forks source link

sbt test gives error: java.lang.NoSuchMethodError: scala.Product.$init$(Lscala/Product;)V #44

Closed madhuranakate closed 6 years ago

madhuranakate commented 6 years ago

I've added a jar of cucumber-runner as an unmanaged dependency to my project. However, on running 'sbt test', I'm getting the following error-

java.lang.NoSuchMethodError: scala.Product.$init$(Lscala/Product;)V at com.waioeka.sbt.runner.CucumberRunner.(CucumberRunner.scala:43) at com.waioeka.sbt.runner.CucumberFramework.runner(CucumberFramework.scala:48) at com.waioeka.sbt.runner.CucumberFramework.runner(CucumberFramework.scala:30) at sbt.Defaults$$anonfun$createTestRunners$1.apply(Defaults.scala:589) at sbt.Defaults$$anonfun$createTestRunners$1.apply(Defaults.scala:583) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244) at scala.collection.immutable.Map$Map3.foreach(Map.scala:154) at scala.collection.TraversableLike$class.map(TraversableLike.scala:244) at scala.collection.AbstractTraversable.map(Traversable.scala:105) at sbt.Defaults$.createTestRunners(Defaults.scala:583) at sbt.Defaults$.allTestGroupsTask(Defaults.scala:603) at sbt.Defaults$$anonfun$testTasks$7.apply(Defaults.scala:466) at sbt.Defaults$$anonfun$testTasks$7.apply(Defaults.scala:466) at scala.Function9$$anonfun$tupled$1.apply(Function9.scala:35) at scala.Function9$$anonfun$tupled$1.apply(Function9.scala:34) at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47) at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40) at sbt.std.Transform$$anon$4.work(System.scala:63) at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228) at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228) at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17) at sbt.Execute.work(Execute.scala:237) at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228) at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228) at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159) at sbt.CompletionService$$anon$2.call(CompletionService.scala:28) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) [error] (test:executeTests) java.lang.NoSuchMethodError: scala.Product.$init$(Lscala/Product;)V

lewismj commented 6 years ago

I used to get that on older versions with Cucumber not supporting Scala 2.12, that seems resolved for me now. Are you using the latest version of the runner? Could you share your build.sbt

madhuranakate commented 6 years ago

I think you are right, I am using scala version 2.11.8. Changing that is breaking other internal dependencies for me. Thanks for your timely reply, Lewis. I will try to get my project compatible with scala 2.12 and then try running in parallel.

lewismj commented 6 years ago

Thanks for letting me know.

rashid-1989 commented 5 years ago

I am also getting the same exception with scala 2.11 and spark 2.2.2. The documentation talks about the compatibilty about the versions. However, I am still getting the exception.

lewismj commented 5 years ago

I've just published a new version, will take a bit of time to sync with Nexus. Been busy at work - but its been updated with latest Scala version and cucumber versions etc. From here, I may start to try to active develop it further.