Skip to content

Conversation

@akaGelo
Copy link
Contributor

@akaGelo akaGelo commented Mar 13, 2017

The call of the method optionalLiveReloadServer() is realised in the method LocalDevToolsAutoConfiguration.onClassPathChanged(ClassPathChangedEvent) which implies the address to Bean, which is not really so. Every time a new instance of OptionalLiveReloadServer is created.

OptionalLiveReloadServer uses @PostConstruct annotation for the starting of LiveReloadServer while this method is not executed during the direct call. This brings to not executed this.server = null OptionalLiveReloadServer:64 as well.

This breaches the logic of realization of the method OptionalLiveReloadServer.triggerReload() which delegates the call to a not started server.

P.S. Should I attach the youtube links with the demonstration of the problem in the debugger?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 13, 2017
@wilkinsona
Copy link
Member

Thanks for the PR. I think this could be fixed more easily by adding the missing @Configuration to LiveReloadConfiguration. Its absence is why calling optionalLiveReloadServer() creates a new instance every time. @Configuration will ensure that the class is proxied such that only a single instance of the optional live reload server is created.

@akaGelo
Copy link
Contributor Author

akaGelo commented Mar 14, 2017

I've made some changes according to the recommendation

@snicoll snicoll added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 2, 2017
@snicoll snicoll added this to the 1.5.4 milestone Jun 2, 2017
@snicoll snicoll self-assigned this Jun 2, 2017
@snicoll snicoll added type: bug A general bug and removed type: enhancement A general enhancement labels Jun 2, 2017
snicoll added a commit that referenced this pull request Jun 2, 2017
* pr/8595:
  Fix OptionalLiveReloadServer create bean
@snicoll snicoll closed this in ff3b6b0 Jun 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants