Hi,

I have the following task:
  import org.apache.tools.ant.Task;
  import javax.xml.parsers.SAXParserFactory;

  public class FooTask extends Task {
    public void execute() {
      System.setProperty("javax.xml.parsers.SAXParserFactory",
getClass().getCanonicalName());
      SAXParserFactory f = SAXParserFactory.newInstance();
    }
  }

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

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.

thanks,
Remko

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org

Reply via email to