question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

serialization of scala.collection.immutable.ListMap fails in 2.9.x

See original GitHub issue

This might be related to #2080, not 100% sure. I’m trying to upgrade from 2.8.3 to 2.9.6, and I’m getting a new exception in some of our tests,

Failed to specialize base type 
scala.collection.immutable.ListMap<com.twitter....LengthBucket,java.lang.Object> as 
scala.collection.immutable.ListMap$Node, problem: Type parameter #1/2 differs; 
can not specialize com.twitter...LengthBucket with java.lang.Object

I think there’s a bug in the way that the ListMap serializer is implemented in jackson-module-scala, but it used to work, and #2080 pointed out that TypeHandlers shouldn’t need to know about these details, so I hope this can be fixed in jackson-databind. In the mean time, any idea how we can work around this issue?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mosesncommented, Sep 2, 2018

For what it’s worth, the MapperFeature.USE_STATIC_TYPING workaround works for this too.

0reactions
dejanlokar1commented, Aug 14, 2019

@cowtowncoder thank you! I opened a new issue #2422.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scala Standard Library 2.12.9 - scala.collection.immutable.Nil
object Nil extends List[Nothing] with Product with Serializable. The empty list. Annotations: @SerialVersionUID(); Source: List.scala; Since.
Read more >
Map can not be serializable in scala? - Stack Overflow
It's well known scala bug: ... mapValues(_.size) val b= a.map(x => x._2) res = res ::: List(cur) ... mapPartitions(myfunc).collect }.
Read more >
Why can I serialize scala.collection.immutable.List ?
<console>:8: error: Cannot prove that List[_] <:< java.io.Serializable. ... I'm wondering why the base type wasn't declared Serializable, but ...
Read more >
scala.collection.immutable.Range - javadoc.io
sealed class Range extends AbstractSeq[Int] with IndexedSeq[Int] with Serializable. The Range class represents integer values in range [start;end) with ...
Read more >
How to sort a Scala Map by key or value (sortBy, sortWith)
ListMap import scala.collection.immutable. ... scala> ListMap(x) <console>:16: error: type mismatch; found : Seq[(String, Int)] required: (? ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found