ebowman / api-first-hand

API-First bootstrapping tool for building RESTful web services from a Swagger/OpenAPI spec
MIT License
143 stars 22 forks source link

java.lang.NoSuchMethodError in JsonContext #33

Closed trane closed 8 years ago

trane commented 8 years ago

I successfully used the activator playground template a week ago, but now I am getting the following error: In a newly activator created playground: [error] (compile:swaggerParseSpec) java.lang.NoSuchMethodError: me.andrz.jackson.JsonContext.<init>(Ljava/io/File;I)V Which is called from https://github.com/zalando/api-first-hand/blob/master/swagger-model/src/main/scala/de/zalando/swagger/StrictParser.scala#L35

A few things I noticed:

Here is the stack trace when running sbt compile

java.lang.NoSuchMethodError: me.andrz.jackson.JsonContext.<init>(Ljava/io/File;I)V
    at de.zalando.swagger.TransientJsonContext.<init>(StrictParser.scala:35)
    at de.zalando.swagger.StrictSwaggerParser.parse(StrictParser.scala:70)
    at de.zalando.swagger.SwaggerParser$.readSwaggerModel(SwaggerParser.scala:12)
    at de.zalando.play.swagger.sbt.ApiFirstSwaggerParser$$anonfun$swaggerParserSettings$4$$anonfun$apply$1.apply(ApiFirstSwaggerParser.scala:55)
    at de.zalando.play.swagger.sbt.ApiFirstSwaggerParser$$anonfun$swaggerParserSettings$4$$anonfun$apply$1.apply(ApiFirstSwaggerParser.scala:55)
    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.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
    at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
    at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
    at scala.collection.AbstractTraversable.map(Traversable.scala:105)
    at de.zalando.play.swagger.sbt.ApiFirstSwaggerParser$$anonfun$swaggerParserSettings$4.apply(ApiFirstSwaggerParser.scala:55)
    at de.zalando.play.swagger.sbt.ApiFirstSwaggerParser$$anonfun$swaggerParserSettings$4.apply(ApiFirstSwaggerParser.scala:55)
    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:226)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
    at sbt.Execute.work(Execute.scala:235)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    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:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
slavaschmidt commented 8 years ago

@trane hey, thank you very much for the bug report. We are currently redesigning the whole generated code for play content-negotiation and parsing, I'll take a look at this issue as a part of it

zackangelo commented 8 years ago

Also experiencing this issue.

eyasuyuki commented 8 years ago

I pushed this fix.

https://github.com/zalando/api-first-hand/pull/34

slavaschmidt commented 8 years ago

@eyasuyuki cool, thank you

shuhei commented 8 years ago

@slavaschmidt Would mind releasing the fix?

@eyasuyuki Thanks for the fix!

slavaschmidt commented 8 years ago

@shuhei sure, I need some short time to prepare other changes, the next version follows really soon. Sorry for letting you wait

G-Foote commented 8 years ago

Hi, I'm just getting started with Play and Swagger. I've generated a project using activator new and the api-first-hand template, and get the NoSuchMethod error when I run it. Has this fix been released yet ? If so, how can I get hold of the new template ?

Many thanks.

slavaschmidt commented 8 years ago

@Jack-Welch hey, sorry for the inconvenience. The fix has been released and I will update the activator template today.

shuhei commented 8 years ago

@slavaschmidt Thanks for releasing it!

slavaschmidt commented 8 years ago

@shuhei you're welcome, sorry it took so long

slavaschmidt commented 8 years ago

@Jack-Welch just published an updated template

Actually, you could just change the plugin version in project/plugins.sbt from 0.1.16 to 0.1.18 if you like

OptEnergy commented 8 years ago

@slavaschmidt Many thanks - project now up and running.