Eclipse's Ant can't parse build.xml with sun-java6

Bug #96423 reported by Franck
10
Affects Status Importance Assigned to Milestone
eclipse (Debian)
Fix Released
Unknown
eclipse (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: eclipse-jdt

Ant version as integrated in Eclipse fails to parse my build.xml file since I upgraded to sun-java6-jdk.

The error message I get is :

Buildfile: /home/franck/devel/eclipse-workspace/axabas/src/build.xml
BUILD FAILED
/home/franck/devel/eclipse-workspace/axabas/src/build.xml:146: The <path> type doesn't support nested text data.
Total time: 490 milliseconds

Here is my build file at line 146 :

146 : <path id="compile.classpath">
                <pathelement location="${barracuda-core.jar}"/>
                <pathelement location="${barracuda-contrib.jar}"/>
            </path>

If I try from command line with ant as provided by the ant package, it works fine and builds my project.
It also works on several other Windows workstations, either with eclipse's ant or commandline ant.

Don't know what other information might be useful...

Franck

Revision history for this message
Franck (alci) wrote :

Setting the xml parser to an up to date xerces version solves the issue. So Eclipse was somehow using a defective xml parser by default...

Revision history for this message
Thomas Smith (tgs-resc) wrote :

How did you change Eclipse's XML parser?

I am having a similar problem, where Eclipse won't import ANT files in the first place, always saying "build.xml is not a valid ant buildfile". I'm wondering if it has the same cause as your problem.

Revision history for this message
Franck Routier (franck-routier) wrote : Re: [Bug 96423] Re: Eclipse's Ant can't parse build.xml with sun-java6

Hi,

I changed the parser by adding xerces.jar in the classpath tab in the
"Run as Ant Build..." window.

Not sure this is the better way, but it did work for me.

Franck

Le vendredi 16 novembre 2007 à 20:06 +0000, Thomas Smith a écrit :
> How did you change Eclipse's XML parser?
>
> I am having a similar problem, where Eclipse won't import ANT files in
> the first place, always saying "build.xml is not a valid ant buildfile".
> I'm wondering if it has the same cause as your problem.
>
--
Franck Routier
Axège Sarl - 23, rue Saint-Simon, 63000 Clermont-Ferrand (FR)
Tél : +33 463 059 540
mèl : <email address hidden>

Revision history for this message
Michael (mnichau) wrote :

Eclipse Version: 3.2.2
Build id: M20070212-1330 ('Ubuntu' version: 3.2.2-3ubuntu3)

I'm having the same problem, i.e. can't create a new project from an existing build.xml

The error is "build.xml is not a valid ant buildfile", but I know it's valid - I tried it with eclipse on fedora.

This really should be fixed.

Franck, could you give some more details, I'm a bit confused...

Where do I take the xerces.jar from...
and where is the "Run as Ant Build..." window? ... It seems that I would first need to successfully create a project from a buildfile to do that ... but that's exactly the problem - I'm not even getting there because of this bug :/

.. so I don't have any "Run as Ant Build..." option.

Thanks in advance :)

Revision history for this message
Paolo Costa (paolinux) wrote :

I found an effective workaround on the Debian bug tracker

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=446438

You need to merge ant.jar and ant-laucher.jar in a single ant.jar file and replace the symlink /usr/lib/eclipse/plugins/org.apache.ant_1.6.5/lib/ant.jar with it.

Here are the steps:

cd /tmp

mkdir ant

cd ant

cp /usr/share/ant/lib/ant.jar /usr/share/ant/lib/ant-launcher.jar .

jar xf ant-laucher.jar

jar uf ant.jar org

cd /usr/lib/eclipse/plugins/org.apache.ant_1.6.5/lib/

sudo cp ant.jar ant.jar.original

sudo mv /tmp/ant/ant.jar .

restart eclipse and now parsing should occur without problems.

Hope it helps
Paolo

Revision history for this message
Franck (alci) wrote :

Another way is simply to add xercesImpl in Eclipse Ant menu :

Window / Preferences...
Ant / Runtime. In Classpath / Ant Home Entries, add /usr/share/java/xercesImp.jar

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. You reported this bug a while ago and there hasn't been any activity in it recently. We were wondering is this still an issue for you? Can you try with latest Ubuntu release? Thanks in advance.

Changed in eclipse:
status: New → Incomplete
Changed in eclipse:
status: Unknown → New
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to "New". Thanks again!

Changed in eclipse:
status: Incomplete → Invalid
Changed in eclipse (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.