Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
3.11.0
-
None
-
Unknown
Description
When using try-with-resources with MainConfigurationProperties, MainConfigurationProperties::close might be invoked twice leading to NullPointerException on shutdown:
... Caused by: java.lang.NullPointerException at all//org.apache.camel.main.MainConfigurationProperties.close(MainConfigurationProperties.java:88) at all//io.github.zregvart.dbzcamel.dbtodb.App.main(App.java:26) ... 4 more
I.e. the Camel's shutdown will invoke MainConfigurationProperties::close, but also the try-with-resources bit if used like:
try (MainConfigurationProperties configure = main.configure()) { configure.addRoutesBuilder(Route.class); main.run(args); } catch (final Exception e) { throw new RuntimeException(e); }