Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Parsing fails for Maps that contain unmarshalled keys #44

Open
aryairani opened this issue Feb 4, 2012 · 2 comments
Open

Parsing fails for Maps that contain unmarshalled keys #44

aryairani opened this issue Feb 4, 2012 · 2 comments

Comments

@aryairani
Copy link
Contributor

The following code snippets works just fine:

import java.net.URL
parse[Map[String,URL]](generate(Map(new URL("http://foo.com") -> new URL("http://foo.com"))))
//res: Map[String,java.net.URL] = Map(http://foo.com -> http://foo.com)

But the following:

import java.net.URL
parse[Map[URL,URL]](generate(Map(new URL("http://foo.com") -> new URL("http://foo.com"))))

throws

org.codehaus.jackson.map.JsonMappingException: Can not construct instance of scala.collection.immutable.Map, problem: abstract types can only be instantiated with additional type information
 at [Source: java.io.StringReader@1a47da2e; line: 1, column: 1]
    at org.codehaus.jackson.map.JsonMappingException.from(JsonMappingException.java:163)
    at     org.codehaus.jackson.map.deser.StdDeserializationContext.instantiationException(StdDeserializationContext.java:233)
    at org.codehaus.jackson.map.deser.AbstractDeserializer.deserialize(AbstractDeserializer.java:60)
    at org.codehaus.jackson.map.ObjectMapper._readValue(ObjectMapper.java:2704)
    at org.codehaus.jackson.map.ObjectMapper.readValue(ObjectMapper.java:1315)
    at com.codahale.jerkson.Parser$class.parse(Parser.scala:83)
    ... 35 more

and I can't figure out how to proceed...

P.S. Thanks for a basically awesome library!

@ghost
Copy link

ghost commented Apr 1, 2012

+1

@aryairani
Copy link
Contributor Author

Sweet, someone read my ticket :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant