[jboss-jira] [JBoss JIRA] (WFLY-10616) ContextResolver doesn't work
R Searls (JIRA)
issues at jboss.org
Thu Jun 28 09:58:00 EDT 2018
[ https://issues.jboss.org/browse/WFLY-10616?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13598382#comment-13598382 ]
R Searls edited comment on WFLY-10616 at 6/28/18 9:57 AM:
----------------------------------------------------------
I have tested test.war on wfly-12.0.0.Final and wlfy-13.0.0.Final but have not been able to reproduce the problem. In both cases I used curl to call the service like this,
{code:java}
curl -X GET http://localhost:8080/test
{code}
It returned this value,
{code:java}
{"date":"1969-12-31"}
{code}
My execution env was this,
{code:java}
1083 > mvn --version
Java HotSpot(TM) 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T11:41:47-05:00)
Maven home: /home/rsearls/d5/apache-maven-3.3.9
Java version: 10, vendor: Oracle Corporation
Java home: /home/rsearls/d5/jdk-10+46/jdk-10
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.11.12-100.fc24.x86_64", arch: "amd64", family: "unix"
{code}
was (Author: rsearls):
I have tested test.war on wfly-12.0.0.Final and wlfy-13.0.0.Final but have not been able to reproduce the problem. In both cases I used curl to call the service like this,
{code:java}
curl -X GET http://localhost:8080/test
{code}
It returned this value,
{code:java}
{"date":"1969-12-31"}
{code}
My execution env was this,
{code:java}
1083 > mvn --version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T11:41:47-05:00)
Maven home: /home/rsearls/d5/apache-maven-3.3.9
Java version: 1.8.0_171, vendor: IBM Corporation
Java home: /home/rsearls/d5/ibm-java-8.0-5.16/ibm-java-i386-80/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.11.12-100.fc24.x86_64", arch: "x86", family: "unix"
{code}
> 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