• Hudson+ant 启动 tomcat 的问题 at 2011年10月12日

    命令行的那种方式还是有问题,现在把问题绕过去了,手工创建的计划任务,测试通过了。

  • Hudson+ant 启动 tomcat 的问题 at 2011年10月11日

    错误提示就是 “错误:拒绝访问”,我刚才换了一种方式改用手工创建了,手工创建的时候显示当前用户为 dell-PC\dell,后来我把命令改成 schtasks /create /ru "dell-pc\dell" /rp xiaomo521 /sc onstart /tn ShutdownTomcat /tr "D:\apache-tomcat-5.5.17\bin\shutdown.bat" 可是在命令行还是报之前的错,但是手工创建的任务我用 ant 脚本调的时候成功启动了,不知道是怎么回事,我手工创建输入的用户名和密码和命令中写的是一样的,还有个疑问就是手工创建和命令行中效果是不是一样的啊?

  • Hudson+ant 启动 tomcat 的问题 at 2011年10月11日

    我看我账户的权限是管理员的权限啊

  • Hudson+ant 启动 tomcat 的问题 at 2011年10月11日

    根据文章的内容,按照你说的方法我试了,但是在 win7 系统下创建 schtasks 任务的时候报 “拒绝访问” 的错了,找资料说需要写我账户的用户名和密码,我写了,但是还是不行,下面是我执行的命令,帮忙看一下哪不对。 schtasks /create /ru dell /rp 1 /sc onstart /tn ShutdownTomcat /tr "D:\apache-tomcat-5.5.17\bin\shutdown.bat"

  • 还是不知道为什么每次构建完毕 exe 的界面都关闭,现在只能通过操作系统自带的定时任务启动我的 exe 了,先解燃眉之急,如果大家在工作中把这个问题解决了,还希望大家发个帖子告诉一声啊,谢谢!

  • Hudson 我换了最新的版本,上面的错误信息没了,构建的过程中出现下边的错误,我的操作系统时 XP 的,tomcat6.0,Hudson 构建完成之后界面就关闭了,我不想关闭,有解决办法吗? 2011-3-23 10:22:15 hudson.Proc$LocalProc join 警告: Process leaked file descriptors. See [url=http://wiki.hudson-ci.org/display/HUDhttp://wiki.hudson-ci.org/display/HUD[/url]] SON/Spawning+processes+from+build for more information java.lang.Exception at hudson.Proc$LocalProc.join(Proc.java:236) at hudson.Launcher$ProcStarter.join(Launcher.java:281) at hudson.tasks.Ant.perform(Ant.java:216) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java: 622) at hudson.model.Build$RunnerImpl.build(Build.java:172) at hudson.model.Build$RunnerImpl.doRun(Build.java:137) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:420) at hudson.model.Run.run(Run.java:1362) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:145) 2011-3-23 10:22:15 hudson.model.Run run 信息: Test0315 #75 main build action completed: SUCCESS

  • 不好意思,习惯截图了,我换了最新版本的之前的那个错误信息没了,但是在构建完成之后出来下边的错误信息了,我 Hudson 是 1.398,XP 系统,tomcat 是 6.0 的,构建完成之后界面就关闭了,我不想让它关闭,有啥解决办法没? 信息: Completed initialization 2011-3-23 10:10:04 hudson.TcpSlaveAgentListener 信息: JNLP slave agent listener started on TCP port 2942 2011-3-23 10:10:40 hudson.Proc$LocalProc join 警告: Process leaked file descriptors. See [url=http://hudson.gotdns.com/wiki/displayhttp://hudson.gotdns.com/wiki/display[/url]] /HUDSON/Spawning+processes+from+build for more information java.lang.Exception at hudson.Proc$LocalProc.join(Proc.java:189) at hudson.Launcher$ProcStarter.join(Launcher.java:278) at hudson.tasks.Ant.perform(Ant.java:212) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java: 601) at hudson.model.Build$RunnerImpl.build(Build.java:174) at hudson.model.Build$RunnerImpl.doRun(Build.java:138) at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:416) at hudson.model.Run.run(Run.java:1241) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:122) 2011-3-23 10:10:40 hudson.model.Run run 信息: Test0315 #74 main build action completed: SUCCESS

  • 我试过这样方法了,界面起来了,可是为什么等 Hudson 构建完成之后,我的界面又关闭了呢?而且我在命令好启动 HUDSON 的时候报错了,不知道是为什么?

  • 我现在换了一种方式,用 ant 直接运行 exe 文件,可是在 dos 里边试验的时候,doc 中提示:新添加了一项作业,ID=1,用 Hudson 调 ant 脚本的时候也是这个提示,但是我 exe 文件的界面还是没有启动呢?下边是我 ant 脚本中的代码,或者直接这么说吧,我现在想要一个可以在 Hudson 中启动 exe 文件界面的 ant 脚本代码或者是 java 代码,但是一定要能在 Hudson 中能启动的,因为我想要这个步骤自动化,谁那有,帮帮忙,给一个呗,急死了!!!! date = new java.text.SimpleDateFormat("HH:mm") .format(new Date(System.currentTimeMillis() + 1000)); project.setProperty(attributes.get("property"), date);

  • 我在系统设置里配置好了 ant_home 的路径,然后把脚本放在 Hudson 能找到的默认路径下了,每次构建 Hudson 就自己去找了:(

  • 还是没找到,具体点呗!那个配置?

  • 怎么分开,我不会啊!需要配置哪?不好意思,菜鸟级别人物:(

  • 43 行的代码是我搜的解决方案,可以不要,下面是去掉 43 行代码的 Hudson 提示。 Started by user anonymousBuilding on master[Test0315] $ cmd.exe /C '"D:\apache-ant-1.7.1-bin\apache-ant-1.7.1\bin\ant.bat && exit %%ERRORLEVEL%%"'Buildfile: build.xml compile:
    [echo] xiaomo compilerun:
    [echo] xiaomo testBUILD SUCCESSFULTotal time: 0 seconds Process leaked file descriptors. See [url=http://hudson.gotdns.com/wiki/display/HUDSON/Spawning+processes+from+build] http://hudson.gotdns.com/wiki/display/HUDSON/Spawning+processes+from+build [/url] for more information Finished: SUCCESS

    下面是我的 build 脚本:

    <?xml version="1.0" encoding="UTF-8"?>

    <!-- 配置编译任务 -->

  • Started by user anonymousBuilding on master[Test0315] $ cmd.exe /C '"D:\apache-ant-1.7.1-bin\apache-ant-1.7.1\bin\ant.bat && exit %%ERRORLEVEL%%"'Buildfile: build.xmlcompile: [echo] xiaomo compilerun: [echo] xiaomo testBUILD FAILEDD:\CreditWorkSpace\Test0315\build.xml:43: Unable to create javax script engine for beanshellTotal time: 0 secondsProcess leaked file descriptors. See [url=http://hudson.gotdns.com/wiki/display/HUDSON/Spawning+processes+from+build] http://hudson.gotdns.com/wiki/display/HUDSON/Spawning+processes+from+build [/url] for more informationFinished: FAILURE

  • 点上边的那个链接就可以看到了吧,这是提示信息: Sometimes you'd like to spawn a process from a build that lives longer than the build itself. For example, maybe a part of the build is to launch a new application server with the result of the build. When you do this, you often experience a problem where the build doesn't terminate; you'll see that shell script/ant/maven terminates as expected, but Hudson just insists on waiting, as if it didn't notice that the build is over. Starting Hudson 1.136, Hudson detects this situation and instead of causing infinite block, it will just print out a warning and let you get going. But you should still understand what's causing this.

    Why?The reason this problem happens is because of file descriptor leak and how they are inherited from one process to another. Hudson and the child process are connected by three pipes (stdin/stdout/stderr.) This allows Hudson to capture the output from the child process. Since the child process may write a lot of data to the pipe and quit immediately after that, Hudson needs to make sure that it drained the pipes before it considers the build to be over. Hudson does this by waiting for EOF. When a process terminates for whatever reasons, the operating system closes all the file descriptors it owned. So even if the process didn't close stdout/stderr, Hudson will nevertheless get EOF. The complication happens when those file descriptors are inherited to other processes. Let's say the child process forks another process to the background. The background process (AKA daemon) inherits all the file descriptors of the parent, including the writing side of the stdout/stderr pipes that connect the child process and Hudson. If the daemon forgets to close them, Hudson won't get EOF for pipes even when the child process exits, because daemon still have those descriptors open. That's how this problem happens. A good daemon program closes all file descriptors to avoid problems like this, but often there are bad ones that don't follow the rule. Work aroundOn Unix, you can use a wrapper like this to make the daemon behave. On Windows, the 'at' command can be used to launch a process in the background. See the example below: date = new java.text.SimpleDateFormat("HH:mm") .format(new Date(System.currentTimeMillis() + 60000)); project.setProperty(attributes.get("property"), date);

    Another similar workaround on Windows is to use a wrapper script and launch your program through it. <!-- optional --> <!-- optional --> <!-- this script -->

    Another workaraund for Windows XP and later is to shedule permanent task and force running it from the ant script. Once run the command: C:>SCHTASKS /Create /RU SYSTEM /SC ONSTART /TN Tomcat /TR "C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin\startup.bat"

    Note, that ONSTART can be replaced with ONCE if you do not want to keep Tomcat running. Add the following code to your ant script:

    Another possibility that we can consider is to do something in Hudson. Labels:

    Enter labels to add to this page:

    Looking for a label? Just start typing.

    Comments (11)

    * Hide Comments Show Comments Collapse All Collapsing… Expanding… Expand All

    Jul 04, 2007 Kohsuke Kawaguchi says:For my book keeping purpose, this bug discusses the possibility of using NIO wit... For my book keeping purpose, this bug discusses the possibility of using NIO with processes.

    May 23, 2009 Keith Clarke says:At least for Tomcat 6, installing Tomcat as a service and using "net start tomca... At least for Tomcat 6, installing Tomcat as a service and using "net start tomcat6" and "net stop tomcat6" avoids this problem and is simple.

    Jul 29, 2009 J. Michael McGarr says:I am currently experiencing this issue on Solaris 10. I have Hudson runnin... I am currently experiencing this issue on Solaris 10. I have Hudson running and I am trying to setup a job that stops and then starts a local instance of JBoss. I have been unsuccessful in convincing the SA's to install daemonize as is recommended above. I am trying to run a shell script to stop/start the JBoss instance, but when the Hudson job completes, the JBoss instance shutdowns. Does anybody have any recommendations on how we can spawn an instance of JBoss from a Hudson job without using the daemonize script?

    Aug 03, 2009 Duana Stanley says:I'm having the same problem trying to start websphere from my ant script via a w... I'm having the same problem trying to start websphere from my ant script via a windows batch command (the batch command spawns a child process). I'd like to know why it works from ant on the command line but not from Hudson. When run under Hudson the child process that my windows batch file creates gets killed somehow. I understand there may be some issues around open file descriptors etc, but if it's not a problem for ant, why is it a problem for Hudson? The Hudson build doesn't hang or give any warnings. I'm working in a limited environment where I can't install services or schedule background tasks. I'm very interested to understand what's behind this problem.

    Aug 09, 2009 Duana Stanley says:According to issue 2729 https://hudson.dev.java.net/issues/show_bug.cgi?id=2729 ... According to issue 2729 https://hudson.dev.java.net/issues/show_bug.cgi?id=2729 , it sounds like Hudson is willfully killing my build job's beloved spawn. They mention a workaround of setting the environment variabe BUILD_ID in the job eg. set BUILD_ID=dontKillMe which worked for me.

    # http://wiki.hudson-ci.org/display/~noah@onemorebug.com Noah Sussman says:Thanks for the tip. It took me a while to realize that when a build is done, Hu.. Thanks for the tip. It took me a while to realize that when a build is done, Hudson kills any child processes that are started by build steps.

    Overriding that default behavior by setting BUILD_ID as you suggest, BUILD_ID=allow_to_run_as_daemon start_my_service

    worked for me too.

    Aug 03, 2009 Duana Stanley says:A simpler way, not involving bean-shell, to get the "next minute" in the ant exa... A simpler way, not involving bean-shell, to get the "next minute" in the ant example above using the at command is

    Aug 04, 2009 Chetan Sarva says:I wasn't able to get the daemonize method to work (not sure why) for a free-styl... I wasn't able to get the daemonize method to work (not sure why) for a free-style project on linux but atd works great. I simply schedule my job like so - $ echo | at date -d '+1 minute' +"%H:%M"

    Dec 17, 2009 pangzi says:I use the ' csript.exe' method run 'c:\apache-tomcat-6.0.18\bin\startup.ba... I use the ' csript.exe' method run 'c:\apache-tomcat-6.0.18\bin\startup.bat' on win 2000 and xp ,then it can run on local ant command,but don't run in hudson. --- on win7 ok I also try 'at' , win 2000 can't execute , xp ok why?? Started by user anonymous [workspace] $ cmd /c call C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\4\hudson2567484063519403955.bat C:\Documents and Settings\Administrator.hudson\jobs\idpro-wap\workspace>cscript //nologo d:\builds\projects\idpro-wap\antRunAsync.js c:\apache-tomcat-6.0.18\bin\startup.bat C:\Documents and Settings\Administrator.hudson\jobs\idpro-wap\workspace>exit 0 Finished: SUCCESS

    Jul 29, 2010 Shimsha Rao says:Hi Pangzi, How did you fix this problem? Even I am facing the similar problem. ... Hi Pangzi, How did you fix this problem? Even I am facing the similar problem. thanks, Shimsha May 06, 2010 Gerald Reinhart says:I launch a background command with the plugin Post build task ... and Huds... I launch a background command with the plugin Post build task ... and Hudson do not kill it.

    [[i] 本帖最后由 laofo 于 2011-3-17 10:35 编辑 ]

  • 刚刚试过了,命令行直接用 ant 命名是可以启动这个 exe 文件的,但是通过 Hudson 来执行 ant 脚本的时候就运行不起来了,但是构建是成功的,Hudson 给返回了一个信息,信息中都是英文的我也看不懂,下面是链接的内容

    Process leaked file descriptors. See [url=http://hudson.gotdns.com/wiki/display/HUDSON/Spawning+processes+from+build] http://hudson.gotdns.com/wiki/display/HUDSON/Spawning+processes+from+build [/url] for more information

  • 那在 Hudsoon 里需要插件什么的吗?Hudson 是怎么和这些制作工具连接的呢?

  • 这个是我自己想的,因为代码在变,你的构建结果肯定也会跟着变,所以我想保留住在这一段时间内构建结果最好的,然后以后有个比较啥的,或者是可以恢复到那次构建。 我的问题根源应该在我不知道 Hudson 的每次的构建结果,咱们除了可以看到一些错误信息之外,还可以拿它的结果干什么用啊?就拿那个 Tag this build 来说吧,把他 Tag 到 svn 上有什么用呢?

    [[i] 本帖最后由 xiaomo 于 2010-6-10 09:51 编辑 ]

  • Hudson 构建失败邮箱设置 at 2010年06月01日

    哦,这样啊,那我试试看。

  • Hudson 构建失败邮箱设置 at 2010年05月31日

    就是我的单元测试用例是失败的,Hudson 最后构建的结果是一个黄色的圆圈,黄色的意思是构建不稳定吧,SVN 记录了单元测试代码的提交者了,所以 Hudson 应该会找到编写单元测试代码的人啊

  • Hudson 多项目构建问题 at 2010年05月28日

    呵呵,我怀疑我的电脑有问题了,左右键还不分了,最开始的时候是在 TD 中右键双击当左键单击用,现在在 Hudson 界面中既然左键有的时候不好用了,杀毒还没病毒,搞不好得重新做系统了我。 那每次都用那个 use update,那当我项目越来越大的时候岂不是会很慢啊?那 Hudson 都已经检测到了更新为什么他不能拿到更新呢,他们的先后顺序是什么样的啊,是需要等几分钟之后再构建呢,还是怎么办呢?

  • Hudson 多项目构建问题 at 2010年05月27日

    恩,还是你说的有道理:loveliness: ,我现在改用 build other project 了,今天试验了一个简单的,跑通了,配置的过程中发现了一些问题,感觉 Hudson 配置改着改着就乱了呢,举个例子说,我每次都配置好了 build other project 然后保存了,可是当我在打开那个 job 的配置时,却发现那个配置给取消了,不知道怎么回事,还有就是,我的 build.xml 文件,当我更改了之后提交到 SVN 上了,然后我在重新构建 job,Hudson 的 workspace 目录下的 build。xml 既然没有更新,还是我更改前的那个,如果我把 use update 配置上了,它才会给我拿到我更改之后的,按道理它应该能检测到我 build。xlm 文件有变化了啊,哎,没办法,我现在都不怎么修改 job 的配置了,就用删除了,删除之后再重新 new,但是感觉好麻烦啊

  • Hudson 问题 at 2010年05月07日

    恩,确定,我后来过了几分钟又试了一次,这回就好了,不理解了,怎么还需要等吗?还是说需要其他的操作呢?

  • Hudson+svn 构建问题 at 2010年04月30日

    哦,明白了,是我理解的有问题了,我以为 Local module directory (optional) 下边填的目录必须得是 Repository URL 下边的呢,英语不好,没度明白它的帮助,呵呵,谢谢了,这块明白了。

    [[i] 本帖最后由 xiaomo 于 2010-4-30 10:00 编辑 ]

  • Hudson 从 svn 上提取代码的时候有两处需要配置,Repository URL 和 Local module directory (optional),我做是实验,看到的效果是 Hudoson 只把 Local module directory (optional) 的代码 down 到了它对应的目录下,而不是 Repository URL 处的,那我现在就有个问题了,我举个例子说,假如: Repository URL 假如我现在指向的是我的整个项目的工作区间,那下边的这个 Local module directory (optional) 我填的是整个工作区间下的单一一个模块对应的代码包,当构建的时候,如果我写的 ant 脚本是想对整个系统进行构建,而我在从 svn 上 down 代码的时候却没有把所有的代码都 down 下来,会不会有问题呢?Local module directory (optional) 到底是什么意思?Hudson 构建时针对的是 Repository URL 出的代码包还是 Local module directory (optional) 处的代码包?