This site is maintained for archival purposes only. Eclipse projects have transitioned to GitHub and Eclipse GitLab. Use the Projects search tool to locate your project and access its latest code and issue tracker.
Bug 522581 - Cannot run ant build file from generic project
Summary: Cannot run ant build file from generic project
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.7   Edit
Hardware: Other Linux
: P3 normal with 2 votes (vote)
Target Milestone: 4.7.2   Edit
Assignee: Sarika Sinha CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 526492 526539 527220 529440 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-09-21 09:23 EDT by Richard Evans CLA
Modified: 2018-02-09 05:23 EST (History)
13 users (show)

See Also:


Attachments
Screen grab showing error (13.37 KB, image/png)
2017-09-21 09:23 EDT, Richard Evans CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Evans CLA 2017-09-21 09:23:46 EDT
Created attachment 270288 [details]
Screen grab showing error

Create a new General Project (new Project -> General -> Project) named, for example, 'btest'.

In the top level of the new project, create an Ant build file build.xml containing, for example:

<project name="btest" default="hello" basedir=".">
  <target name="hello">
  </target>
</project>

In the Package Explorer, right click on build.xml and select Run As -> Ant Build

The build fails immediately with the error:

'Launching btest build.xml' has encountered a problem.

Launch configuration btest build.xml references non-existing project btest.

(see attached screen grab).

Also fails when run from External Tools menu.

This worked as recently as Eclipse 4.6.3.
Comment 1 Sarika Sinha CLA 2017-09-26 00:40:34 EDT
Thanks for reporting, I am able to reproduce this.
Looks like the impact of moving to new Ant version.
We are basically getting 
	at java.net.DualStackPlainSocketImpl.waitForNewConnection(Native Method)
	at java.net.DualStackPlainSocketImpl.socketAccept(Unknown Source)
	at java.net.AbstractPlainSocketImpl.accept(Unknown Source)
	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:89)
Comment 2 Richard Evans CLA 2017-09-27 05:07:34 EDT
Interesting if related to ant version - ant builds work fine from Java projects, it seems to be the Eclipse project type which is a problem.
Comment 3 Marcus Storre CLA 2017-10-16 06:09:24 EDT
I can confirm that this bug occured, when updating from 4.7.1 to 4.7.1a
Comment 4 Sarika Sinha CLA 2017-10-16 07:48:30 EDT
(In reply to Marcus Storre from comment #3)
> I can confirm that this bug occured, when updating from 4.7.1 to 4.7.1a

You are using Java 9?
Comment 5 Marcus Storre CLA 2017-10-16 08:25:09 EDT
Using Java 8u144
Comment 6 Dominique Gibeau CLA 2017-10-17 10:59:45 EDT
Got the same problem in one of my PHP projects right after updating to 4.7.1a. Reverted to 4.7.1 and it's working again.
Comment 7 Sarika Sinha CLA 2017-10-18 03:21:07 EDT
As a workaround, you can run the ant file in the "Same JRE as workspace".
It works fine.
Comment 8 Sarika Sinha CLA 2017-10-28 01:35:10 EDT
*** Bug 526539 has been marked as a duplicate of this bug. ***
Comment 9 Sarika Sinha CLA 2017-10-28 01:38:54 EDT
As we have workaround to run in the same JRE.
Comment 10 Sarika Sinha CLA 2017-10-28 01:39:14 EDT
*** Bug 526492 has been marked as a duplicate of this bug. ***
Comment 11 Eclipse Genie CLA 2017-10-30 02:19:47 EDT
New Gerrit change created: https://git.eclipse.org/r/110712
Comment 12 Sarika Sinha CLA 2017-10-30 02:50:31 EDT
Moving to JDT Debug (Launching).
Comment 14 Eclipse Genie CLA 2017-10-31 00:16:33 EDT
New Gerrit change created: https://git.eclipse.org/r/110782
Comment 15 Eclipse Genie CLA 2017-10-31 01:18:11 EDT
Gerrit change https://git.eclipse.org/r/110782 was merged to [R4_7_maintenance].
Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/?id=14f3c86acf31fe752b63f40fc5de3b50270adbbb
Comment 16 Sarika Sinha CLA 2017-11-08 23:04:49 EST
Eclipse SDK
Version: Oxygen.2 (4.7.2)
Build id: M20171108-1700
OS: Windows 7, v.6.1, x86_64 / win32
Comment 17 Sarika Sinha CLA 2017-11-13 22:42:22 EST
*** Bug 527220 has been marked as a duplicate of this bug. ***
Comment 18 Sarika Sinha CLA 2018-01-05 06:02:10 EST
*** Bug 529440 has been marked as a duplicate of this bug. ***
Comment 19 Thomas Jacob CLA 2018-02-09 05:23:48 EST
As an alternative work-around, you can change the project containing the build.xml to a Java project, by adding <nature>org.eclipse.jdt.core.javanature</nature> to the list of <natures> in the .project file, and then restarting Eclipse.