2014-07-25 45 views
0

所以我的問題是,我在新的Java春天,我不能從this (official?) tutorial新手。螞蟻列表掛起,無法加載我的網頁。怎麼了?

那日誌從我的Linux Mint的我猛砸控制檯開始我的第一個應用程序。 怎麼回事? 有什麼幫助嗎?

我會真的很不舒服。

m.k的

`

[email protected] ~/Documents/workspace-sts-3.6.0.M1/springapp $ ant 
Buildfile: /home/marcin/Documents/workspace-sts-3.6.0.M1/springapp/build.xml 

usage: 
    [echo] 
    [echo] springapp build file 
    [echo] ----------------------------------- 
    [echo] 
    [echo] Available targets are: 
    [echo] 
    [echo] build  --> Build the application 
    [echo] deploy --> Deploy application as directory 
    [echo] deploywar --> Deploy application as a WAR file 
    [echo] install --> Install application in Tomcat 
    [echo] reload --> Reload application in Tomcat 
    [echo] start  --> Start Tomcat application 
    [echo] stop  --> Stop Tomcat application 
    [echo] list  --> List Tomcat applications 
    [echo] 

BUILD SUCCESSFUL 
Total time: 0 seconds 
[email protected] ~/Documents/workspace-sts-3.6.0.M1/springapp $ ant deploy 
Buildfile: /home/marcin/Documents/workspace-sts-3.6.0.M1/springapp/build.xml 

build: 
    [javac] /home/marcin/Documents/workspace-sts-3.6.0.M1/springapp/build.xml:45: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds 

deploy: 
    [copy] Copying 2 files to /home/marcin/apache-tomcat-6.0.41/webapps/springapp 

BUILD SUCCESSFUL 
Total time: 0 seconds 
[email protected] ~/Documents/workspace-sts-3.6.0.M1/springapp $ ant list 
Buildfile: /home/marcin/Documents/workspace-sts-3.6.0.M1/springapp/build.xml 

list: 

`

回答

0

它掛在list因爲Tomcat運行(見HERE)。在您的build.xmlstop出現在list之前。

stop  --> Stop Tomcat application //"stop" comes before "list" 
list  --> List Tomcat applications 

當你的目標的上述順序執行整個的build.xmlstop終止listTomcat應用程序可以列出申請虛擬主機的本地主機。因此,Tomcat應用程序停止運行之前list執行,這就是爲什麼它掛起

從的教程頁面,似乎目標的順序是這樣的,他們註定要單獨執行。事實上,tutorial page明確規定,使用命令$ ant list運行list目標之前,你需要運行'${appserver.home}/bin/startup.bat'

所以啓動Tomcat,您可以:

  • 瞭解教程頁面的詳細和選擇您所需的目標序列,或
  • 作爲教程頁建議單獨運行每個目標並查看它們如何工作,或者
  • list目標從stop下移到startstop之間。

    <target name="start" description="Start Tomcat application"> 
        <start url="${tomcat.manager.url}" 
          username="${tomcat.manager.username}" 
          password="${tomcat.manager.password}" 
          path="/${name}"/> 
    </target> 
    <target name="list" description="List Tomcat applications"> 
        <list url="${tomcat.manager.url}" 
          username="${tomcat.manager.username}" 
          password="${tomcat.manager.password}"/> 
    </target>  
    <target name="stop" description="Stop Tomcat application"> 
        <stop url="${tomcat.manager.url}" 
          username="${tomcat.manager.username}" 
          password="${tomcat.manager.password}" 
          path="/${name}"/> 
    </target>