-
Notifications
You must be signed in to change notification settings - Fork 91
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
Getting "info.archinnov.achilles.exception.AchillesTranscodingException: com.fasterxml.jackson.databind.JsonMappingException" while reading the JSON from Cassandra DB #356
Comments
I'm not sure it's an issue related to Achilles. Try to:
If the same error occurs, it means that it's a JSON encoding issue, not related to Achilles |
@doanduyhai & Query: The seconds suggestion is already implemented in Achilles code 'info.archinnov.achilles.internals.codec.JSONCodec' class. |
Did you try this mapping: @column
private Map <String, Address>; Did Achilles successfully decode the |
Yes, I've used this too, it works. But the tables having such UDT are read rarely so I didn't face such issue there. In the absence of such Cassandra problems, this works without any issues. I wanted to see if there is any other issues. Thanks @doanduyhai |
"This issue only happens when there are Cassandra Connection issues - either required no. of replicas are not available or there is network connection problem from the application node to Cassandra." --> I think the real problem comes from Cassandra and not Achilles ... |
The Entity annotated with @table has some json columns like:
@column
private Map <String, @JSON Address>;
An Exception is thrown while reading such table having JSON type columns. I verified that the JSON is valid and also the write operation was executed successfully.
Following is the sample code, using Achilles core lib version 5.3.1, which throws the above exception:
UserEntity userEntity = userEntityManager.dsl().select().allColumns_FromBaseTable().where().userId().Eq(userId).getOne();
Exception:
com.fasterxml.jackson.databind.JsonMappingException: No content to map due to end-of-input
at [Source: ; line: 1, column: 0]
at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:270)
at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:3854)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3799)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2896)
at info.archinnov.achilles.internals.codec.JSONCodec.decode(JSONCodec.java:80)
... 49 common frames omitted
Wrapped by: info.archinnov.achilles.exception.AchillesTranscodingException: com.fasterxml.jackson.databind.JsonMappingException: No content to map due to end-of-input
at [Source: ; line: 1, column: 0]
at info.archinnov.achilles.internals.codec.JSONCodec.decode(JSONCodec.java:82)
at info.archinnov.achilles.internals.codec.JSONCodec.decode(JSONCodec.java:32)
at info.archinnov.achilles.internals.metamodel.SimpleProperty.decodeFromRawInternal(SimpleProperty.java:121)
at info.archinnov.achilles.internals.metamodel.AbstractProperty.decodeFromRaw(AbstractProperty.java:144)
at info.archinnov.achilles.internals.metamodel.MapProperty.lambda$decodeFromRawInternal$630(MapProperty.java:212)
I found that, this exception used to happen when there is a connection problem with Cassandra node like min. required replicas are not available (I'm using read and write consistency: LOCAL_QUORUM).
I referred similar problem: https://stackoverflow.com/questions/26925058/no-content-to-map-due-to-end-of-input-jackson-parser
Is there any other issue apart from the connection issue?
The text was updated successfully, but these errors were encountered: