所以我的问题是我是Java Spring的新手,我不能从这个(官方的?)教程开始我的第一个应用程序
这是我在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:
"
它挂在list
,因为Tomcat
是不运行(见这里)。在您的build.xml: stop
出现在list
之前。
stop --> Stop Tomcat application //"stop" comes before "list"
list --> List Tomcat applications
当您使用上述目标序列执行整个build.xml时,在list
能够列出虚拟主机localhost的应用程序之前,stop
将终止Tomcat
应用程序。因此,Tomcat
应用程序在list
执行之前停止运行, 这就是为什么它挂起。从教程页面来看,目标的顺序似乎是这样的,它们应该被单独执行。实际上,教程页面特别指出,在使用命令$ ant list
运行list
目标之前,需要通过运行'${appserver.home}/bin/startup.bat'
来启动Tomcat。所以,你可以:
- 详细了解教程页面并选择所需的目标序列,或
- 按照教程页面的建议,分别运行每个目标,看看它们是如何工作的,或者
将
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>