Before the 7.0.0 release, wicket-extension used
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.8.5</version>
So no change can be done.
7.0.0, 7.1.0 and 7.2.0 use
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.4.1.3</version>
JacksonAnnotationIntrospector
/**
* @deprecated (since 2.3) Use {@link #findFilterId(Annotated)} instead
*/
@Deprecated
@Override
public Object findFilterId(AnnotatedClass ac) {
return _findFilterId(ac);
}
@Override
public Object findFilterId(Annotated a) {
return _findFilterId(a);
}
so the findFilterId(Annotated a) can be used in the JsonRequestLogger #
FilteredIntrospector
findFilterId(AnnotatedClass ac) has been removed from the 2.7 release.
The sole Wicket' class using Jackson I found is JacksonAnnotationIntrospector,
so using Jackson 2.7.1 release can be done.
Tested. ok.
François
Le 18 févr. 2016 à 09:43, Martin Grigorov <[email protected]> a écrit :
> Good!
>
> The question now is how to introduce this change without breaking old
> applications.
> Having both methods looks like a solution but it may break if the
> application uses older version of Jackson.
> I think it should work.
> Can you try it ?
>
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Thu, Feb 18, 2016 at 9:35 AM, Francois Meillet <
> [email protected]> wrote:
>
>> Hi Martin,
>>
>> Jackson JacksonAnnotationIntrospector # findFilterId() method signature
>> has been changed
>>
>> from findFilterId(AnnotatedClass ac) to findFilterId(Annotated a)
>>
>>
>> in the JsonRequestLogger, changing this
>>
>> private static final class FilteredIntrospector extends
>> JacksonAnnotationIntrospector
>> {
>> @Override
>> public Object findFilterId(AnnotatedClass ac)
>> {
>> return "default";
>> }
>> }
>>
>>
>> to that resolved the problem
>>
>> private static final class FilteredIntrospector extends
>> JacksonAnnotationIntrospector
>> {
>> @Override
>> public Object findFilterId(Annotated a)
>> {
>> return "default";
>> }
>> }
>>
>>
>> François
>>
>>
>>
>>
>>
>>
>>
>>
>> Le 18 févr. 2016 à 08:24, Martin Grigorov <[email protected]> a écrit :
>>
>>> Hi,
>>>
>>>
>>> On Wed, Feb 17, 2016 at 12:10 PM, Francois Meillet <
>>> [email protected]> wrote:
>>>
>>>> Dear Team,
>>>>
>>>> The JsonRequestLogger is not working correctly:
>>>>
>>>> JsonRequestLogger --> JsonMappingException --> StackOverflowError
>> Infinite
>>>> recursion
>>>>
>>>> Wicket : 7.2.0
>>>> Jackson : 2.7.1
>>>>
>>>> JsonRequestLogger throw a JsonMappingException when executing
>>>> getMapper().writeValueAsString(new RequestSessionTuple(rd, sd));
>>>>
>>>> java.lang.RuntimeException:
>>>> com.fasterxml.jackson.databind.JsonMappingException:
>>>> Infinite recursion (StackOverflowError)
>>>> (through reference chain:
>>>>
>> org.apache.wicket.PageReference["page"]->com.mycompany.SimplePage["pageReference"]->org.apache.wicket.PageReference["page"]->com.mycompany.SimplePage["pageReference"]->org.apache.wicket.PageReference["page"]->....
>>>>
>>>>
>>>> at
>>>>
>> org.apache.wicket.extensions.requestlogger.JsonRequestLogger.getLogString(JsonRequestLogger.java:141)
>>>> ~[wicket-extensions-7.2.0.jar:7.2.0]
>>>> at
>>>>
>> org.apache.wicket.extensions.requestlogger.JsonRequestLogger.log(JsonRequestLogger.java:125)
>>>> ~[wicket-extensions-7.2.0.jar:7.2.0]
>>>> at
>>>>
>> org.apache.wicket.protocol.http.AbstractRequestLogger.performLogging(AbstractRequestLogger.java:325)
>>>> ~[wicket-core-7.2.0.jar:7.2.0]
>>>> at
>>>>
>> org.apache.wicket.request.cycle.RequestCycle.onInternalDetach(RequestCycle.java:620)
>>>> ~[wicket-core-7.2.0.jar:7.2.0]
>>>> at
>>>>
>> org.apache.wicket.request.cycle.RequestCycle.detach(RequestCycle.java:600)
>>>> ~[wicket-core-7.2.0.jar:7.2.0]
>>>> at
>>>>
>> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:297)
>>>> ~[wicket-core-7.2.0.jar:7.2.0]
>>>> at
>>>>
>> org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:261)
>>>> ~[wicket-core-7.2.0.jar:7.2.0]
>>>> at
>>>>
>> com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:694)
>>>> ~[jackson-databind-2.7.1.jar:2.7.1]
>>>> at
>>>>
>> com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:157)
>>>> ~[jackson-databind-2.7.1.jar:2.7.1]
>>>> at
>>>>
>> com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:672)
>>>> ~[jackson-databind-2.7.1.jar:2.7.1]
>>>> at
>>>>
>> com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:678)
>>>> ~[jackson-databind-2.7.1.jar:2.7.1]
>>>> at
>>>>
>> com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:157)
>>>> ~[jackson-databind-2.7.1.jar:2.7.1]
>>>> at
>>>>
>> com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:672)
>>>> ~[jackson-databind-2.7.1.jar:2.7.1]
>>>> at
>>>>
>> com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:678)
>>>> ~[jackson-databind-2.7.1.jar:2.7.1]
>>>> at
>>>>
>> com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:157)
>>>> ~[jackson-databind-2.7.1.jar:2.7.1]
>>>> at
>>>>
>> com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:672)
>>>> ~[jackson-databind-2.7.1.jar:2.7.1]
>>>>
>>>>
>>>> https://issues.apache.org/jira/browse/WICKET-6097
>>>>
>>>
>>> I'll debug it when I have some time.
>>>
>>>
>>>>
>>>>
>>>> BTW, is it worth to mainten this logger ?
>>>>
>>>
>>> AFAIK Martijn and Emond use it in their application.
>>> But if it fails always with this then maybe they don't use it anymore. Or
>>> they use it with an older version of Jackson. I've had some problems with
>>> Jackson backward compatibility lately.
>>>
>>>
>>>>
>>>>
>>>> François
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>
>>