On 10/02/2012 15:38, Erick Lichtas wrote:
> Hi everyone,
> 
> I'm using tomcat 6.0.32 on Windows 7.  I have an application where I
> programmatically start and stop a separate web application from
> within an already running tomcat application.  I do this by creating
> a new StandardService, setting the server as
> service.setServer(ServerFactory.getServer()) and creating/loading the
> connectors, engine, etc... all before calling service.start() to fire
> everything up.
> 
> Everything is working great, but I'm running into a small snag.
> Should a connector of the service run into issues such as binding to
> a port, the StandardService.start() seems to swallow the exception.
> It gets logged, but my caller to service.start() has no way handling
> that failure.
> 
> StandardService.java (~line 539) try { ((Lifecycle)
> connectors[i]).start(); } catch (Exception e) { 
> log.error(sm.getString( "standardService.connector.startFailed", 
> connectors[i]), e); }
> 
> I've also looked into registering a LifecycleListener on the
> connector, but that doesn't won't tell me whether or not the start
> had completed.

connector.isAvailable() ?

> Are there any other options, other than extending and for the most
> part duplicating the StandardService class, that might give me the
> ability to detect a failed connector startup?

Upgrade to 7.0.x where all this was completely re-written?

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to