Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] [jetty-user] Embedded Jetty: 404 after webapp.stop(); webapp.start();

Hi Jan,

> Can you upgrade to jetty-7.2.0.v20101020 ?

Just did that, but it didn't help. :-(

What I am missing is advice on how to set up a webapp such that I can start
and stop it at will without starting and stopping Jetty itself. The
following template suggests the workflow I want to achieve:

  Server jetty = new Server(8080);
  
  WebAppContext webapp = new WebAppContext();
  webapp.setContextPath("/");
  webapp.setWar("example.war");
  
  jetty.start();
  
  for (...) {
     webapp.start();

     webapp.stop();
  }
  
  jetty.stop();

Unfortunately, I cannot get the wiring right (the above template is thus
rather incomplete); I either get IllegalStateExceptions ("STARTED") or
NoClassDefFoundErrors when stopping the Jetty. Can someone please point me
in the right direction? Thanks.

Best wishes,

Andreas



Back to the top