rabbitmq / rabbitmq-java-client

RabbitMQ Java client
https://www.rabbitmq.com/java-client.html
Other
1.24k stars 574 forks source link

RabbitMQ client v5.1.0 get version property file exception #336

Closed guidomedina closed 6 years ago

guidomedina commented 6 years ago

Hi,

We have a webapp that connects to an external RabbitMQ and our client was at v5.0.0, once I updated to v5.1.0 I'm starting to get the following exception:

2017-12-19 09:22:23,436 WARN  impl.ClientVersion - Couldn't get version from property file
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.rabbitmq.client.impl.ClientVersion.getVersionFromPropertyFile(ClientVersion.java:53)
    at com.rabbitmq.client.impl.ClientVersion.<clinit>(ClientVersion.java:36)
    at com.rabbitmq.client.impl.AMQConnection.defaultClientProperties(AMQConnection.java:75)
    at com.rabbitmq.client.ConnectionFactory.<init>(ConnectionFactory.java:103)

I'm not sure if this has to do with the Tomcat class loader and the way the new client is reading such property file from inside the jar?

I can confirm this is only happening when running the webapp inside IntelliJ with an exploded webapp. I'm running it using Java 8u152 and Tomcat 8.5.24, this doesn't happen when Tomcat is running outside IntelliJ.

michaelklishin commented 6 years ago

See https://github.com/rabbitmq/rabbitmq-java-client/commit/434fc4c21b56481794a304e8509f02637dc2cb83.

michaelklishin commented 6 years ago

Duplicate of #335.

guidomedina commented 6 years ago

Thanks, my bad, someone beat my timing :D