所以我的问题是我是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:
`
答案 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
下方移至start
和stop
之间。
即。
<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>