2013-07-18 41 views
0

我正在修改I-Jetty(控制檯)提供的WebApp,並希望從I-Jetty部署它。 的Web應用程序用於工作,但現在從我的瀏覽器訪問時,我得到:503從I-Jetty部署WebApp時出錯

HTTP ERROR: 503 

Problem accessing /console. Reason: 

Service Unavailable 
Powered by Jetty:// 

注:我沒有得到任何構建錯誤和Web應用程序安裝罰款I-碼頭。 我使用jdk1.6.0_45並Maven3.0.5安裝

我的pom.xml的是:

<?xml version="1.0" encoding="UTF-8"?> 
<project 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>org.mortbay.ijetty</groupId> 
    <artifactId>console-parent</artifactId> 
    <packaging>pom</packaging> 
    <version>3.2-SNAPSHOT</version> 
    <name>I-Jetty :: Console Parent</name> 
    <description>Parent project for console</description> 
    <modules> 
    <module>webapp</module> 
    <module>apk</module> 
    </modules> 
    <properties> 
    <android.version>4.1.1.4</android.version> 
    <jetty.version>8.1.11.v20130520</jetty.version> 
    <servlet.version>3.0.20100224</servlet.version> 
    </properties> 
    <build> 
    <plugins> 
     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-install-plugin</artifactId> 
     <version>2.4</version> 
     </plugin> 
    </plugins> 
    </build> 
</project> 

能否請你幫我明白爲什麼發生這種情況,建議修復?

編輯:我想出了問題。仍然沒有解決方案。

classes.zip文件在安裝到I-Jetty上的webapp時未被創建。 當我手動將類複製到安裝Web應用程序時創建的jetty/webapps/console/web-inf/classes文件夾中,從瀏覽器訪問工程...我不確定爲什麼不創建zip文件。

+0

出於某種原因,它現在正在工作,而不是獲取HTTP503error,我的Webapp正在按預期加載。我希望我能理解真正的問題是什麼......現在,如果有人遇到了這個問題,請嘗試在你的主POM中更改你的** jetty **目標版本,因爲它是我在測試之間改變的唯一的東西。 – Artail3

回答

0

我結束了回答我的問題在這個問題:How to compile a .war file to i-jetty (android web server)?,和我在這裏張貼了其他人誰也遇到了同樣的錯誤:

所以基本上我-碼頭網站上說,你需要的官方在您的pom.xml中包含3件東西在網站https://code.google.com/p/i-jetty/wiki/DownloadableWebapps中收聽。現在,只有包含這三個版本纔會面臨的問題是,在較新的Android版本(android-maven-plugin)上,您將面臨與該部分相關的問題。因此,您需要添加以下內容以啓用正確的執行(在關閉插件元素之後添加它,然後再關閉構建元素(< ./plugin>在此處添加它,不加點):

<pluginManagement> 
    <plugins> 
    <plugin> 
     <groupId>org.eclipse.m2e</groupId> 
     <artifactId>lifecycle-mapping</artifactId> 
     <version>1.0.0</version> 
     <configuration> 
     <lifecycleMappingMetadata> 
      <pluginExecutions> 
      <pluginExecution> 
       <pluginExecutionFilter> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-dependency-plugin</artifactId> 
       <versionRange>[2.0,)</versionRange> 
       <goals> 
        <goal>copy-dependencies</goal> 
       </goals> 
       </pluginExecutionFilter> 
       <action> 
       <execute /> 
       </action> 
      </pluginExecution> 
      </pluginExecutions> 
     </lifecycleMappingMetadata> 
     </configuration> 
    </plugin> 
    </plugins> 
</pluginManagement> 

現在,當您運行maven build時,您將在your_application/target/res-overlay/raw文件夾中生成所需的your_webapp.war文件。將your_webapp.war文件複製到your_application/res/raw文件夾中。再次運行maven build。你已經有了!!現在webapp可以正確的建立:)而且你不會再收到錯誤503消息。