gpt4 book ai didi

java - taskdef 类 org.apache.catalina.ant.InstallTask​​ 找不到

转载 作者:IT老高 更新时间:2023-10-28 21:03:03 25 4
gpt4 key购买 nike

在 Eclipse 中,我的 build.xml 收到 5 个警告:

taskdef class.org.apache.catalina.ant.InstallTask cannot be found
taskdef class.org.apache.catalina.ant.ListTaskcannot be found
taskdef class.org.apache.catalina.ant.ReloadTaskcannot be found
taskdef class.org.apache.catalina.ant.StartTask cannot be found
taskdef class.org.apache.catalina.ant.StopTask cannot be found

我已经设置了以下系统环境变量(Windows 7)

ANT_HOME: C:\apache-ant-1.8.4
CATALINA_HOME: C:\apache-tomcat-7.0.29
JAVA_HOME: C:\Program Files\Java\jdk1.6.0_34
and have added %ANT_HOME%/bin to PATH

编辑:我还将 catalina-ant.jar 添加到 C:\apache-ant-1.8.4\lib

更多部分代码:

<!-- We need the Catalina jars for Tomcat -->
<!-- * for other app servers - check the docs -->
<fileset dir="${appserver.lib}">
<include name="catalina-ant.jar"/>
</fileset>
</path>

<taskdef name="install" classname="org.apache.catalina.ant.InstallTask">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<taskdef name="reload" classname="org.apache.catalina.ant.ReloadTask">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<taskdef name="list" classname="org.apache.catalina.ant.ListTask">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<taskdef name="start" classname="org.apache.catalina.ant.StartTask">
<classpath refid="catalina-ant-classpath"/>
</taskdef>
<taskdef name="stop" classname="org.apache.catalina.ant.StopTask">
<classpath refid="catalina-ant-classpath"/>
</taskdef>

怎么了?

最佳答案

在 tomcat 7 中,InstallTask​​ 被 DeployTask 替换。

像这样更改你的声明

<taskdef name="install" classname="org.apache.catalina.ant.InstallTask">
<classpath refid="catalina-ant-classpath"/>
</taskdef>

 <taskdef name="install" classname="org.apache.catalina.ant.DeployTask"> 
<classpath refid="catalina-ant-classpath"/>
</taskdef>

关于java - taskdef 类 org.apache.catalina.ant.InstallTask​​ 找不到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12122366/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com