Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[engine] Fix Jackson reflection issue #3553

Merged
merged 1 commit into from
Jan 18, 2023
Merged

Conversation

valfirst
Copy link
Collaborator

Error:

2023-01-18 16:23:11,653 [main] WARN  com.fasterxml.jackson.module.afterburner.deser.BeanPropertyMutator - Disabling Afterburner deserialization for class org.vividus.batch.BatchConfiguration (field #3; mutator com.fasterxml.jackson.module.afterburner.deser.SettableObjectMethodProperty), due to access error (type java.lang.IllegalAccessError, message=failed to access class org.vividus.batch.BatchConfiguration$StoryExecutionConfiguration from class org.vividus.batch.BatchConfiguration$Access4JacksonDeserializer01e8db89 (org.vividus.batch.BatchConfiguration$StoryExecutionConfiguration is in unnamed module of loader 'app'; org.vividus.batch.BatchConfiguration$Access4JacksonDeserializer01e8db89 is in unnamed module of loader com.fasterxml.jackson.module.afterburner.util.MyClassLoader @71789580))

 java.lang.IllegalAccessError: failed to access class org.vividus.batch.BatchConfiguration$StoryExecutionConfiguration from class org.vividus.batch.BatchConfiguration$Access4JacksonDeserializer01e8db89 (org.vividus.batch.BatchConfiguration$StoryExecutionConfiguration is in unnamed module of loader 'app'; org.vividus.batch.BatchConfiguration$Access4JacksonDeserializer01e8db89 is in unnamed module of loader com.fasterxml.jackson.module.afterburner.util.MyClassLoader @71789580)
        at org.vividus.batch.BatchConfiguration$Access4JacksonDeserializer01e8db89.objectSetter(org/vividus/batch/BatchConfiguration$Access4JacksonDeserializer.java) ~[?:?]
        at com.fasterxml.jackson.module.afterburner.deser.SettableObjectMethodProperty.deserializeAndSet(SettableObjectMethodProperty.java:59) ~[jackson-module-afterburner-2.14.1.jar:2.14.1]
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:278) ~[jackson-databind-2.14.1.jar:2.14.1]
        at com.fasterxml.jackson.module.afterburner.deser.SuperSonicBeanDeserializer.deserialize(SuperSonicBeanDeserializer.java:155) ~[jackson-module-afterburner-2.14.1.jar:2.14.1]
        at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:323) ~[jackson-databind-2.14.1.jar:2.14.1]
        at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:4706) ~[jackson-databind-2.14.1.jar:2.14.1]
        at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2879) ~[jackson-databind-2.14.1.jar:2.14.1]
        at com.fasterxml.jackson.dataformat.javaprop.JavaPropsMapper.readMapAs(JavaPropsMapper.java:179) ~[jackson-dataformat-properties-2.14.1.jar:2.14.1]
        at com.fasterxml.jackson.dataformat.javaprop.JavaPropsMapper.readMapAs(JavaPropsMapper.java:211) ~[jackson-dataformat-properties-2.14.1.jar:2.14.1]
        at org.vividus.util.property.PropertyMapper.readValues(PropertyMapper.java:134) ~[vividus-util-0.5.4-SNAPSHOT.jar:0.5.4-SNAPSHOT]
        at org.vividus.util.property.PropertyMapper.readValues(PropertyMapper.java:115) ~[vividus-util-0.5.4-SNAPSHOT.jar:0.5.4-SNAPSHOT]
        at org.vividus.batch.BatchStorage.readFromProperties(BatchStorage.java:95) ~[vividus-engine-0.5.4-SNAPSHOT.jar:0.5.4-SNAPSHOT]
        at org.vividus.batch.BatchStorage.<init>(BatchStorage.java:68) ~[vividus-engine-0.5.4-SNAPSHOT.jar:0.5.4-SNAPSHOT]
        at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?]
        at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
        at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?]
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:211) ~[spring-beans-5.3.25.jar:5.3.25]
...

Relates to FasterXML/jackson-modules-base#186

Error:
```
2023-01-18 16:23:11,653 [main] WARN  com.fasterxml.jackson.module.afterburner.deser.BeanPropertyMutator - Disabling Afterburner deserialization for class org.vividus.batch.BatchConfiguration (field #3; mutator com.fasterxml.jackson.module.afterburner.deser.SettableObjectMethodProperty), due to access error (type java.lang.IllegalAccessError, message=failed to access class org.vividus.batch.BatchConfiguration$StoryExecutionConfiguration from class org.vividus.batch.BatchConfiguration$Access4JacksonDeserializer01e8db89 (org.vividus.batch.BatchConfiguration$StoryExecutionConfiguration is in unnamed module of loader 'app'; org.vividus.batch.BatchConfiguration$Access4JacksonDeserializer01e8db89 is in unnamed module of loader com.fasterxml.jackson.module.afterburner.util.MyClassLoader @71789580))

 java.lang.IllegalAccessError: failed to access class org.vividus.batch.BatchConfiguration$StoryExecutionConfiguration from class org.vividus.batch.BatchConfiguration$Access4JacksonDeserializer01e8db89 (org.vividus.batch.BatchConfiguration$StoryExecutionConfiguration is in unnamed module of loader 'app'; org.vividus.batch.BatchConfiguration$Access4JacksonDeserializer01e8db89 is in unnamed module of loader com.fasterxml.jackson.module.afterburner.util.MyClassLoader @71789580)
        at org.vividus.batch.BatchConfiguration$Access4JacksonDeserializer01e8db89.objectSetter(org/vividus/batch/BatchConfiguration$Access4JacksonDeserializer.java) ~[?:?]
        at com.fasterxml.jackson.module.afterburner.deser.SettableObjectMethodProperty.deserializeAndSet(SettableObjectMethodProperty.java:59) ~[jackson-module-afterburner-2.14.1.jar:2.14.1]
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:278) ~[jackson-databind-2.14.1.jar:2.14.1]
        at com.fasterxml.jackson.module.afterburner.deser.SuperSonicBeanDeserializer.deserialize(SuperSonicBeanDeserializer.java:155) ~[jackson-module-afterburner-2.14.1.jar:2.14.1]
        at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:323) ~[jackson-databind-2.14.1.jar:2.14.1]
        at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:4706) ~[jackson-databind-2.14.1.jar:2.14.1]
        at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2879) ~[jackson-databind-2.14.1.jar:2.14.1]
        at com.fasterxml.jackson.dataformat.javaprop.JavaPropsMapper.readMapAs(JavaPropsMapper.java:179) ~[jackson-dataformat-properties-2.14.1.jar:2.14.1]
        at com.fasterxml.jackson.dataformat.javaprop.JavaPropsMapper.readMapAs(JavaPropsMapper.java:211) ~[jackson-dataformat-properties-2.14.1.jar:2.14.1]
        at org.vividus.util.property.PropertyMapper.readValues(PropertyMapper.java:134) ~[vividus-util-0.5.4-SNAPSHOT.jar:0.5.4-SNAPSHOT]
        at org.vividus.util.property.PropertyMapper.readValues(PropertyMapper.java:115) ~[vividus-util-0.5.4-SNAPSHOT.jar:0.5.4-SNAPSHOT]
        at org.vividus.batch.BatchStorage.readFromProperties(BatchStorage.java:95) ~[vividus-engine-0.5.4-SNAPSHOT.jar:0.5.4-SNAPSHOT]
        at org.vividus.batch.BatchStorage.<init>(BatchStorage.java:68) ~[vividus-engine-0.5.4-SNAPSHOT.jar:0.5.4-SNAPSHOT]
        at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?]
        at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
        at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?]
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:211) ~[spring-beans-5.3.25.jar:5.3.25]
...
```

Relates to FasterXML/jackson-modules-base#186
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@codecov
Copy link

codecov bot commented Jan 18, 2023

Codecov Report

Merging #3553 (241592c) into master (a2024df) will increase coverage by 7.59%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master    #3553      +/-   ##
============================================
+ Coverage     89.37%   96.96%   +7.59%     
+ Complexity     6259     6047     -212     
============================================
  Files           848      848              
  Lines         17284    17286       +2     
  Branches       1123     1123              
============================================
+ Hits          15447    16762    +1315     
+ Misses         1710      417    -1293     
+ Partials        127      107      -20     
Impacted Files Coverage Δ
...ain/java/org/vividus/batch/BatchConfiguration.java 100.00% <100.00%> (ø)
...g/vividus/configuration/ConfigurationResolver.java 98.40% <0.00%> (+3.20%) ⬆️
...idus/steps/SpringStepFactoryBeanPostProcessor.java 100.00% <0.00%> (+6.66%) ⬆️
...va/org/vividus/configuration/PropertiesLoader.java 98.41% <0.00%> (+9.52%) ⬆️
...in/java/org/vividus/configuration/BeanFactory.java 94.28% <0.00%> (+14.28%) ⬆️
...org/vividus/configuration/PropertiesDecryptor.java 100.00% <0.00%> (+16.66%) ⬆️
...c/main/java/org/vividus/log/AllureLogAppender.java 100.00% <0.00%> (+20.00%) ⬆️
.../vividus/issue/KnownIssueVariableDataProvider.java 100.00% <0.00%> (+25.00%) ⬆️
...ovy/VariableContextAwareGroovyScriptEvaluator.java 100.00% <0.00%> (+25.00%) ⬆️
.../java/org/vividus/spring/StartContextListener.java 100.00% <0.00%> (+27.27%) ⬆️
... and 59 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@valfirst valfirst merged commit 3bc6e58 into master Jan 18, 2023
@valfirst valfirst deleted the fix-jackson-reflection-issue branch January 18, 2023 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants