Re: [jackson-user] NoSuchMethodError: com.fasterxml.jackson.core.JsonParser.getReadCapabilities()

2023-06-07 Thread Ted Yu
One way we're trying now is to upgrade jackson-core and jackson-databind 
from 2.9.8 to 2.13.3 across the board (without upgrading projects which 
depend on jackson-core and jackson-databind).

Tatu: do you anticipate any issue at runtime ?

Thanks

On Wednesday, June 7, 2023 at 4:25:20 AM UTC-7 Joo Hyuk Kim (김주혁) wrote:

> This definitely sounds like transitive dependency issue 沈.
>
> What I can suggest (sadly not a solution) is do some searching around 
> maven how to specify dep. version, override, etc..
> On Wednesday, June 7, 2023 at 4:16:48 AM UTC+9 Tatu Saloranta wrote:
>
>> On Tue, Jun 6, 2023 at 12:04 PM Ted Yu  wrote: 
>> > 
>> > Thanks for taking a look. 
>> > 
>> > The jar is produced with `maven-shade-plugin`. Do you have suggestion 
>> on how I can trace down the origin of 2.6.7 databind in such scenario ? 
>>
>> Something in Maven (etc) build would have dependency. But I am not 
>> sure 2.6.7 of databind should be problematic. 
>> `JacksonFeatureSet` was added in 2.12.0 of `jackson-core` so version 
>> of databind would need to be 2.12 or later (to expect it). 
>> So something is providing `2.6.x` of `jackson-core`; possibly shaded 
>> into some other artifact... so it could definitely come from 
>> non-jackson jar. :-( 
>> I don't know how to figure out where ClassLoader gets particular 
>> classes; chances are it's necessary to see what various jars included 
>> in classpath contain. 
>>
>> -+ Tatu +- 
>>
>> > 
>> > Cheers 
>> > 
>> > On Tuesday, June 6, 2023 at 11:55:07 AM UTC-7 Tatu Saloranta wrote: 
>> >> 
>> >> Version 2.6 is not supported (and hasn't for a while), so I am not 
>> >> sure how much we can help here with specific details. 
>> >> 
>> >> But exception message does suggest a version discrepancy: not between 
>> >> 2.6.7.1 and 2.6.7 (those are compatible being patch/micro-path within 
>> >> same minor release), but by something having later version 
>> >> (jackson-databind from looks) and requiring matching-or-later 
>> >> `jackson-core`. 
>> >> So you do not have a consistent set of Jackson components. 
>> >> 
>> >> -+ Tatu +- 
>> >> 
>> >> On Tue, Jun 6, 2023 at 11:52 AM Ted Yu  wrote: 
>> >> > 
>> >> > Hi, 
>> >> > We encounter the error shown at the end. 
>> >> > 
>> >> > Looking at 
>> META-INF/maven/com.fasterxml.jackson.core/jackson-databind/pom.xml in the 
>> fat jar: 
>> >> > 
>> >> > com.fasterxml.jackson.core 
>> >> > jackson-databind 
>> >> > 2.6.7.1 
>> >> > jackson-databind 
>> >> > 
>> >> > But I don't see 2.6.7 in any pom.xml in our repository. 
>> >> > I checked dependency:tree output as well. 
>> >> > 
>> >> > I wonder if someone has hint on how to find where the 2.6.7 
>> dependency came in. 
>> >> > 
>> >> > Thanks 
>> >> > 
>> >> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
>> >> > at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>>  
>>
>> >> > at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>  
>>
>> >> > at java.lang.reflect.Method.invoke(Method.java:498) 
>> >> > at 
>> org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:355)
>>  
>>
>> >> > ... 13 more 
>> >> > Caused by: java.util.concurrent.ExecutionException: 
>> java.lang.NoSuchMethodError: 
>> com.fasterxml.jackson.core.JsonParser.getReadCapabilities()Lcom\/fasterxml\/jackson\/core\/util\/JacksonFeatureSet;
>>  
>>
>> >> > at 
>> java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357) 
>>
>> >> > at 
>> java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1908) 
>> >> > ... 
>> >> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
>> >> > at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>>  
>>
>> >> > at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>  
>>
>> >> > at java.lang.reflect.Method.invoke(Method.java:498) 
>> >> > at 
>> org.springframework.context.event.ApplicationListenerMethodAdapter.doInvoke(ApplicationListenerMethodAdapter.java:344)
>>  
>>
>> >> > ... 31 more 
>> >> > Caused by: java.lang.NoSuchMethodError: 
>> com.fasterxml.jackson.core.JsonParser.getReadCapabilities()Lcom\/fasterxml\/jackson\/core\/util\/JacksonFeatureSet;
>>  
>>
>> >> > at 
>> com.fasterxml.jackson.databind.DeserializationContext.(DeserializationContext.java:211)
>>  
>>
>> >> > at 
>> com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.(DefaultDeserializationContext.java:50)
>>  
>>
>> >> > at 
>> com.fasterxml.jackson.databind.deser.DefaultDeserializationContext$Impl.(DefaultDeserializationContext.java:391)
>>  
>>
>> >> > at 
>> com.fasterxml.jackson.databind.deser.DefaultDeserializationContext$Impl.createInstance(DefaultDeserializationContext.java:413)
>>  
>>
>> >> > at 
>> com.fasterxml.jackson.databind.ObjectMapper.createDeserializationContext(ObjectMapper.java:4656)
>>  
>>
>> >> > at 
>> 

Re: [jackson-user] NoSuchMethodError: com.fasterxml.jackson.core.JsonParser.getReadCapabilities()

2023-06-07 Thread 김주혁
This definitely sounds like transitive dependency issue 沈.

What I can suggest (sadly not a solution) is do some searching around maven 
how to specify dep. version, override, etc..
On Wednesday, June 7, 2023 at 4:16:48 AM UTC+9 Tatu Saloranta wrote:

> On Tue, Jun 6, 2023 at 12:04 PM Ted Yu  wrote:
> >
> > Thanks for taking a look.
> >
> > The jar is produced with `maven-shade-plugin`. Do you have suggestion on 
> how I can trace down the origin of 2.6.7 databind in such scenario ?
>
> Something in Maven (etc) build would have dependency. But I am not
> sure 2.6.7 of databind should be problematic.
> `JacksonFeatureSet` was added in 2.12.0 of `jackson-core` so version
> of databind would need to be 2.12 or later (to expect it).
> So something is providing `2.6.x` of `jackson-core`; possibly shaded
> into some other artifact... so it could definitely come from
> non-jackson jar. :-(
> I don't know how to figure out where ClassLoader gets particular
> classes; chances are it's necessary to see what various jars included
> in classpath contain.
>
> -+ Tatu +-
>
> >
> > Cheers
> >
> > On Tuesday, June 6, 2023 at 11:55:07 AM UTC-7 Tatu Saloranta wrote:
> >>
> >> Version 2.6 is not supported (and hasn't for a while), so I am not
> >> sure how much we can help here with specific details.
> >>
> >> But exception message does suggest a version discrepancy: not between
> >> 2.6.7.1 and 2.6.7 (those are compatible being patch/micro-path within
> >> same minor release), but by something having later version
> >> (jackson-databind from looks) and requiring matching-or-later
> >> `jackson-core`.
> >> So you do not have a consistent set of Jackson components.
> >>
> >> -+ Tatu +-
> >>
> >> On Tue, Jun 6, 2023 at 11:52 AM Ted Yu  wrote:
> >> >
> >> > Hi,
> >> > We encounter the error shown at the end.
> >> >
> >> > Looking at 
> META-INF/maven/com.fasterxml.jackson.core/jackson-databind/pom.xml in the 
> fat jar:
> >> >
> >> > com.fasterxml.jackson.core
> >> > jackson-databind
> >> > 2.6.7.1
> >> > jackson-databind
> >> >
> >> > But I don't see 2.6.7 in any pom.xml in our repository.
> >> > I checked dependency:tree output as well.
> >> >
> >> > I wonder if someone has hint on how to find where the 2.6.7 
> dependency came in.
> >> >
> >> > Thanks
> >> >
> >> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >> > at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> >> > at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >> > at java.lang.reflect.Method.invoke(Method.java:498)
> >> > at 
> org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:355)
> >> > ... 13 more
> >> > Caused by: java.util.concurrent.ExecutionException: 
> java.lang.NoSuchMethodError: 
> com.fasterxml.jackson.core.JsonParser.getReadCapabilities()Lcom\/fasterxml\/jackson\/core\/util\/JacksonFeatureSet;
> >> > at 
> java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
> >> > at 
> java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1908)
> >> > ...
> >> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >> > at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> >> > at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >> > at java.lang.reflect.Method.invoke(Method.java:498)
> >> > at 
> org.springframework.context.event.ApplicationListenerMethodAdapter.doInvoke(ApplicationListenerMethodAdapter.java:344)
> >> > ... 31 more
> >> > Caused by: java.lang.NoSuchMethodError: 
> com.fasterxml.jackson.core.JsonParser.getReadCapabilities()Lcom\/fasterxml\/jackson\/core\/util\/JacksonFeatureSet;
> >> > at 
> com.fasterxml.jackson.databind.DeserializationContext.(DeserializationContext.java:211)
> >> > at 
> com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.(DefaultDeserializationContext.java:50)
> >> > at 
> com.fasterxml.jackson.databind.deser.DefaultDeserializationContext$Impl.(DefaultDeserializationContext.java:391)
> >> > at 
> com.fasterxml.jackson.databind.deser.DefaultDeserializationContext$Impl.createInstance(DefaultDeserializationContext.java:413)
> >> > at 
> com.fasterxml.jackson.databind.ObjectMapper.createDeserializationContext(ObjectMapper.java:4656)
> >> > at 
> com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4585)
> >> > at 
> com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3548)
> >> > at 
> com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3531)
> >> > ...
> >> > at 
> org.hibernate.metamodel.model.convert.internal.JpaAttributeConverterImpl.toDomainValue(JpaAttributeConverterImpl.java:45)
> >> > at 
> org.hibernate.type.descriptor.converter.AttributeConverterSqlTypeDescriptorAdapter$2.doConversion(AttributeConverterSqlTypeDescriptorAdapter.java:140)
> >> > at 
>