Announcement Announcement Module
Collapse
No announcement yet.
Spring 3's RestTemplate can't find Jackson Mapping class in dm Server 2.0.0.RC1 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring 3's RestTemplate can't find Jackson Mapping class in dm Server 2.0.0.RC1

    I'm trying to use RestTemplate.getForObject in my bundle, but I'm getting the following exception:

    Code:
    Caused by: java.lang.NoClassDefFoundError: org/codehaus/jackson/map/type/TypeFactory
    	at org.springframework.http.converter.json.MappingJacksonHttpMessageConverter.canRead(MappingJacksonHttpMessageConverter.java:91)
    	at org.springframework.web.client.RestTemplate$AcceptHeaderRequestCallback.doWithRequest(RestTemplate.java:416)
    	at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:342)
    	at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:307)
    	at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:177)
    My manifest has
    Import-Bundle: com.springsource.org.codehaus.jackson;version="[1.0.0,1.0.0]",
    com.springsource.org.codehaus.jackson.mapper;versi on="[1.0.0,1.0.0]"

    but it looks like org/codehaus/jackson/map/type isn't being exported from com.springsource.org.codehaus.jackson.mapper

    I'm also getting errors if I don't include the jackson bundles or I include the jaxb bundle.

  • #2
    If org.codehaus.jackson.map.type is not exported, then presumably org.codehaus.jackson.map.type.TypeFactory is not present in the bundle.

    Try cracking open the bundle and see what classes are inside. If the class is present but its package is not exported, that's an issue with the way the bundle manifest was built. If the class is not present, then perhaps you need to look elsewhere.

    Comment


    • #3
      The class is present; I'll try modifying the bundle's manifest and add the package export to see if that fixes it.

      Comment


      • #4
        Adding the export package for "org.codehaus.jackson.map.type" worked.

        Comment


        • #5
          Good, but I'm puzzled that this package was not exported by the original manifest. I wonder if there's something about this class that would stop bundlor picking up the package. Anyway please would you raise an issue against the Enterprise Bundle Repository if you would like this fixed and then someone can investigate further.

          Comment

          Working...
          X