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

HTTP Server Autostart with JavaConfig fails with IllegalStateException: STARTED #179

Closed
karnis opened this Issue Dec 15, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@karnis
Copy link
Contributor

karnis commented Dec 15, 2016

Enabling http server autostart when using javaconfig fails in 2.6.2:

@Configuration
public class HttpServerTestConfig  {  
  @Bean
  public HttpServer httpServer() {
    return CitrusEndpoints.http().server().autoStart(true).port(10001).build();
  }
}
@ContextConfiguration(classes = { HttpServerTestConfig.class })
public class HttpServerTest extends JUnit4CitrusTestRunner {

  @CitrusEndpoint(name = "httpServer")
  HttpServer httpServer;

  @Test
  @CitrusTest
  public void sendGetStatusRequest(@CitrusResource TestContext context) {
    echo("hello world");
  }
}
Caused by: java.lang.IllegalStateException: STARTED
	at org.eclipse.jetty.server.handler.HandlerWrapper.setServer(HandlerWrapper.java:110)
	at org.eclipse.jetty.server.handler.HandlerWrapper.setHandler(HandlerWrapper.java:84)
	at org.eclipse.jetty.servlet.ServletContextHandler.relinkHandlers(ServletContextHandler.java:201)
	at org.eclipse.jetty.servlet.ServletContextHandler.setServletHandler(ServletContextHandler.java:507)
	at com.consol.citrus.http.server.HttpServer.startup(HttpServer.java:169)
	at com.consol.citrus.server.AbstractServer.start(AbstractServer.java:90)
	at com.consol.citrus.server.AbstractServer.afterPropertiesSet(AbstractServer.java:162)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)

@christophd christophd added this to the v2.7 milestone Dec 16, 2016

@christophd

This comment has been minimized.

Copy link
Member

christophd commented Dec 16, 2016

Thanks for reporting. This issue has already been fixed with #177 and is included in 2.6.3-SNAPSHOT and 2.7-SNAPSHOT

@christophd christophd closed this Dec 20, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
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.