Results 1 to 5 of 5

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

  1. #1

    Default 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. #2
    Join Date
    Oct 2008
    Location
    Winchester, UK
    Posts
    535

    Default

    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.
    Glyn Normington
    SpringSource

  3. #3

    Default

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

  4. #4

    Default

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

  5. #5
    Join Date
    Oct 2008
    Location
    Winchester, UK
    Posts
    535

    Default

    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.
    Glyn Normington
    SpringSource

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •