gpt4 book ai didi

java - Ant 卡住且没有异常警告

转载 作者:行者123 更新时间:2023-12-01 15:55:44 25 4
gpt4 key购买 nike

我遇到了一个奇怪的问题,但找不到解决方案。当我通过 ant 运行一个项目时,如果出现未捕获的异常,ant 就会卡住,绝对没有错误。这是我的构建文件。这是一个多线程环境,也是

    <fileset id="masterlibs" dir="${lib.dir}">
<patternset>
<include name="*.jar"/>
</patternset>
</fileset>

<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="init">
<mkdir dir="${build.dir}"/>
</target>
<target name="compile" depends="init">
<javac srcdir="${src.dir}" destdir="${build.dir}">
<classpath>
<pathelement location="${build.dir}"/>
<fileset refid="masterlibs"/>
</classpath>
</javac>
</target>

<target name="run" depends="compile">
<java classname="stockData.AlertHandler" fork="true">
<classpath>
<pathelement location="${build.dir}"/>
<fileset refid="masterlibs"/>
</classpath>
<arg line="true"/>
<arg line="true"/>
<arg line="true"/>
<arg line="true"/>
<arg line="false"/>
<arg line="27_4"/>

<arg line="false"/>
</java>
</target>

最佳答案

Ctrl+Break将向您显示线程转储并指示每个线程正在做什么(以及任何死锁)。我猜这是您生成的 AlertHandler 进程,在 Ant 环境之外调试它可能会更容易。

如果 Ctrl+Break 不起作用(来自文章)

On UNIX platforms you can send a signal to a program by using the kill command. This is the quit signal, which is handled by the JVM. For example, on Solaris you can use the command kill -QUIT process_id, where process_id is the process number of your Java program.

关于java - Ant 卡住且没有异常警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5094373/

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