Jackson : Custom JSON deserializers stopped working
up vote
-1
down vote
favorite
We use Jackson for JSON deserialization. For the purpose of the functionality I wrote custom booean and integer deserializes. The application was deployed on JBoss. Now we are migrating to Tomcat, and I am using different versions of the jar files, and the deserializers are no more called. Can anyone give a hint where I could take a look why this happens?
This is how I implement one of the deserializers:
public class CustomLongDeserializer extends JsonDeserializer {
final protected Class<?> valueClass = Long.class;
@Override
public Long deserialize(JsonParser jp, DeserializationContext ctxt) throws InvalidValueException {
return parseLongPrimitive(jp);
}
}
and this is how I register them in the jacksonconfig class:
public JacksonConfig() {
this.objectMapper = new ObjectMapper();
SimpleModule module = new SimpleModule("CustomDeserializers");
module.addDeserializer(Boolean.class, new CustomBooleanDeserializer());
module.addDeserializer(Long.class, new CustomLongDeserializer());
this.objectMapper.registerModule(module);
}
json jboss jackson
add a comment |
up vote
-1
down vote
favorite
We use Jackson for JSON deserialization. For the purpose of the functionality I wrote custom booean and integer deserializes. The application was deployed on JBoss. Now we are migrating to Tomcat, and I am using different versions of the jar files, and the deserializers are no more called. Can anyone give a hint where I could take a look why this happens?
This is how I implement one of the deserializers:
public class CustomLongDeserializer extends JsonDeserializer {
final protected Class<?> valueClass = Long.class;
@Override
public Long deserialize(JsonParser jp, DeserializationContext ctxt) throws InvalidValueException {
return parseLongPrimitive(jp);
}
}
and this is how I register them in the jacksonconfig class:
public JacksonConfig() {
this.objectMapper = new ObjectMapper();
SimpleModule module = new SimpleModule("CustomDeserializers");
module.addDeserializer(Boolean.class, new CustomBooleanDeserializer());
module.addDeserializer(Long.class, new CustomLongDeserializer());
this.objectMapper.registerModule(module);
}
json jboss jackson
You need to post the code
– user7294900
Nov 19 at 8:40
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
We use Jackson for JSON deserialization. For the purpose of the functionality I wrote custom booean and integer deserializes. The application was deployed on JBoss. Now we are migrating to Tomcat, and I am using different versions of the jar files, and the deserializers are no more called. Can anyone give a hint where I could take a look why this happens?
This is how I implement one of the deserializers:
public class CustomLongDeserializer extends JsonDeserializer {
final protected Class<?> valueClass = Long.class;
@Override
public Long deserialize(JsonParser jp, DeserializationContext ctxt) throws InvalidValueException {
return parseLongPrimitive(jp);
}
}
and this is how I register them in the jacksonconfig class:
public JacksonConfig() {
this.objectMapper = new ObjectMapper();
SimpleModule module = new SimpleModule("CustomDeserializers");
module.addDeserializer(Boolean.class, new CustomBooleanDeserializer());
module.addDeserializer(Long.class, new CustomLongDeserializer());
this.objectMapper.registerModule(module);
}
json jboss jackson
We use Jackson for JSON deserialization. For the purpose of the functionality I wrote custom booean and integer deserializes. The application was deployed on JBoss. Now we are migrating to Tomcat, and I am using different versions of the jar files, and the deserializers are no more called. Can anyone give a hint where I could take a look why this happens?
This is how I implement one of the deserializers:
public class CustomLongDeserializer extends JsonDeserializer {
final protected Class<?> valueClass = Long.class;
@Override
public Long deserialize(JsonParser jp, DeserializationContext ctxt) throws InvalidValueException {
return parseLongPrimitive(jp);
}
}
and this is how I register them in the jacksonconfig class:
public JacksonConfig() {
this.objectMapper = new ObjectMapper();
SimpleModule module = new SimpleModule("CustomDeserializers");
module.addDeserializer(Boolean.class, new CustomBooleanDeserializer());
module.addDeserializer(Long.class, new CustomLongDeserializer());
this.objectMapper.registerModule(module);
}
json jboss jackson
json jboss jackson
edited Nov 19 at 12:42
asked Nov 19 at 8:38
Ivajlo Iliev
265
265
You need to post the code
– user7294900
Nov 19 at 8:40
add a comment |
You need to post the code
– user7294900
Nov 19 at 8:40
You need to post the code
– user7294900
Nov 19 at 8:40
You need to post the code
– user7294900
Nov 19 at 8:40
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53370950%2fjackson-custom-json-deserializers-stopped-working%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You need to post the code
– user7294900
Nov 19 at 8:40