org.eclipse.jetty.webapp.WebAppContext.getUnavailableException()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(89)

本文整理了Java中org.eclipse.jetty.webapp.WebAppContext.getUnavailableException()方法的一些代码示例,展示了WebAppContext.getUnavailableException()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebAppContext.getUnavailableException()方法的具体详情如下:
包路径:org.eclipse.jetty.webapp.WebAppContext
类名称:WebAppContext
方法名:getUnavailableException

WebAppContext.getUnavailableException介绍

[英]Get an exception that caused the webapp to be unavailable
[中]获取导致webapp不可用的异常

代码示例

代码示例来源:origin: gocd/gocd

@Override
public Throwable getUnavailableException() {
  return webAppContext.getUnavailableException();
}

代码示例来源:origin: gocd/gocd

@Override
public boolean hasStarted() {
  return !webAppContext.isFailed() && webAppContext.getUnavailableException() == null;
}

代码示例来源:origin: apache/hbase

Throwable unavailableException = webAppContext.getUnavailableException();
if (unavailableException != null) {

代码示例来源:origin: org.apache.hadoop/hadoop-common

Throwable unavailableException = webAppContext.getUnavailableException();
if (unavailableException != null) {

代码示例来源:origin: apache/nifi

final Throwable t = webAppContext.getUnavailableException();
if (t != null) {
  logger.error("Unable to start context due to " + t.getMessage(), t);

代码示例来源:origin: apache/nifi

if (context.getUnavailableException() != null) {
  startUpFailure(context.getUnavailableException());

代码示例来源:origin: stackoverflow.com

protected static void contextStartupFailed(WebAppContext pContext) throws Exception {
Throwable failedException = pContext.getUnavailableException();
if (failedException != null) {
  throw new RuntimeException("Error starting WebContext of Jetty.", failedException);
}

代码示例来源:origin: org.apache.nifi.registry/nifi-registry-jetty

public void start() {
  try {
    // start the server
    server.start();
    // ensure everything started successfully
    for (Handler handler : server.getChildHandlers()) {
      // see if the handler is a web app
      if (handler instanceof WebAppContext) {
        WebAppContext context = (WebAppContext) handler;
        // see if this webapp had any exceptions that would
        // cause it to be unavailable
        if (context.getUnavailableException() != null) {
          startUpFailure(context.getUnavailableException());
        }
      }
    }
    dumpUrls();
  } catch (final Throwable t) {
    startUpFailure(t);
  }
}

代码示例来源:origin: org.apache.hbase/hbase-http

Throwable unavailableException = webAppContext.getUnavailableException();
if (unavailableException != null) {

代码示例来源:origin: cd.connect.common/connect-runnable-war

protected void start() {
  try {
    logger.info("Starting WebApp server");
    createServer();
    createConnector();
    createContext();
    wrapHandlers();
    server.start();
    // Handler/context startup errors aren't propagated, we have to do it manually.
    Throwable error = context.getUnavailableException();
    if (error != null) {
      logger.error("Jetty context startup failed", error);
      throw new RuntimeException("WebApp context startup is unavailable", error);
    }
    if (context.isFailed())
      throw new RuntimeException("WebApp context startup failed");
    logger.info("WebApp server started");
  } catch (Exception e) {
    throw new RuntimeException("WebApp server failed", e);
  }
}

代码示例来源:origin: works.lmz.common/common-runnable-war

protected void start() {
  try {
    log.info("Starting WebApp server");
    createServer();
    createConnector();
    createContext();
    wrapHandlers();
    server.start();
    // Handler/context startup errors aren't propagated, we have to do it manually.
    Throwable error = context.getUnavailableException();
    if (error != null) {
      log.error("Jetty context startup failed", error);
      throw new RuntimeException("WebApp context startup is unavailable", error);
    }
    if (context.isFailed())
      throw new RuntimeException("WebApp context startup failed");
    log.info("WebApp server started");
  } catch (Exception e) {
    throw new RuntimeException("WebApp server failed", e);
  }
}

代码示例来源:origin: com.aliyun.hbase/alihbase-http

Throwable unavailableException = webAppContext.getUnavailableException();
if (unavailableException != null) {

代码示例来源:origin: org.apache.nifi.minifi/minifi-c2-jetty

if (context.getUnavailableException() != null) {
  System.err.println("Failed to start web server: " + context.getUnavailableException().getMessage());
  System.err.println("Shutting down...");
  logger.warn("Failed to start web server... shutting down.", context.getUnavailableException());
  server.stop();
  System.exit(1);

代码示例来源:origin: apache/nifi-minifi

if (context.getUnavailableException() != null) {
  System.err.println("Failed to start web server: " + context.getUnavailableException().getMessage());
  System.err.println("Shutting down...");
  logger.warn("Failed to start web server... shutting down.", context.getUnavailableException());
  server.stop();
  System.exit(1);

代码示例来源:origin: mifos/head

if (webAppContext.getUnavailableException() != null) {
  throw new IllegalStateException(
      "Web App in Jetty Server does not seem to have started up; CHECK THE LOG! PS: Chained exception is: ",
      webAppContext.getUnavailableException());
} else {
  throw new IllegalStateException(

代码示例来源:origin: apache/cxf

@Test
public void startServer() throws Throwable {
  Server server = new org.eclipse.jetty.server.Server(Integer.parseInt(PORT));
  WebAppContext webappcontext = new WebAppContext();
  webappcontext.setContextPath("/resolver");
  webappcontext.setBaseResource(Resource.newClassPathResource("/resolver"));
  HandlerCollection handlers = new HandlerCollection();
  handlers.setHandlers(new Handler[] {webappcontext, new DefaultHandler()});
  server.setHandler(handlers);
  server.start();
  Throwable e = webappcontext.getUnavailableException();
  if (e != null) {
    throw e;
  }
  server.stop();
}

代码示例来源:origin: org.apache.knox/gateway-server

private synchronized void internalActivateArchive( Topology topology, File warDir ) throws IOException, ZipException, ParserConfigurationException, TransformerException, SAXException {
 log.activatingTopologyArchive( topology.getName(), warDir.getName() );
 try {
  WebAppContext newContext = createWebAppContext( topology, warDir, Urls.decode( warDir.getName() ) );
  WebAppContext oldContext = deployments.get( newContext.getContextPath() );
  deployments.put( newContext.getContextPath(), newContext );
  if( oldContext != null ) {
   contexts.removeHandler( oldContext );
  }
  contexts.addHandler( newContext );
  if( contexts.isRunning() && !newContext.isRunning() ) {
   newContext.start();
   if(!newContext.isAvailable()) {
    throw newContext.getUnavailableException();
   }
  }
 } catch( Throwable e ) {
  auditor.audit( Action.DEPLOY, topology.getName(), ResourceType.TOPOLOGY, ActionOutcome.FAILURE );
  log.failedToDeployTopology( topology.getName(), e );
 }
}

代码示例来源:origin: apache/knox

private synchronized void internalActivateArchive( Topology topology, File warDir ) {
 log.activatingTopologyArchive( topology.getName(), warDir.getName() );
 try {
  WebAppContext newContext = createWebAppContext( topology, warDir, Urls.decode( warDir.getName() ) );
  WebAppContext oldContext = deployments.get( newContext.getContextPath() );
  deployments.put( newContext.getContextPath(), newContext );
  if( oldContext != null ) {
   contexts.removeHandler( oldContext );
  }
  contexts.addHandler( newContext );
  if( contexts.isRunning() && !newContext.isRunning() ) {
   newContext.start();
   if(!newContext.isAvailable()) {
    throw newContext.getUnavailableException();
   }
  }
 } catch( Throwable e ) {
  auditor.audit( Action.DEPLOY, topology.getName(), ResourceType.TOPOLOGY, ActionOutcome.FAILURE );
  log.failedToDeployTopology( topology.getName(), e );
 }
}

相关文章

微信公众号

最新文章

更多

WebAppContext类方法