googleapis / google-cloud-java

Google Cloud Client Library for Java
https://cloud.google.com/java/docs/reference
Apache License 2.0
1.9k stars 1.07k forks source link

NPE printed out when loading client properties #1909

Closed pongad closed 7 years ago

pongad commented 7 years ago

Running tests, I get these stack traces:

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 com.google.api.gax.core.PropertiesProvider.loadProperty(PropertiesProvider.java:69)
        at com.google.cloud.errorreporting.spi.v1beta1.ReportErrorsServiceSettings.getGapicVersion(ReportErrorsServiceSettings.java:124)
        at com.google.cloud.errorreporting.spi.v1beta1.ReportErrorsServiceSettings.defaultChannelProviderBuilder(ReportErrorsServiceSettings.java:117)
        at com.google.cloud.errorreporting.spi.v1beta1.ReportErrorsServiceSettings$Builder.<init>(ReportErrorsServiceSettings.java:193)
        at com.google.cloud.errorreporting.spi.v1beta1.ReportErrorsServiceSettings$Builder.createDefault(ReportErrorsServiceSettings.java:203)
        at com.google.cloud.errorreporting.spi.v1beta1.ReportErrorsServiceSettings$Builder.access$000(ReportErrorsServiceSettings.java:153)
        at com.google.cloud.errorreporting.spi.v1beta1.ReportErrorsServiceSettings.defaultBuilder(ReportErrorsServiceSettings.java:133)
        at com.google.cloud.errorreporting.spi.v1beta1.ReportErrorsServiceClientTest.setUp(ReportErrorsServiceClientTest.java:68)

Somehow, tests are still passing. I'm assinging @shinfan to this since I think Shin was working on property loading a few weeks ago. Could you help diagnose?

shinfan commented 7 years ago

Oh this is actually expected... the properties file maybe missing for some tests. I think I can modify the code to just ignore these exceptions (currently the stacktrace is printed))

garrettjonesgoogle commented 7 years ago

Removed the release-blocking label.

garrettjonesgoogle commented 7 years ago

Technically this isn't closed because there isn't a gax release pulled into google-cloud-java with the fix.

pongad commented 7 years ago

Thank you @shinfan for the explanation, so it's not blowing things up, just looks scary :)

garrettjonesgoogle commented 7 years ago

A newer gax has now been pulled in which includes the fix.