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

Use a FileHandler when loading properties #5233

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

ddanielr
Copy link
Contributor

@ddanielr ddanielr commented Jan 7, 2025

Fixes error when using include or includeOptional property directives in accumulo.properties

Caused by: org.apache.commons.configuration2.ex.ConfigurationException: Load operation not properly initialized! Do not call read(InputStream) directly, but use a FileHandler to load a configuration.
	at org.apache.commons.configuration2.PropertiesConfiguration.loadIncludeFile(PropertiesConfiguration.java:1395)
	at org.apache.commons.configuration2.PropertiesConfiguration.propertyLoaded(PropertiesConfiguration.java:1479)
	at org.apache.commons.configuration2.PropertiesConfigurationLayout.load(PropertiesConfigurationLayout.java:444)
	at org.apache.commons.configuration2.PropertiesConfiguration.read(PropertiesConfiguration.java:1500)
	at org.apache.accumulo.start.classloader.AccumuloClassLoader.getAccumuloProperty(AccumuloClassLoader.java:94)

Discovered when testing #5231, fixes #5234

Fixes error when using include or includeOptional property directives in
accumulo.properties
@ddanielr ddanielr added this to the 2.1.4 milestone Jan 7, 2025
@ddanielr ddanielr linked an issue Jan 7, 2025 that may be closed by this pull request
Copy link
Contributor

@keith-turner keith-turner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was a nice error message that pointed directly to FileHandler. Wonder if FileHandler should be used for the client properties.

@keith-turner
Copy link
Contributor

The code for loading client props seems to use java Properties and not commons config, so FileHandler would not be applicable there.

public static Properties toProperties(Path propertiesFile) {

@ddanielr ddanielr merged commit 3d0bea9 into apache:2.1 Jan 8, 2025
8 checks passed
@ddanielr ddanielr deleted the bugfix/include-other-prop-files branch January 8, 2025 01:18
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.

include and includeOptional cause failures in AccumuloClassLoader
2 participants