mulesoft-consulting / json-logger

Drop-in replacement for default Mule Logger that outputs a JSON structure based on a predefined JSON schema
MIT License
68 stars 212 forks source link

JSON Logger incompatible with Mule.Maven.Plugin.Version 3.6.3 #38

Open kdipippo opened 2 years ago

kdipippo commented 2 years ago

Anypoint Studio released a recent update as 7.13. After updating my workspace - which also prompts for mule.maven.plugin.version to be upgraded to 3.6.3 - I am consistently encountering the below error when running projects that contain the JSON Logger component (we have 2.0.1 in our Exchange):

[ERROR] Failed to execute goal org.mule.tools.maven:mule-maven-plugin:3.6.3:process-classes (default-process-classes) on project eee-sapi-engineering-issue: Execution default-process-classes of goal org.mule.tools.maven:mule-maven-plugin:3.6.3:process-classes failed: org.mule.tooling.api.ToolingException: org.mule.runtime.extension.api.exception.IllegalModelDefinitionException: Extension 'JSON Logger' has definition errors:
[ERROR] ERRORS:
[ERROR]     * Operation 'logger' requires a configuration of type 'org.mule.extension.jsonlogger.internal.JsonloggerConfiguration'. However, the operation is reachable from configuration 'config' of incompatible type 'org.mule.extension.jsonlogger.internal.JsonloggerConfiguration$$EnhancerByCGLIB$$1a2eda8c'.
[ERROR]     * Operation 'logger' requires a configuration of type 'org.mule.extension.jsonlogger.internal.JsonloggerConfiguration'. However, the operation is reachable from configuration 'config' of incompatible type 'org.mule.extension.jsonlogger.internal.JsonloggerConfiguration$$EnhancerByCGLIB$$1a2eda8c'.
[ERROR] 

My best guess is there's some form of incompatibility with the new version and the parameters of this line. I am unsure of what this error implies is missing or causing the issue.

https://github.com/mulesoft-consulting/json-logger/blob/116a2271cdc653bba7f8f6f3968f967f993b3c78/json-logger/src/main/java/org/mule/extension/jsonlogger/internal/JsonloggerOperations.java#L80

EDIT: after additional testing, we concluded it's not an issue with the Anypoint Studio instance but instead the mule.maven.plugin upgrade that accompanies the update. This library works fine with 3.5.4 of the plugin.

kimbert commented 2 years ago

Same here - we are staying on Maven plugin v3.5.4 for now to avoid these issues.