新手。 Ant List挂起,无法加载我的页面。怎么了?

时间:2014-07-25 21:35:42

标签: tomcat ant

所以我的问题是我是Java Spring的新手,我无法从this (official?) tutorial启动我的第一个应用程序

这是我在Linux Mint上从我的Bash控制台登录的。 什么出错了? 有什么帮助吗?

我将非常感激。

m.k的

`

marcin@marcin-ThinkPad-E520 ~/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
marcin@marcin-ThinkPad-E520 ~/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
marcin@marcin-ThinkPad-E520 ~/Documents/workspace-sts-3.6.0.M1/springapp $ ant list
Buildfile: /home/marcin/Documents/workspace-sts-3.6.0.M1/springapp/build.xml

list:

`

1 个答案:

答案 0 :(得分:0)

它挂起list,因为Tomcat 正在投放(请参阅HERE)。在 build.xml 中:stop出现在list之前。

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

当您使用上述目标序列执行整个 build.xml 时,stop会在Tomcat列出之前终止list应用程序虚拟主机localhost的应用程序。因此,Tomcat应用 在执行list之前停止运行 这就是它挂起的原因

来自教程页面,似乎目标序列是单独执行。实际上,tutorial page在使用命令list运行$ ant list目标之前明确指出,您需要 通过运行'${appserver.home}/bin/startup.bat' <来启动Tomcat / em>

所以,你可以:

  • 详细了解教程页面并选择所需的目标序列,或
  • 按照教程页的建议,单独运行每个目标,看看它们是如何工作的,或者
  • 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>