Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EmbeddedServletContainer.start() causes errors if called multiple times #8036

Closed
kuhnroyal opened this issue Jan 19, 2017 · 1 comment
Closed
Labels
type: bug A general bug
Milestone

Comments

@kuhnroyal
Copy link

As stated in the docs this should not create errors, specifically port binding errors with undertow but looking at the code it will most likely fail with other containers as well.

Calling this method on an already started container has no effect.

public interface EmbeddedServletContainer {

	/**
	 * Starts the embedded servlet container. Calling this method on an already started
	 * container has no effect.
	 * @throws EmbeddedServletContainerException if the container cannot be started
	 */
	void start() throws EmbeddedServletContainerException;

       ...
}

I am trying to start the embedded container very early by manually calling start() but the EmbeddedWebApplicationContext will always call start() again and the application fails to start.
Implementations of EmbeddedServletContainer should safe guard from this behavior.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 19, 2017
@philwebb philwebb added priority: normal type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 25, 2017
@philwebb philwebb added this to the 1.4.4 milestone Jan 25, 2017
@kuhnroyal
Copy link
Author

@philwebb Thanks!

philwebb pushed a commit that referenced this issue Mar 2, 2017
Update `EmbeddedServletContainer` implementations to ensure that stop
can be called even if start has not. This allows servers that are
partially started during `initialize()` to still be shut down.

This commit fixes a regression caused by commit 0af53b3.

See gh-8036
Fixes gh-8224
Closes gh-8227
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

No branches or pull requests

3 participants