[
https://issues.apache.org/jira/browse/KNOX-3043?focusedWorklogId=923669&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-923669
]
ASF GitHub Bot logged work on KNOX-3043:
----------------------------------------
Author: ASF GitHub Bot
Created on: 17/Jun/24 11:18
Start Date: 17/Jun/24 11:18
Worklog Time Spent: 10m
Work Description: senthh commented on code in PR #917:
URL: https://github.com/apache/knox/pull/917#discussion_r1642649948
##########
gateway-server/src/main/java/org/apache/knox/gateway/util/KnoxCLI.java:
##########
@@ -2570,10 +2570,16 @@ public String getUsage() {
private static Properties loadBuildProperties() {
Properties properties = new Properties();
- try(InputStream inputStream =
KnoxCLI.class.getClassLoader().getResourceAsStream( "build.properties" )) {
- properties.load(inputStream);
+ String BUILD_PROPERTY = "build.properties";
+ PrintStream out = System.out;
Review Comment:
@moresandeep Even I tried to reuse 'out' defined in line 142, but as
loadBuildProperties is a static method, it is not allowing to use "public
PrintStream out = System.out;" from line 142.
Issue Time Tracking
-------------------
Worklog Id: (was: 923669)
Time Spent: 50m (was: 40m)
> NullpointerException in calling loadBuildProperties
> ---------------------------------------------------
>
> Key: KNOX-3043
> URL: https://issues.apache.org/jira/browse/KNOX-3043
> Project: Apache Knox
> Issue Type: Bug
> Affects Versions: 2.0.0, 1.6.1
> Reporter: Senthil Kumar
> Priority: Major
> Time Spent: 50m
> Remaining Estimate: 0h
>
> Getting NullPointerException while calling loadBuildProperties in both
> GatewayServer and KnoxCLI
> SEVERE: Failed to start gateway: java.lang.NullPointerException
> java.lang.NullPointerException
> at java.util.Properties$LineReader.readLine(Properties.java:434)
> at java.util.Properties.load0(Properties.java:353)
> at java.util.Properties.load(Properties.java:341)
> at
> org.apache.knox.gateway.GatewayServer.loadBuildProperties(GatewayServer.java:306)
> at org.apache.knox.gateway.GatewayServer.main(GatewayServer.java:160)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at
> org.apache.knox.gateway.launcher.Invoker.invokeMainMethod(Invoker.java:68)
> at org.apache.knox.gateway.launcher.Invoker.invoke(Invoker.java:39)
> at org.apache.knox.gateway.launcher.Command.run(Command.java:99)
> at org.apache.knox.gateway.launcher.Launcher.run(Launcher.java:75)
> at org.apache.knox.gateway.launcher.Launcher.main(Launcher.java:52)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)