Skip to content

Commit 033408d

Browse files
author
Yang Guo
committed
fix unable to load properties file for jar
1 parent e00b0fe commit 033408d

File tree

1 file changed

+1
-2
lines changed
  • platform-agent/src/main/java/com/flow/platform/agent

1 file changed

+1
-2
lines changed

platform-agent/src/main/java/com/flow/platform/agent/Config.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,8 @@ public static int zkTimeout() {
7878
*/
7979
public static String getProperty(String name) {
8080
String value;
81-
URL resource = Config.class.getClassLoader().getResource("application.properties");
8281
if (properties == null) {
83-
try (InputStream fileInputStream = new FileInputStream(resource.getFile())) {
82+
try (InputStream fileInputStream = Config.class.getResourceAsStream("/application.properties")) {
8483
properties = new Properties();
8584
properties.load(fileInputStream);
8685
} catch (Throwable e) {

0 commit comments

Comments
 (0)