Re: classloader issue with xercesImpl

Guillaume Sauthier <[email protected]> Tue, 15 Feb 2011 09:35:14 +0100
Newsgroups gmane.comp.java.objectweb.jonas
Organization Objectweb Consortium
Message-ID <[email protected]>

Le 14/02/2011 19:05, [email protected] a écrit :
> Hi all,
> I'm working on a migration from websphere to Jonas 5.1.6+JDK 1.6. For some
> reason, this application is doing :
> Class parserClass =  Class.forName("org.apache.xerces.parsers.DOMParser");
>
> Runing this code gives me the following exception:
> java.lang.ClassNotFoundException: org.apache.xerces.parsers.DOMParser
>
> I wonder how this is possible, because xercesImpl-2.9.1.jar is in
> $JONAS_ROOT/lib/endorsed, so I was expecting that the included DOMParser class
> should be available everywhere.
>    

This is no more true with OSGi, there is no global type visibility 
(endorsed or not)...
If you want this type to be visible to applications, you have to change 
the list of system exported packages (See extra system package property 
in conf/osgi/gateway.properties).

--G

> I have this error with java2-delegation-model set to true or false.
>
> I also tried to include xercesImpl-2.9.1.jar in my WEB-INF/lib war folder. This
> solves the previous error, but prevents jonas to compile jsps, giving me this
> error :
> java.lang.ClassCastException:
> org.apache.xerces.parsers.XIncludeAwareParserConfiguration incompatible with
> org.apache.xerces.xni.parser.XMLParserConfiguration.
>
> How should I solve the ClassNotFoundException mentionned ?
>
> Regards,
> Bernard
>
>
>
Guillaume_Sauthier.vcf (text/x-vcard, 387 B)
begin:vcard
fn:Guillaume Sauthier
n:Sauthier;Guillaume
org:<a href="http://www.ow2.org"><img title="OW2" alt="OW2 Consortium" border="0" src="http://www.ow2.org/xwiki/bin/skin/XWiki/DefaultSkin/logoOW2.png" /></a>
adr:;;;;;;France
email;internet:[email protected]
title:<a href="http://jonas.ow2.org">JOnAS Application Server</a>
url:http://jonas.ow2.org
version:2.1
end:vcard