You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The reason will be displayed to describe this comment to others. Learn more.
This causes an erroneous log message in dev mode:
ERROR play - Restart: Need to restart Play because \application.conf has been changed
because when detectChange() is first executed the value of long configLastModified has not been properly initialized yet. It's value is 0. So the ConfigurationChangeWatcherPlugin will think a change has occurred to the application.conf when it it fact has not occurred. The value of configLastModified only gets initialized later when onConfigurationRead() is called.
The reason will be displayed to describe this comment to others. Learn more.
Here is a snippet from my log file showing the order in which these methods were called:
17:51:19,355 INFO play:308 - detectChange()
java.lang.Throwable
at play.ConfigurationChangeWatcherPlugin.detectChange(ConfigurationChangeWatcherPlugin.java:24)
at play.plugins.PluginCollection.detectChange(PluginCollection.java:598)
at play.Play.detectChanges(Play.java:641)
at play.Invoker$Invocation.init(Invoker.java:199)
at play.server.PlayHandler$NettyInvocation.init(PlayHandler.java:264)
at play.Invoker$Invocation.run(Invoker.java:285)
17:51:19,474 INFO play:308 - onConfigurationRead()
java.lang.Throwable
at play.ConfigurationChangeWatcherPlugin.onConfigurationRead(ConfigurationChangeWatcherPlugin.java:14)
at play.plugins.PluginCollection.onConfigurationRead(PluginCollection.java:610)
at play.Play.readConfiguration(Play.java:356)
at play.Play.start(Play.java:489)
at play.Play.detectChanges(Play.java:659)
at play.Invoker$Invocation.init(Invoker.java:199)
at play.server.PlayHandler$NettyInvocation.init(PlayHandler.java:264)
at play.Invoker$Invocation.run(Invoker.java:285)
at play.server.PlayHandler$NettyInvocation.run(PlayHandler.java:303)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
1a0f924
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This causes an erroneous log message in dev mode:
ERROR play - Restart: Need to restart Play because \application.conf has been changed
because when detectChange() is first executed the value of long configLastModified has not been properly initialized yet. It's value is 0. So the ConfigurationChangeWatcherPlugin will think a change has occurred to the application.conf when it it fact has not occurred. The value of configLastModified only gets initialized later when onConfigurationRead() is called.
1a0f924
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is a snippet from my log file showing the order in which these methods were called:
17:51:19,355 INFO play:308 - detectChange()
java.lang.Throwable
at play.ConfigurationChangeWatcherPlugin.detectChange(ConfigurationChangeWatcherPlugin.java:24)
at play.plugins.PluginCollection.detectChange(PluginCollection.java:598)
at play.Play.detectChanges(Play.java:641)
at play.Invoker$Invocation.init(Invoker.java:199)
at play.server.PlayHandler$NettyInvocation.init(PlayHandler.java:264)
at play.Invoker$Invocation.run(Invoker.java:285)
17:51:19,474 INFO play:308 - onConfigurationRead()
java.lang.Throwable
at play.ConfigurationChangeWatcherPlugin.onConfigurationRead(ConfigurationChangeWatcherPlugin.java:14)
at play.plugins.PluginCollection.onConfigurationRead(PluginCollection.java:610)
at play.Play.readConfiguration(Play.java:356)
at play.Play.start(Play.java:489)
at play.Play.detectChanges(Play.java:659)
at play.Invoker$Invocation.init(Invoker.java:199)
at play.server.PlayHandler$NettyInvocation.init(PlayHandler.java:264)
at play.Invoker$Invocation.run(Invoker.java:285)
at play.server.PlayHandler$NettyInvocation.run(PlayHandler.java:303)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
1a0f924
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created an issue for this #1008. Thanks