[jboss-jira] [JBoss JIRA] (WFLY-10616) ContextResolver doesn't work
George Trudeau (JIRA)
issues at jboss.org
Thu Jun 28 11:13:01 EDT 2018
[ https://issues.jboss.org/browse/WFLY-10616?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13598453#comment-13598453 ]
George Trudeau edited comment on WFLY-10616 at 6/28/18 11:12 AM:
-----------------------------------------------------------------
Ok I found the culprit, the issue appears when enabling {{ee8.preview.mode}}
>From a fresh install I set the following value using jboss-cli.sh : {{/system-property=ee8.preview.mode:add(value=true)}}
{noformat}
~ > curl -X GET http://localhost:8080/test
{"date":"1970-01-01T00:00:00Z[UTC]"}
{noformat}
was (Author: george.trudeau):
Ok I found the culprit, the issue appears when enabling {{ee8.preview.mode}}
>From a fresh install I set the following value using jboss-cli.sh : {{/system-property=ee8.preview.mode:add(value=true)}}
> ContextResolver doesn't work
> ----------------------------
>
> Key: WFLY-10616
> URL: https://issues.jboss.org/browse/WFLY-10616
> Project: WildFly
> Issue Type: Bug
> Components: REST
> Affects Versions: 13.0.0.Final
> Reporter: George Trudeau
> Assignee: R Searls
> Fix For: 14.0.0.CR1
>
> Attachments: test.war
>
>
> I have a simple ContextResolver to set Date serialization format for my JAX-RS service, it works on 12.0.0.Final but it doesn't anymore on 13.0.0.Final :
> {code:java}
> @Provider
> public class DateResolver implements ContextResolver<ObjectMapper>
> {
> private final ObjectMapper mapper;
> public DateResolver()
> {
> mapper = new ObjectMapper();
> mapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"));
> mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
> }
> @Override
> public ObjectMapper getContext(Class<?> type) { return mapper; }
> }
> {code}
> The {{getContext}} method isn't called on 13.0.0.Final.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
More information about the jboss-jira
mailing list