-
Notifications
You must be signed in to change notification settings - Fork 60
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
Possibly broken config: Json-io config refers to its own classes by fully qualified name in config files, but java-cfenv shades it, renaming its classes. #275
Comments
Hello @jangroothuijse |
Here are the logs I had
|
Here are the four text files (in resources/config) to "transform" during shading
|
anthonydahanne
added a commit
that referenced
this issue
Oct 29, 2024
* upgrade to latest Gradle Shadow plugin * add new transformer that replaces the original package name in text files in the json-io config folder (aliases.txt, classFactory.txt, coercedTypes.txt, customWriters.txt) with the shaded one
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In java-cfenv
Here json-io is shaded:
https://github.com/pivotal-cf/java-cfenv/blob/main/java-cfenv-all/build.gradle#L39
In json-io
Here json-io refers to itself:
https://github.com/jdereg/json-io/blob/master/src/main/resources/config/classFactory.txt#L73
The reference
com.cedarsoftware.io.factory.CollectionFactory
is now wrong, it shouldio.pivotal.cfenv.shaded.com.cedarsoftware.io.factory.CollectionFactory
.This generates this console output while deploying the app (while the jar it is starting up):
Which is produced here:
https://github.com/jdereg/json-io/blob/47fe31aa3996fff6963fcf7ce65dcf2eb46dbb09/src/main/java/com/cedarsoftware/io/ReadOptionsBuilder.java#L722
Which is triggered by a static initializer:
https://github.com/jdereg/json-io/blob/47fe31aa3996fff6963fcf7ce65dcf2eb46dbb09/src/main/java/com/cedarsoftware/io/ReadOptionsBuilder.java#L77
In our app, the console output was the only unexpected behavior. However, to me it seems more could be broken here.
Possible fixes:
The text was updated successfully, but these errors were encountered: