ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Remko Tronçon <>
Subject JAXP & Classloading
Date Fri, 05 Mar 2010 13:11:49 GMT

I have the following task:
  import javax.xml.parsers.SAXParserFactory;

  public class FooTask extends Task {
    public void execute() {
      SAXParserFactory f = SAXParserFactory.newInstance();

and a build file containing the following:
    <taskdef name="foo" classname="FooTask" classpath="."/>

When I run the foo task, I get the following error:
   javax.xml.parsers.FactoryConfigurationError: Provider FooTask not found

However, when I run with "-lib ." everything runs as expected.

This feels like a problem with the classloader not being able to load
the class specified in the string (maybe related to the JUnit problem
in the FAQ perhaps?). What is the best way to solve this problem
elegantly? (i.e. how do I make sure that JAXP finds my class?).

I'm using ant 1.7.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message