2017-03-16 96 views
1

在Jetty中是否有任何來自Tomcat的EXIT_ON_INIT_FAILURE等價物?我在啓動期間(在Spring Bean初始化過程中)引發IllegalArgumentException,但Jetty僅從DeploymentManager打印WARN(無法達到節點目標:啓動)並正常啓動(當然沒有上下文)。我試過了以下選項:Jetty-9.3.12獨立服務器中的EXIT_ON_INIT_FAILURE

<?xml version="1.0" encoding="UTF-8"?> 
     <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd"> 
     <Configure class="org.eclipse.jetty.webapp.WebAppContext"> 
      <Set name="contextPath">{context_path}</Set> 
      <Set name="throwUnavailableOnStartupException">true</Set> 
      <Set name="war">{war_path}</Set> 
      <Set name="maxFormContentSize">10485760</Set> 
     </Configure> 

但沒有結果。從碼頭

日誌:

2017-03-16 21:45:05.798:WARN:oejd.DeploymentManager:main: Unable to reach node goal: started 
java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'intranetClient' defined in class path resource 
{...stacktrace...} 
2017-03-16 21:45:05.836:INFO:oejs.AbstractConnector:main: Started [email protected]{HTTP/1.1,[http/1.1]}{0.0.0.0:5070} 
2017-03-16 21:45:05.840:INFO:oejs.AbstractConnector:main: Started [email protected]{HTTP/1.1,[http/1.1]}{0.0.0.0:5075} 
2017-03-16 21:45:05.841:INFO:oejs.Server:main: Started @40994ms 

預先感謝任何建議應該如何配置。

+0

您是否找到解決方案? – quintin

回答

1

您的DTD已過時。

用途:

<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" 
      "http://www.eclipse.org/jetty/configure_9_3.dtd"> 

擺脫塊...

<Set name="servletHandler"> 
     <New class="org.eclipse.jetty.servlet.ServletHandler"> 
      <Set name="startWithUnavailable">false</Set> 
     </New> 
    </Set> 

是所有需要在你的${jetty.base}/webapps/${context}.xml文件中的其它觸發失敗。

+0

我更新了DTD,不幸的是仍然是相同的......; /我附上日誌和更新的context.xml –