1

Hi I am making some GwtTestCase tests. I want to use Jackson ObjectMapper in the test, however I am getting following error

[ERROR] Line 48: No source code is available for type org.codehaus.jackson.map.ObjectMapper; did you forget to inherit a required module?

I know that I need to inherit module for Jackson, however I don't know how to achieve it. Do I need to create module for Jackson? How?

MrProper
  • 1,500
  • 5
  • 19
  • 25
  • Remember that GWT is ultimately compiled into Javascript so there are some limitations on what you can use, check https://developers.google.com/web-toolkit/doc/latest/DevGuideCodingBasicsCompatibility for more info. One of the requirements for a library to be GWT friendly is that its JARs must contain the source code along with the compiled classes as GWT compiler needs to deal with source code, which is not the case for Jackson. Also, Jackson uses the reflexion API which is also not supported on GWT. – Chepech Jul 02 '13 at 16:58

2 Answers2

1

You cannot use Jackson like this.

Take a look to this post : Json <-> Java serialization that works with GWT

Community
  • 1
  • 1
Jean-Michel Garcia
  • 2,359
  • 2
  • 23
  • 44
0

There exists a GWT JSON serializer that is compatible with Jackson 2 annotations: https://github.com/nmorel/gwt-jackson

DeejUK
  • 12,891
  • 19
  • 89
  • 169