Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: method setObjectMapper in class StdObjectMapperFactory cannot be applied to given types; #160

Open
jakubikan opened this issue Feb 18, 2014 · 1 comment

Comments

@jakubikan
Copy link

Hi Helun,
I got an issue where I'd like to set the ObjectMapper to disable "Fail on unkown properties"

well: like this

HttpClient h = new CBLiteHttpClient(server);

dbInstance = new StdCouchDbInstance(h);

StdObjectMapperFactory o = new StdObjectMapperFactory();
ObjectMapper m = new ObjectMapper();
m.disable(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES);
o.setObjectMapper(m);

// create a local database
couchDbConnector = new StdCouchDbConnector(DATABASE_NAME, dbInstance, o);

Somhow the setObjectMapper funktion exspects a org.codehaus.jackson.map.ObjectMapper on the StdObjectMapperFactory, but the Ektorp ObjectMapperFactory uses the com.fasterxml.jackson.map.ObjectMapper.
So it cannot be casted to than.

Here the error message:

error: method setObjectMapper in class StdObjectMapperFactory cannot be applied to given types;
required: com.fasterxml.jackson.databind.ObjectMapper
found: org.codehaus.jackson.map.ObjectMapper
reason: actual argument org.codehaus.jackson.map.ObjectMapper cannot be converted to com.fasterxml.jackson.databind.ObjectMapper by method invocation conversion

Greetz
Jack10

@helun
Copy link
Owner

helun commented Feb 21, 2014

You probably have an Jackson version clash. org.codehaus.jackson.map.ObjectMapper is the package name for Jackson < 2.0 and com.fasterxml.jackson.databind.ObjectMapper is Jackson 2.0 and above.

If you must you the older Jackson release, you will have to use Ektorp 1.2.2

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

No branches or pull requests

2 participants