在 Cargo 开源项目的帮助下,我一直在尝试从 Ant 脚本自动启动 JBoss。我得到了下面显示的这个错误。非常感谢!
任务定义:
<taskdef resource="cargo.tasks">
<classpath>
<pathelement location="${cargo.core.jar}"/>
<pathelement location="${cargo.ant.jar}"/>
</classpath>
</taskdef>
使用的罐子:
cargo-core-uberjar-1.2.1.jar
cargo-ant-1.2.1.jar
蚂蚁目标:
<!-- Start JBoss -->
<target name="startJboss" depends="prepare">
<cargo id="mycontainerid" containerId="jboss51x" home="C:/opt/jboss/jboss-4.0.5.GA/bin" action="start" wait="false" />
</target>
输出错误:
Buildfile: D:\opt\trunk\build.xml
startJboss:
BUILD FAILED
D:\opt\trunk\build.xml:51: Could not create type cargo due to java.lang.NoClassDefFoundError: org/apache/commons/discovery/resource/ClassLoaders
Total time: 2 seconds