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();

Andreas,

If you have already started jetty (jetty.start()) then you shouldn't
go through and explicitly start all the webapps that you have added,
as that will happen automatically, so you may be getting the "STARTED"
message from trying to start the webapps twice.

You should be fine to stop the webapps at any time.

Jan

On 28/10/10 01:12, Andreas Sewe wrote:

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


--
Jan Bartel, Webtide LLC | janb@xxxxxxxxxxx | http://www.webtide.com


Back to the top