Skip to content

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

@kuhnroyal

Description

@kuhnroyal

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions