Bug 838711
Summary: | ant builds are failing with Unexpected element "{}HTML" {antlib:org.apache.tools.ant}HTML | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Orion Poplawski <orion> |
Component: | ant | Assignee: | Mikolaj Izdebski <mizdebsk> |
Status: | CLOSED NEXTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 17 | CC: | akurtako, java-sig-commits, jcapik, kdaniel, mizdebsk, mmatejov, msrb, tradej |
Target Milestone: | --- | Keywords: | Triaged |
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | 1.9.1-3 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2013-07-02 10:03:54 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Orion Poplawski
2012-07-09 22:04:13 UTC
Ahh, starting to see this in F17 now. ant did not change though, so perhaps it's something else. Actually, it stills builds find in F17 mock, but on my F17 box it fails. I'm starting to suspect some other package influencing it. The F18 builds bring in a lot more dependencies. But rawhide builds are also pretty unstable for me too in other ways so hard to test. Orion, is this still true on Fedora 18? I do still see this when I build locally on my F18 machine. koji/mock builds seem okay. Successfully reproduced on Fedora 18. $ rpm -q ant ant-1.8.4-5.fc18.noarch $ cat build.xml <project default="run"> <target name="run"> <java classname="org.apache.tools.ant.launch.Launcher" fork="true" failonerror="true" dir="sub"> <classpath> <pathelement path="${java.class.path}"/> </classpath> </java> </target> </project> $ cat sub/build.xml <project/> $ ant Buildfile: /tmp/rep/build.xml run: [java] Buildfile: /tmp/rep/sub/build.xml [java] [java] BUILD FAILED [java] /tmp/rep/sub/build.xml:1: Unexpected element "{}HTML" {antlib:org.apache.tools.ant}HTML [java] [java] Total time: 0 seconds BUILD FAILED /tmp/rep/build.xml:4: Java returned: 1 Total time: 1 second Reproduced in Rawhide too. Even simpler reproducer can be used: $ cat build.xml <project/> $ java -cp /usr/share/java/ant-launcher.jar org.apache.tools.ant.launch.Launcher Buildfile: /tmp/build.xml BUILD FAILED /tmp/build.xml:1: Unexpected element "{}HTML" {antlib:org.apache.tools.ant}HTML Total time: 0 seconds Looks like Ant is failing when it uses Xerces SAX parser, but if xerces-j2 package is erased then Ant works fine with OpenJDK internal parser. $ cat build.xml <project/> $ java -Djaxp.debug=1 -cp /usr/share/java/ant-launcher.jar org.apache.tools.ant.launch.Launcher Buildfile: /tmp/build.xml JAXP: find factoryId =javax.xml.parsers.SAXParserFactory JAXP: found jar resource=META-INF/services/javax.xml.parsers.SAXParserFactory using ClassLoader: java.net.URLClassLoader@73a2335d JAXP: found in resource, value=org.apache.xerces.jaxp.SAXParserFactoryImpl JAXP: created new instance of class org.apache.xerces.jaxp.SAXParserFactoryImpl using ClassLoader: java.net.URLClassLoader@73a2335d BUILD FAILED /tmp/build.xml:1: Unexpected element "{}HTML" {antlib:org.apache.tools.ant}HTML Total time: 0 seconds # rpm -e xerces-j2 --nodeps $ java -Djaxp.debug=1 -cp /usr/share/java/ant-launcher.jar org.apache.tools.ant.launch.Launcher Buildfile: /tmp/build.xml JAXP: find factoryId =javax.xml.parsers.SAXParserFactory JAXP: loaded from fallback value: com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl JAXP: created new instance of class com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl using ClassLoader: null BUILD SUCCESSFUL Total time: 0 seconds Fixed in ant-1.9.1-3 I believe that this bug is fixed in ant-1.9.1-3, which is available in Fedora Rawhide, so I am closing this bug now. The build containing the fix can be found at Koji: http://koji.fedoraproject.org/koji/buildinfo?buildID=430789 This bug was fixed in the next release of Fedora, and is not planned to be fixed in the release it was filed against. If you want this bug to be fixed in updates for Fedora 17, please say so in a comment. Otherwise you can update to the newer release of Fedora to get the fix. I think that real problem here is location of the ant{,-launcher}.jar. In all versions prior to 1.9.1-3 the location is /usr/share/java/. And it looks like Ant adds all the JARs from the directory where ant-launcher.jar is located to the classpath: $ cat build.xml </project> $ java -cp /usr/share/java/ant-launcher.jar org.apache.tools.ant.launch.Launcher --launchdiag | grep java.class.path | sed -e 's/:/\n/g'| wc -l BUILD FAILED /home/msrb/bug/ant/build.xml:2: Unexpected element "{}HTML" {antlib:org.apache.tools.ant}HTML Total time: 0 seconds 556 After moving ant{,-launcher}.jar to the subdirectory /usr/share/java/ant/: $ java -cp /usr/share/java/ant/ant-launcher.jar org.apache.tools.ant.launch.Launcher --launchdiag | grep java.class.path | sed -e 's/:/\n/g'|wc -l BUILD FAILED /home/msrb/bug/ant/build.xml:1: The markup in the document preceding the root element must be well-formed. Total time: 0 seconds 22 |