{"action":"created","issue":{"url":"https://api.github.com/repos/FasterXML/jackson-module-scala/issues/196","labels_url":"https://api.github.com/repos/FasterXML/jackson-module-scala/issues/196/labels{/name}","comments_url":"https://api.github.com/repos/FasterXML/jackson-module-scala/issues/196/comments","events_url":"https://api.github.com/repos/FasterXML/jackson-module-scala/issues/196/events","html_url":"https://github.com/FasterXML/jackson-module-scala/issues/196","id":65507634,"number":196,"title":"Deserialization fails when migrating from 2.4 to 2.5","user":{"login":"jans23","id":1450547,"avatar_url":"https://avatars.githubusercontent.com/u/1450547?v=3","gravatar_id":"","url":"https://api.github.com/users/jans23","html_url":"https://github.com/jans23","followers_url":"https://api.github.com/users/jans23/followers","following_url":"https://api.github.com/users/jans23/following{/other_user}","gists_url":"https://api.github.com/users/jans23/gists{/gist_id}","starred_url":"https://api.github.com/users/jans23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jans23/subscriptions","organizations_url":"https://api.github.com/users/jans23/orgs","repos_url":"https://api.github.com/users/jans23/repos","events_url":"https://api.github.com/users/jans23/events{/privacy}","received_events_url":"https://api.github.com/users/jans23/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-03-31T17:45:45Z","updated_at":"2015-04-05T05:27:58Z","closed_at":null,"body":"I'm using jackson-module-scala 2.4.5 successfully with the wrapper below to serialize and deserialize various complex objects. When changing to jackson-module-scala 2.5.0 or 2.5.1 many deserializations (JSON to object) fail. For instance, the deserialization of the following simple list fails.\r\n\r\n    val myList = MyListClass(List(1,2,3,4))\r\n    val myListJson = \"{\\n  \\\"myList\\\" : [ 1, 2, 3, 4 ]\\n}\"\r\n    \r\n    // This test succeeds with Jackson 2.5\r\n    test(\"Serialize List object to JSON string\") {\r\n      assertResult(myListJson) { serialize(myList) }\r\n    }\r\n    \r\n    // This test *fails* with Jackson 2.5\r\n    test(\"Deserialize JSON string to List\") {\r\n      assertResult(myList) { deserialize[MyListClass](myListJson) }\r\n    }\r\n\r\nThe error message:\r\n\r\n    Deserialize JSON string to List *** FAILED ***\r\n    com.fasterxml.jackson.databind.JsonMappingException: Argument #0 of constructor [constructor for java.util.LinkedHashMap, annotations: [null]] has no property name annotation; must have name when multiple-parameter constructor annotated as Creator\r\n    at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:267)\r\n    at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:242)\r\n    at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:143)\r\n    at com.fasterxml.jackson.databind.DeserializationContext.findNonContextualValueDeserializer(DeserializationContext.java:429)\r\n    at com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializer._findCustomDeser(UntypedObjectDeserializer.java:125)\r\n    at com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializer.resolve(UntypedObjectDeserializer.java:105)\r\n    at com.fasterxml.jackson.module.scala.deser.UntypedObjectDeserializer.resolve(UntypedObjectDeserializerModule.scala:23)\r\n    at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:293)\r\n    at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:242)\r\n    at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:143)\r\n    ...\r\n    Cause: java.lang.IllegalArgumentException: Argument #0 of constructor [constructor for java.util.LinkedHashMap, annotations: [null]] has no property name annotation; must have name when multiple-parameter constructor annotated as Creator\r\n    at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory._addDeserializerConstructors(BasicDeserializerFactory.java:508)\r\n    at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory._constructDefaultValueInstantiator(BasicDeserializerFactory.java:325)\r\n    at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory.findValueInstantiator(BasicDeserializerFactory.java:258)\r\n    at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory.createMapDeserializer(BasicDeserializerFactory.java:1099)\r\n    at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer2(DeserializerCache.java:382)\r\n    at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(DeserializerCache.java:354)\r\n    at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:262)\r\n    at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:242)\r\n    at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:143)\r\n    at com.fasterxml.jackson.databind.DeserializationContext.findNonContextualValueDeserializer(DeserializationContext.java:429)\r\n\r\nThis is the wrapper:\r\n\r\n    import com.fasterxml.jackson.databind.{DeserializationFeature, SerializationFeature, ObjectMapper}\r\n    import com.fasterxml.jackson.module.scala.experimental.ScalaObjectMapper\r\n    import com.fasterxml.jackson.module.scala.DefaultScalaModule\r\n    import com.fasterxml.jackson.databind.module.SimpleModule\r\n    import com.fasterxml.jackson.core.Version\r\n    \r\n    /**\r\n     * Based on: https://coderwall.com/p/o--apg/easy-json-un-marshalling-in-scala-with-jackson\r\n     */\r\n    object JacksonWrapper {\r\n      private val dateFormat = new java.text.SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss'Z'\")\r\n    \r\n      val module = new SimpleModule(\"CustomJson\", Version.unknownVersion())\r\n      module.addSerializer(classOf[BigInt], new BigIntSerializer)\r\n      module.addDeserializer(classOf[BigInt], new BigIntDeserializer)\r\n    \r\n      val mapper = new ObjectMapper() with ScalaObjectMapper\r\n      mapper.registerModule(DefaultScalaModule)\r\n      mapper.setDateFormat(dateFormat)\r\n      mapper.registerModule(module)\r\n      mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)\r\n      mapper.enable(SerializationFeature.INDENT_OUTPUT); //Enable pretty printing\r\n    \r\n      def serialize(value: Map[Symbol, Any]): String = {\r\n        serialize(value map { case (k,v) => k.name -> v})\r\n      }\r\n    \r\n      def serialize(value: Any): String = {\r\n        mapper.writeValueAsString(value)\r\n      }\r\n    \r\n      def toMap[V](json:String)(implicit m: Manifest[V]) = deserialize[Map[String,V]](json)\r\n    \r\n      def deserialize[T](json: String)(implicit m : Manifest[T]): T = {\r\n        mapper.readValue[T](json)\r\n      }\r\n    }\r\n\r\nHow to migrate to Jackson 2.5 and get the deserialization working?\r\n"},"comment":{"url":"https://api.github.com/repos/FasterXML/jackson-module-scala/issues/comments/89718878","html_url":"https://github.com/FasterXML/jackson-module-scala/issues/196#issuecomment-89718878","issue_url":"https://api.github.com/repos/FasterXML/jackson-module-scala/issues/196","id":89718878,"user":{"login":"christophercurrie","id":19510,"avatar_url":"https://avatars.githubusercontent.com/u/19510?v=3","gravatar_id":"","url":"https://api.github.com/users/christophercurrie","html_url":"https://github.com/christophercurrie","followers_url":"https://api.github.com/users/christophercurrie/followers","following_url":"https://api.github.com/users/christophercurrie/following{/other_user}","gists_url":"https://api.github.com/users/christophercurrie/gists{/gist_id}","starred_url":"https://api.github.com/users/christophercurrie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christophercurrie/subscriptions","organizations_url":"https://api.github.com/users/christophercurrie/orgs","repos_url":"https://api.github.com/users/christophercurrie/repos","events_url":"https://api.github.com/users/christophercurrie/events{/privacy}","received_events_url":"https://api.github.com/users/christophercurrie/received_events","type":"User","site_admin":false},"created_at":"2015-04-05T05:27:58Z","updated_at":"2015-04-05T05:27:58Z","body":"There is now a snapshot version, 2.5.2-SNAPSHOT, published to the Sonatype OSS snapshot repository. If you are able, could you try this snapshot and see if it resolves your issue?\r\n"}}