You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2011/01/28 08:35:50 UTC

DO NOT REPLY [Bug 50678] New: Not reading xercesImpl.jar and xml-apis.jar in Apache ANT 1.8.2

https://issues.apache.org/bugzilla/show_bug.cgi?id=50678

           Summary: Not reading xercesImpl.jar and xml-apis.jar in Apache
                    ANT 1.8.2
           Product: Ant
           Version: 1.8.2
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: Build Process
        AssignedTo: notifications@ant.apache.org
        ReportedBy: ashish.soni@siemens.com


Hi,

I have a problem with xercesImpl.jar and xml-apis.jar api jars. 
I have custom ANT Task that is using above mentioned api jars, when i giving it
on classpath of task "JDOM" its not picked by the Apache ANT 1.8.2.

<taskdef name="JDOM" classname="TestJDOM">
 <classpath>
  <pathelement location="${basedir}"/>
  <pathelement location="D:/apache-ant-1.8.1/sample/lib/jdom/build/jdom.jar"/>
  <pathelement
location="D:/apache-ant-1.8.1/sample/lib/xerces/xercesImpl.jar"/>
  <pathelement location="D:/apache-ant-1.8.1/sample/lib/xerces/xml-apis.jar"/>
 </classpath>
</taskdef>

Why the above step is not working

but it will work if i will give this lib jars in ant command prompt like:
ant -lib D:/apache-ant-1.8.1/sample/lib/xerces/xercesImpl.jar -lib
D:/apache-ant-1.8.1/sample/lib/xerces/xml-apis.jar -f <buildFileName>
<targetName>

and remove the jars from classpath of taskdef.

Even i varified that both jars a available in classpath.

Thanks in advance
Ashish Soni

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 50678] Not reading xercesImpl.jar and xml-apis.jar in Apache ANT 1.8.2

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50678

--- Comment #1 from Stefan Bodewig <bo...@apache.org> 2011-01-30 02:07:56 EST ---
*** Bug 50658 has been marked as a duplicate of this bug. ***

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 50678] Not reading xercesImpl.jar and xml-apis.jar in Apache ANT 1.8.2

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50678

--- Comment #4 from Antoine Levy-Lambert <an...@apache.org> 2011-01-31 16:28:04 EST ---
Ant's classloaders used by <taskdef/> are not able to add to the startup
classpath of Ant or of the JVM, and this limitation is a problem in the case of
some JVM factories which do not see children classloaders.

You can use the classloader task documented at
http://enitsys.sourceforge.net/ant-classloadertask/usage.html to add jars (for
instance xercesImpl and xml-apis) to the appropriate classloader.

I am maintaining a build file where we need to put a number of jars on a
classloader above the taskdefs classloader. Here is how I do it with the
enitsys classloader task :

    <classloadertask classpathRef="all.https.cp" loader="thread"/>


I use this task also to put mail.jar/activation.jar on the classpath when I
need to send email from a build file using the functionality supplied by these.

I am tempted to close your bug report as WONTFIX but it is one more indication
that there are lots of usages in the field for this <classloadertask/> so we
should integrate it in Ant if it is technically and procedurally acceptable for
the project.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 50678] Not reading xercesImpl.jar and xml-apis.jar in Apache ANT 1.8.2

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50678

--- Comment #3 from Stefan Bodewig <bo...@apache.org> 2011-01-30 02:17:22 EST ---
The JDOM task is not developed by the Ant developers so we can only guess.

You used to get Xerces as your default SAX parser factory while you now have
the JDK's parser factory as a default.  If your task (I assume you've
written it yourself) really only works when Xerces is used you have to make
sure it either explicitly asks for it or Xerces will be used by the JDK.  The
former can be done by using SAXParserFactory#newInstance with two
argiments and the later by using the endorsed standards override
mechanism of the JDK.

This really is more a user mailing list question rather than a blocking
Ant bug, BTW.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 50678] Not reading xercesImpl.jar and xml-apis.jar in Apache ANT 1.8.2

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50678

Antoine Levy-Lambert <an...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #5 from Antoine Levy-Lambert <an...@apache.org> ---
As you found out yourself, you can put the versions of xercesImpl and xml-apis
that you need on the classpath yourself.

There is a need to offer functionality in Ant to add jars to the coreloader at
runtime. I am personally using the classloader task from enitsys in some build
files at work, for instance I use that to add mail.jar and activation.jar to
the classpath of Ant when I want to use the mail task, since I do not want to
add mail.jar and activation.jar under $ANT_HOME/lib.

There is an undocumented classloader task inside Ant since 2002, I wonder how
easily it can be used in this kind of use case.

I will discuss these issues further on the dev mailing list.

-- 
You are receiving this mail because:
You are the assignee for the bug.

DO NOT REPLY [Bug 50678] Not reading xercesImpl.jar and xml-apis.jar in Apache ANT 1.8.2

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50678

--- Comment #2 from Stefan Bodewig <bo...@apache.org> 2011-01-30 02:10:12 EST ---
relevant information from bug 50652

[JDOM] START
     [JDOM] Could not load org.apache.xerces.parsers.SAXParser: SAX2 driver
class org.apache.xerces.parsers.SAXParser not foun

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.