Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 351937

Summary: Running Ant targets fails
Product: [Eclipse Project] Platform Reporter: Alex <zherebtsovalex>
Component: AntAssignee: Platform-Ant-Inbox <platform-ant-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: bhochhi, lchapon, Michael_Rennie, satyam.kandula, tobiasbertelsen
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Alex CLA 2011-07-13 05:51:27 EDT
What steps will reproduce the problem?
1. Run any target from any build file from view "Ant"

Resetting Ant Home in Ant Runtime properties does not fix the problem.

-- Error Details --
Date: Wed Jul 13 12:36:48 EEST 2011
Message: Error logged from Ant UI:
Severity: Error
Product: Eclipse 1.4.0.20110609-1120 (org.eclipse.epp.package.jee.product)
Plugin: org.eclipse.ant.launching
Session Data:
eclipse.buildId=I20110613-1736
java.version=1.6.0_05
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=ru_RU
Framework arguments:  -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product

Exception Stack Trace:
java.net.SocketTimeoutException: Accept timed out
	at java.net.PlainSocketImpl.socketAccept(Native Method)
	at java.net.PlainSocketImpl.accept(Unknown Source)
	at java.net.ServerSocket.implAccept(Unknown Source)
	at java.net.ServerSocket.accept(Unknown Source)
	at org.eclipse.ant.internal.launching.launchConfigurations.RemoteAntBuildListener$ServerConnection.run(RemoteAntBuildListener.java:91)
Comment 1 Michael Rennie CLA 2011-07-13 09:52:18 EDT
Can you provide an example buildfile and more exact steps? Just: "Run any target from any build file from view "Ant"" works fine for me.
Comment 2 Alex CLA 2011-07-13 10:04:33 EDT
(In reply to comment #1)
> Can you provide an example buildfile and more exact steps? Just: "Run any
> target from any build file from view "Ant"" works fine for me.

Example buildfile:

<?xml version="1.0" encoding="utf-8"?>
<project name="P-IworkSimple">
  <target name="compile" description="simple javac call">
    <javac srcdir="./src" destdir="./bin" 
      classpath="./lib" 
      includes="**/*.java" 
      encoding="utf8" target="1.5" nowarn="true"  debug="true" debuglevel="lines,source" >
    </javac>
  </target>
</project>

Steps:
1) In Ant view "Add Buildfiles..."
2) In Ant view unfold added buildfile node and double-click on target "compile"

I make so trivial example beacose all more complex buildfiles didn't work after updating Eclipse from Galileo to Indigo.
Comment 3 Michael Rennie CLA 2011-07-18 14:36:01 EDT
(In reply to comment #2)

> Steps:
> 1) In Ant view "Add Buildfiles..."
> 2) In Ant view unfold added buildfile node and double-click on target "compile"

Using those steps I get the following (the buildfile runs as expected):

Buildfile: C:\Users\mrennie\workspaces\workspace\AntTests\351937.ent
compile:
    [javac] C:\Users\mrennie\workspaces\workspace\AntTests\351937.ent:7: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
BUILD SUCCESSFUL
Total time: 381 milliseconds

I also tried:
 - run from the Ant view using both of the launch shortcuts (works as expected)
 - run from the Ant view using the view toolbar action (works as expected)
 - using the previous steps on the 'javac' node in the Ant view (resolves the containing target and runs it)

Is there more to the stacktrace than what you posted in comment#0?
Comment 4 Alex CLA 2011-07-18 15:52:42 EDT
(In reply to comment #3)

My workaround was:
1) full reinstalling eclipse
2) use new path to workspace and importing all necessary projects

it's hard way but helpfull.

Thank you for your trying to help.

Alex.
Comment 5 Michael Rennie CLA 2011-07-19 11:59:04 EDT
(In reply to comment #4) 
> Thank you for your trying to help.

I'm glad you got it working, but you should not have had to re-install Eclipse to do so. The major concern I have is that:

> Resetting Ant Home in Ant Runtime properties does not fix the problem.

Could you post the launch configuration that you we using to run with?

Is there anything else you could tell me about your setup?

 - was the buildfile local to your workspace?
 - was there any special encoding being used?
 - what VM were you trying to run it on?
 - were you trying to run it in the same Vm as Eclipse or a separate one?
Comment 6 Luc Chapon CLA 2011-09-30 08:09:11 EDT
We are several in our office to face the same problem :

- windows 7 / 64bits, 8GM ram
- java sun jdk6.022/64 or jrockit 4.0.1-1.6.0-x64
- eclipse indigo or helios 64 bits
- ivyDE

- possibly several Eclipse instances running simultaneously, each with its own workspace (-data command line option)

At times, generally after a long running time of Eclipse, ant builds cease functionning, with the "SocketTimeoutException: Accept timed out" issue.

The solution then is to restart Eclipse, which quite is annoying.
Comment 7 Satyam Kandula CLA 2011-10-20 02:00:25 EDT
(In reply to comment #6)
Luc Chapon, Whenever you run into this problem, does resetting Ant Home work for you? Can you please also add answers to Michael's questions in comment 5? Any information to reproduce the behavior will help.
Comment 8 Luc Chapon CLA 2011-10-21 09:18:15 EDT
(In reply to comment #7)
> (In reply to comment #6)
> Luc Chapon, Whenever you run into this problem, does resetting Ant Home work
> for you? Can you please also add answers to Michael's questions in comment 5?
> Any information to reproduce the behavior will help.

I have now two Eclipses running, both plagued with this problem. I'm not sure it's always the case (all Eclipse instances simultaneously bugged).

If by "resetting ant home", you mean go to Eclipse preferences, Ant, Runtime, click "Ant home...", confirm the selected directory, click Ok all the way out, well, that does not solve the problem. Again, my only way out in this situation is to restart Eclipse.

With the help of processExplorer, I can give you the command lines used

Eclipse itself (initial, manual, launch) :
"D:\Dev\Eclipse\eclipse-x64\eclipse.exe" -data "D:\Dev\Eclipse\workspace-x64-Indigo branch51"

The javaw.exe launched immediatelely below Eclipse :
D:/JDK/jrmc-4.0.1-1.6.0-x64/bin/javaw.exe
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx2048m
-XX:MaxPermSize=256m
-jar D:\Dev\Eclipse\eclipse-x64\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
-os win32
-ws win32
-arch x86_64
-showsplash
-launcher D:\Dev\Eclipse\eclipse-x64\eclipse.exe
-name Eclipse
--launcher.library D:\Dev\Eclipse\eclipse-x64\\plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502\eclipse_1406.dll
-startup D:\Dev\Eclipse\eclipse-x64\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.overrideVmargs
-exitdata 12d8_60
-clean
-eclipse.password D:/Dev/Eclipse/eclipse-x64/epw.txt
-product org.eclipse.epp.package.jee.product
-data "D:\Dev\Eclipse\workspace-x64-Indigo branch51"
-vm D:/JDK/jrmc-4.0.1-1.6.0-x64/bin/javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx2048m
-XX:MaxPermSize=256m
-jar D:\Dev\Eclipse\eclipse-x64\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar 

The javaw.exe launched below this to run ant:
D:\JDK\jdk1.6.0_22-x64\bin\javaw.exe
-Dant.home=D:\Dev\ant\apache-ant-1.8.2
-Dant.library.dir=D:\Dev\ant\apache-ant-1.8.2\lib
"-Djava.library.path=D:\JDK\jrmc-4.0.1-1.6.0-x64\bin;.;C:\Windows\system32;C:\Windows;C:\Windows\System32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\Dev\Eclipse\eclipse-x64\plugins\org.apache.ant_1.7.1.v20100518-1145\bin;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\PROGRA~1\IBM\SQLLIB\BIN;C:\PROGRA~1\IBM\SQLLIB\FUNCTION;C:\PROGRA~1\IBM\SQLLIB\SAMPLES\REPL;C:\Program Files (x86)\WinSCP\;C:\Program Files\Locate32;D:\Téléchargements\Système\gnuWin32\GetGnuWin32\gnuwin32\bin;C:\Program Files (x86)\CVSNT;D:\app\lchapon\product\11.2.0\client_1\bin;C:\Program Files (x86)\IDM Computer Solutions\UltraEdit\;C:\Program Files (x86)\CVSNT\;D:\Dev\Eclipse\eclipse-x64\configuration\org.eclipse.osgi\bundles\621\1\.cp"
-Dfile.encoding=iso-8859-15
-Xbootclasspath:D:\JDK\jdk1.6.0_22-x64\jre\lib\resources.jar;D:\JDK\jdk1.6.0_22-x64\jre\lib\rt.jar;D:\JDK\jdk1.6.0_22-x64\jre\lib\jsse.jar;D:\JDK\jdk1.6.0_22-x64\jre\lib\jce.jar;D:\JDK\jdk1.6.0_22-x64\jre\lib\charsets.jar;D:\JDK\jdk1.6.0_22-x64\jre\lib\plugin.jar;D:\JDK\jdk1.6.0_22-x64\lib\tools.jar
-classpath D:\Dev\ant\apache-ant-1.8.2\lib\ant-antlr.jar;D:\Dev\ant\apache-ant-1.8.2\lib\ant-apache-bcel.jar;D:\Dev\ant\apache-ant-1.8.2\lib\ant-apache-bsf.jar;D:\Dev\ant\apache-ant-1.8.2\lib\ant-apache-log4j.jar;D:\Dev\ant\apache-ant-1.8.2\lib\ant-apache-oro.jar;D:\Dev\ant\apache-ant-1.8.2\lib\ant-apache-regexp.jar;D:\Dev\ant\apache-ant-1.8.2\lib\ant-apache-resolver.jar;D:\Dev\ant\apache-ant-1.8.2\lib\ant-apache-xalan2.jar;D:\Dev\ant\apache-ant-1.8.2\lib\ant-commons-logging.jar;D:\Dev\ant\apache-ant-1.8.2\lib\ant-commons-net.jar;D:\Dev\ant\apache-ant-1.8.2\lib\ant-jai.jar;D:\Dev\ant\apache-ant-1.8.2\lib\ant-javamail.jar;D:\Dev\ant\apache-ant-1.8.2\lib\ant-jdepend.jar;D:\Dev\ant\apache-ant-1.8.2\lib\ant-jmf.jar;D:\Dev\ant\apache-ant-1.8.2\lib\ant-jsch.jar;D:\Dev\ant\apache-ant-1.8.2\lib\ant-junit.jar;D:\Dev\ant\apache-ant-1.8.2\lib\ant-junit4.jar;D:\Dev\ant\apache-ant-1.8.2\lib\ant-launcher.jar;D:\Dev\ant\apache-ant-1.8.2\lib\ant-netrexx.jar;D:\Dev\ant\apache-ant-1.8.2\lib\ant-swing.jar;D:\Dev\ant\apache-ant-1.8.2\lib\ant-testutil.jar;D:\Dev\ant\apache-ant-1.8.2\lib\ant.jar;D:\Dev\Eclipse\eclipse-x64\plugins\org.apache.ivy.eclipse.ant_2.2.0.final_20100923230623\ivy.jar;D:\Dev\Eclipse\eclipse-x64\configuration\org.eclipse.osgi\bundles\64\1\.cp\lib\antdebug.jar;D:\Dev\Eclipse\eclipse-x64\configuration\org.eclipse.osgi\bundles\64\1\.cp\lib\remote.jar;D:\Dev\Eclipse\eclipse-x64\configuration\org.eclipse.osgi\bundles\65\1\.cp\lib\remoteAnt.jar;D:\JDK\jdk1.6.0_22-x64\lib\tools.jar;D:\Dev\ant\apache-ant-1.8.2\lib\ant-contrib-1.0b3.jar;D:\Dev\Eclipse\eclipse-x64\plugins\org.eclipse.swt.win32.win32.x86_64_3.7.1.v3738a.jar org.eclipse.ant.internal.launching.remote.InternalAntRunner
-Dorg.eclipse.ant.core.ANT_PROCESS_ID=1319201739735
-Declipse.connect.port=62000
-Declipse.pdebuild.home=/D:/Dev/Eclipse/eclipse-x64/plugins/org.eclipse.pde.build_3.7.0.v20110512-1320/./
-Declipse.pdebuild.scripts=/D:/Dev/Eclipse/eclipse-x64/plugins/org.eclipse.pde.build_3.7.0.v20110512-1320/scripts/
-Declipse.pdebuild.templates=/D:/Dev/Eclipse/eclipse-x64/plugins/org.eclipse.pde.build_3.7.0.v20110512-1320/templates/
-Dant.home=D:\Dev\ant\apache-ant-1.8.2
-logger org.eclipse.ant.internal.launching.remote.logger.RemoteAntBuildLogger
-inputhandler org.eclipse.ant.internal.ui.antsupport.inputhandler.ProxyInputHandler
-eclipseTask antlib:org.apache.ivy.ant:configure,org.apache.ivy.ant.IvyConfigure
-eclipseTask antlib:org.apache.ivy.ant:resolve,org.apache.ivy.ant.IvyResolve
-eclipseTask antlib:org.apache.ivy.ant:retrieve,org.apache.ivy.ant.IvyRetrieve
-eclipseTask antlib:org.apache.ivy.ant:deliver,org.apache.ivy.ant.IvyDeliver
-eclipseTask antlib:org.apache.ivy.ant:publish,org.apache.ivy.ant.IvyPublish
-eclipseTask antlib:org.apache.ivy.ant:extract,org.apache.ivy.ant.IvyExtractFromSources
-eclipseTask antlib:org.apache.ivy.ant:cachepath,org.apache.ivy.ant.IvyCachePath
-eclipseTask antlib:org.apache.ivy.ant:cachefileset,org.apache.ivy.ant.IvyCacheFileset
-eclipseTask antlib:org.apache.ivy.ant:report,org.apache.ivy.ant.IvyReport
-eclipseTask antlib:org.apache.ivy.ant:repreport,org.apache.ivy.ant.IvyRepositoryReport
-eclipseTask antlib:org.apache.ivy.ant:var,org.apache.ivy.ant.IvyVar
-eclipseTask antlib:org.apache.ivy.ant:check,org.apache.ivy.ant.IvyCheck
-eclipseTask antlib:org.apache.ivy.ant:artifactproperty,org.apache.ivy.ant.IvyArtifactProperty
-eclipseTask antlib:org.apache.ivy.ant:buildlist,org.apache.ivy.ant.IvyBuildList
-eclipseTask antlib:org.apache.ivy.ant:install,org.apache.ivy.ant.IvyInstall
-eclipseTask antlib:org.apache.ivy.ant:convertpom,org.apache.ivy.ant.IvyConvertPom
-eclipseTask antlib:org.apache.ivy.ant:makepom,org.apache.ivy.ant.IvyMakePom
-eclipseTask antlib:org.apache.ivy.ant:artifactreport,org.apache.ivy.ant.IvyArtifactReport
-eclipseTask antlib:org.apache.ivy.ant:info,org.apache.ivy.ant.IvyInfo
-eclipseTask antlib:org.apache.ivy.ant:addpath,org.apache.ivy.ant.AddPathTask
-eclipseTask antlib:org.apache.ivy.ant:listmodules,org.apache.ivy.ant.IvyListModules
-eclipseTask antlib:org.apache.ivy.ant:findrevision,org.apache.ivy.ant.IvyFindRevision
-eclipseTask antlib:org.apache.ivy.ant:buildnumber,org.apache.ivy.ant.IvyBuildNumber
-eclipseTask antlib:org.apache.ivy.ant:cleancache,org.apache.ivy.ant.IvyCleanCache
-eclipseType antlib:org.apache.ivy.ant:settings,org.apache.ivy.ant.IvyAntSettings
-buildfile D:\Dev\underCvs\coheriscrm\web\branch51\build\ant\dev.xml copy-cpw-all


As you can (or could) see, I use Eclipse64 with JRockit 64, and launched ant in a separate VM (sun java 64).
Again, this works most of the time. Other colleague who do not use JRockit have the same problem.
I also use a specific ant runtime, not the one provided by Eclipse. Others who do not have also the same problem.

I just tried changing this runtime, to switch to the embedded ant version (plugins\org.apache.ant_1.8.2.v20110505-1300 in my case), I get the same error (I did not restart Eclipse). Changing back to my specific ant then did not help either.


Here my eclipse.ini
-clean
-eclipse.password
D:/Dev/Eclipse/eclipse-x64/epw.txt
-vm
D:/JDK/jrmc-4.0.1-1.6.0-x64/bin/javaw.exe
-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx2048m

My OS: Windows 7/64 pro, 8GB RAM.

The error logged in Eclipse:
java.net.SocketTimeoutException: Accept timed out
	at java.net.PlainSocketImpl.socketAccept(Native Method)
	at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:390)
	at java.net.ServerSocket.implAccept(ServerSocket.java:453)
	at java.net.ServerSocket.accept(ServerSocket.java:421)
	at org.eclipse.ant.in

and the corresponding Session Data:
eclipse.buildId=M20110909-1335
java.version=1.6.0_20
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=fr_FR
Framework arguments:  -eclipse.password D:/Dev/Eclipse/eclipse-x64/epw.txt -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -clean -eclipse.password D:/Dev/Eclipse/eclipse-x64/epw.txt -product org.eclipse.epp.package.jee.product -data D:\Dev\Eclipse\workspace-x64-Indigo branch51

Well, I hope all this can help...
Comment 9 Luc Chapon CLA 2011-10-21 09:22:32 EDT
Follow up: terminating one of the fault Eclipse sessions did not fix the other still running sessions, even when there is only one left.
Comment 10 Rupesh BhochhibhoyA CLA 2012-02-03 18:47:52 EST
I encountered exactly same exception when running any targets in eclipse. my build tasks runs fine from commandline. I believe the problem is not on eclipse or any on ant, I had few other processes running on my system, especially "ansicon.exe" which was basically freezing the whole eclipse. If you still having problem, try killing some processes, see if that can bring any luck.

Rupesh
Comment 11 Lars Vogel CLA 2019-11-27 07:37:51 EST
This bug hasn't had any activity in quite some time. Maybe the problem got
resolved, was a duplicate of something else, or became less pressing for some
reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it.
The information can be, for example, that the problem still occurs, that you
still want the feature, that more information is needed, or that the bug is
(for whatever reason) no longer relevant.

If the bug is still relevant, please remove the stalebug whiteboard tag.