{"action":"opened","issue":{"url":"https://api.github.com/repos/scala-ide/scala-worksheet/issues/217","labels_url":"https://api.github.com/repos/scala-ide/scala-worksheet/issues/217/labels{/name}","comments_url":"https://api.github.com/repos/scala-ide/scala-worksheet/issues/217/comments","events_url":"https://api.github.com/repos/scala-ide/scala-worksheet/issues/217/events","html_url":"https://github.com/scala-ide/scala-worksheet/issues/217","id":64916008,"number":217,"title":"Exception using jackson","user":{"login":"migel","id":3897227,"avatar_url":"https://avatars.githubusercontent.com/u/3897227?v=3","gravatar_id":"","url":"https://api.github.com/users/migel","html_url":"https://github.com/migel","followers_url":"https://api.github.com/users/migel/followers","following_url":"https://api.github.com/users/migel/following{/other_user}","gists_url":"https://api.github.com/users/migel/gists{/gist_id}","starred_url":"https://api.github.com/users/migel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/migel/subscriptions","organizations_url":"https://api.github.com/users/migel/orgs","repos_url":"https://api.github.com/users/migel/repos","events_url":"https://api.github.com/users/migel/events{/privacy}","received_events_url":"https://api.github.com/users/migel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-28T08:04:43Z","updated_at":"2015-03-28T08:04:43Z","closed_at":null,"body":"HI, I've created a scala worksheet to test object updates with Jackson (v 2.5.1). We I try to update the object (```d12``` below) I get an exception. If I test it in a standalone test app it works.\r\n\r\n```scala\r\nimport com.fasterxml.jackson.annotation.JsonProperty\r\nimport com.fasterxml.jackson.databind.ObjectMapper\r\nimport com.fasterxml.jackson.module.scala.DefaultScalaModule\r\nimport com.fasterxml.jackson.databind.SerializationFeature\r\nimport com.fasterxml.jackson.annotation.PropertyAccessor\r\nimport com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility\r\nimport com.fasterxml.jackson.databind.ObjectReader\r\n\r\nclass DataA {\r\n  @JsonProperty var vint: Int = 3\r\n}\r\n\r\nobject jackson4 {\r\n  println(\"Welcome to the Scala worksheet\")       //> Welcome to the Scala worksheet\r\n  val mapper = new ObjectMapper()                 //> mapper  : com.fasterxml.jackson.databind.ObjectMapper = com.fasterxml.jackso\r\n                                                  //| n.databind.ObjectMapper@679e96f7\r\n  mapper.registerModule(DefaultScalaModule)       //> res0: com.fasterxml.jackson.databind.ObjectMapper = com.fasterxml.jackson.da\r\n                                                  //| tabind.ObjectMapper@679e96f7\r\n  mapper.enable(SerializationFeature.INDENT_OUTPUT)\r\n                                                  //> res1: com.fasterxml.jackson.databind.ObjectMapper = com.fasterxml.jackson.da\r\n                                                  //| tabind.ObjectMapper@679e96f7\r\n  mapper.setVisibility(PropertyAccessor.ALL, Visibility.NONE)\r\n                                                  //> res2: com.fasterxml.jackson.databind.ObjectMapper = com.fasterxml.jackson.da\r\n                                                  //| tabind.ObjectMapper@679e96f7\r\n\r\n  val d10 = new DataA                             //> d10  : DataA = DataA@fb9165a\r\n  d10.vint = 5\r\n\r\n  val d10Json = mapper.writeValueAsString(d10)    //> d10Json  : String = {\r\n                                                  //|   \"vint\" : 5\r\n                                                  //| }\r\n  val d11 = mapper.readValue(d10Json, classOf[DataA])\r\n                                                  //> d11  : DataA = DataA@3c22de9e\r\n\r\n  val d11Json = mapper.writeValueAsString(d11)    //> d11Json  : String = {\r\n                                                  //|   \"vint\" : 5\r\n                                                  //| }\r\n\r\n  val d12 = new DataA                             //> d12  : DataA = DataA@154575ea\r\n  mapper.readerForUpdating[ObjectReader](d12).readValue(d10Json)\r\n                                                  //> java.lang.ClassCastException: DataA cannot be cast to scala.runtime.Nothing$\r\n                                                  //| \r\n                                                  //| \tat jackson4$$anonfun$main$1.apply$mcV$sp(jackson4.scala:29)\r\n                                                  //| \tat org.scalaide.worksheet.runtime.library.WorksheetSupport$$anonfun$$exe\r\n                                                  //| cute$1.apply$mcV$sp(WorksheetSupport.scala:76)\r\n                                                  //| \tat org.scalaide.worksheet.runtime.library.WorksheetSupport$.redirected(W\r\n                                                  //| orksheetSupport.scala:65)\r\n                                                  //| \tat org.scalaide.worksheet.runtime.library.WorksheetSupport$.$execute(Wor\r\n                                                  //| ksheetSupport.scala:75)\r\n                                                  //| \tat jackson4$.main(jackson4.scala:13)\r\n                                                  //| \tat jackson4.main(jackson4.scala)\r\n}\r\n```\r\n\r\nI've found out that it works if I change the last line to:\r\n```scala\r\nmapper.readerForUpdating[ObjectReader](d12).readValue[DataA](d10Json)\r\n```\r\n\r\nIt works in the worksheet but it is not needed in the standalone app."}}