maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron.Digu...@Globus.ch
Subject Antwort: SAXParser problem with Maven 2.0.4, Xalan 2.8.1, Xerces 2.8.0 and Java 1.5
Date Wed, 11 Oct 2006 16:06:51 GMT
Hello,

I made some further progress.

Apparently, the problem is in Sun's SAXParserFactory which stores a 
classloader internally. This classloader is from the Pleistocene (when the 
current VM was still fresh and didn't know about Maven).

So when my plugin comes into play, the classloader used by SAX simply 
doesn't know about any classes loaded by the maven classloader.

*expletive deleted*

Is it possible to create a plugin which uses Xalan 2.8.1 despite the fact 
that maven has its own Xalan in lib/endorsed and with Java 1.5?

Regards,

-- 
Aaron Digulla

Aaron.Digulla@Globus.ch schrieb am 11.10.2006 13:32:47:

> Hello,
> 
> I'm trying to port StatCVS to maven2 and had some success ... well, if I 

> invoke
> StatCVS as a subprocess.
> 
> But I want to invoke StatCVS directly, too. 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)
> 
> The code looks like 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
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Mime
View raw message