Skip to content
This repository has been archived by the owner on Apr 10, 2019. It is now read-only.

Incompatible Jackson version: 2.7.1 #121

Open
luos opened this issue Apr 24, 2016 · 2 comments
Open

Incompatible Jackson version: 2.7.1 #121

luos opened this issue Apr 24, 2016 · 2 comments

Comments

@luos
Copy link

luos commented Apr 24, 2016

Hi!

I am trying to use this lib to generate but I get this exception, I use play 2.5.

My definition file is one of the example plus produces : application\json line added because without that it did not even work at all by saying that The server doesn't support any of the requested mime types.

Any idea what should I do to make this work? Tried including the same jackson versions as in this repo but the error is the same.

Thanks,
@luos

apiv1.yaml

swagger: '2.0'
info:
  version: 1.0.0
  title: Echo
  description: |
    Echoes back every URL, method, parameter and header
    Feel free to make a path or an operation and use _Try Operation_ to test it. The echo server will
    render back everything.
schemes:
  - http
host: localhost:9000
basePath: /apiv1
produces:
  - application/json
paths:
  /:
    get:
      responses:
        200:
          description: Echo GET
          schema:
            type: string

    post:
      responses:
        200:
          description: Echo POST
          schema:
            type: object
            properties:
              name:
                type: string
              year:
                type: string
      parameters:
        - name: name
          in: query
          description: name
          type: string
        - name: year
          in: query
          description: year
          type: string
  /test-path/{id}:
    get:
      parameters:
        - name: id
          in: path
          description: ID
          type: string
          required: true
      responses:
        200:
          description: Echo test-path
          schema:
            type: string

Full exception:

play.api.http.HttpErrorHandlerExceptions$$anon$1: Execution exception[[JsonMappingException: Incompatible Jackson version: 2.7.1]]
    at play.api.http.HttpErrorHandlerExceptions$.throwableToUsefulException(HttpErrorHandler.scala:269)
    at play.api.http.DefaultHttpErrorHandler.onServerError(HttpErrorHandler.scala:195)
    at play.core.server.netty.PlayRequestHandler$$anonfun$2$$anonfun$apply$1.applyOrElse(PlayRequestHandler.scala:99)
    at play.core.server.netty.PlayRequestHandler$$anonfun$2$$anonfun$apply$1.applyOrElse(PlayRequestHandler.scala:98)
    at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:346)
    at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:345)
    at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
    at play.api.libs.iteratee.Execution$trampoline$.execute(Execution.scala:70)
    at scala.concurrent.impl.CallbackRunnable.executeWithValue(Promise.scala:40)
    at scala.concurrent.impl.Promise$DefaultPromise.tryComplete(Promise.scala:248)
Caused by: com.fasterxml.jackson.databind.JsonMappingException: Incompatible Jackson version: 2.7.1
    at com.fasterxml.jackson.module.scala.JacksonModule$class.setupModule(JacksonModule.scala:64)
    at com.fasterxml.jackson.module.scala.DefaultScalaModule.setupModule(DefaultScalaModule.scala:19)
    at com.fasterxml.jackson.databind.ObjectMapper.registerModule(ObjectMapper.java:722)
    at de.zalando.play.controllers.PlayBodyParsing$.jacksonMapper(PlayBodyParsing.scala:50)
    at de.zalando.play.controllers.PlayBodyParsing$$anonfun$anyToWritable$1.apply(PlayBodyParsing.scala:115)
    at de.zalando.play.controllers.PlayBodyParsing$$anonfun$anyToWritable$1.apply(PlayBodyParsing.scala:114)
    at apiv1.yaml.Apiv1YamlBase$$anonfun$1$$anonfun$apply$4.apply(apiv1.yaml.scala:45)
    at apiv1.yaml.Apiv1YamlBase$$anonfun$1$$anonfun$apply$4.apply(apiv1.yaml.scala:45)
    at scala.Option.map(Option.scala:146)
    at apiv1.yaml.Apiv1YamlBase$$anonfun$1.apply(apiv1.yaml.scala:45)
@slavaschmidt
Copy link
Contributor

@luos Thanks for the bug report! Currently, the plugin is only tested with play 2.4
I'm pretty sure play 2.5 uses different versions of it's dependencies, including Jackson.

Could you please try the plugin with play 2.4 ?

@servatj
Copy link

servatj commented Jun 4, 2017

Hi if it helps... I changed to 2.4 and it works!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants