|
From: Aaron D. <Aar...@gl...> - 2006-10-11 11:30:34
|
Hello,
I'm trying to port StatCVS to maven2 and had some success ... well, if I invoke
StatCVS as a subprocess.
Now, I'm stuck while invoking StatCVS from Java. When I try, I get this error:
saxFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
...
Caused by: javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerc
es.jaxp.SAXParserFactoryImpl could not be instantiated: java.lang.NullPointerExc
eption
at javax.xml.parsers.SAXParserFactory.newInstance(Unknown Source)
at de.berlios.statcvs.xml.output.HTMLRenderer.create(HTMLRenderer.java:98)
Ok, what happens is this:
SAXParserFactory x = new org.apache.xerces.jaxp.SAXParserFactoryImpl();
System.out.println("saxFactory="+x.getClass().getName());
x = SAXParserFactory.newInstance(); // <-- This is line 98
System.out.println("saxFactory="+x.getClass().getName());
So basically, when I instantiate the SAXParserFactoryImpl directly, it works
which means that Xerces is in the classpath. When I use
javax.xml.parsers.SAXParserFactory.newInstance() (as I should), I get a NPE but
the classname is the same in both cases!
When I run this code within Eclipse, it works. Therefore, I assume that maven
somehow breaks this but I have no idea what could cause this.
Any ideas?
Best Regards,
--
Aaron Digulla
|