Throughout modules in my project I am using core library written in Java. One of the modules has been written in Scala (Scalatra framework).
At some point I need use core library's class: net.example.MyClass, and serialize it to String. In modules written in Java, this works just fine, but in Scala I'm encountering following exception:
org.json4s.package$MappingException: Can't find ScalaSig for class net.example.MyClass
at org.json4s.reflect.ScalaSigReader$.findClass(ScalaSigReader.scala:42) ~[json4s-core_2.11-3.2.10.jar:3.2.10]
at org.json4s.reflect.ScalaSigReader$.org$json4s$reflect$ScalaSigReader$$read$1(ScalaSigReader.scala:36) ~[json4s-core_2.11-3.2.10.jar:3.2.10]
...
net.exmample.MyClass is created using Builder pattern, annotation used: @JsonDeserialize(builder = MyClass.Builder.class).
I imagine this might do something with reflection or the @JsonDeserialize annotation not being processed. Has anybody encountered similar error, is there solution for this, or the documentation I could check? Any help would be appreciated.
Thanx!
Using:
- Java 8
- Scala 2.11.0
- Scalatra 2.3.0
- json4s-jackson 3.2.10 for serialization to String