'sdkProperties' has private access in 'com.twitter.clientlib.SDKConfig' .
One line summary of the issue here.
Expected behavior
As concisely as possible, describe the expected behavior.
Actual behavior
As concisely as possible, describe the observed behavior.
Steps to reproduce the behavior
Please list all relevant steps to reproduce the observed behavior.
I'd like to add that the issue is that the location of sdkProperties cannot be changed. I cannot deploy a WAR file and have FileInputStream find it.
To lookup any resource in a WAR / Wildfly environment, you have to use:
InputStream in = this.getClass().getResourceAsStream("/sdk.properties");
But you cannot change this as it is currently hardcoded in the constructor.
What results is a long list of error logs that get generated every time the server starts up.
When running a Java application in a containerized environment, accessing external files or resources might require a different approach compared to running the application locally. In your case, the code is attempting to load a file named "sdk.properties" using a FileInputStream, but it's unable to find the file within the container.
Here are a few possible solutions:
Use ClassLoader: Load the file using the ClassLoader instead of a direct file path. This way, you can access resources from the classpath, and it's container-friendly.
InputStream inputStream = getClass().getClassLoader().getResourceAsStream("sdk.properties");
sdkProperties.load(inputStream);
Provide Absolute Path: If you are sure about the location of the file within the container, provide the absolute path to the file.
String absolutePath = "/path/to/your/sdk.properties";
sdkProperties.load(new FileInputStream(absolutePath));
Use System Property: Pass the file path as a system property when starting the WildFly server. You can then retrieve the system property in your code.
In your startup script or command line:
-Dsdk.properties.file=/path/to/your/sdk.properties
In your Java code:
String filePath = System.getProperty("sdk.properties.file");
sdkProperties.load(new FileInputStream(filePath));
Make sure to adjust the file path accordingly.
Choose the approach that best fits your application's structure and deployment environment. If the configuration file is part of your application, packaging it within the WAR file might also be a good solution.