Thanks for the reply, Richard.
org.xml.sax is provided by the framework:
org.apache.felix.framework =>
org.xml.sax,version=0.0.0
org.xml.sax.ext,version=0.0.0
org.xml.sax.helpers,version=0.0.0

Probably it would help to include the SAX2 jar in cocoon-sax.
However, I reckon the OSGi-wise better solution would be to set up XMLParsers as an OSGi service.
I will speak to the cocoon group about this endeavour.

Jos

On 06/24/2010 03:25 PM, Richard S. Hall wrote:
On 6/24/10 1:54, Jos Snellings wrote:
Hi,

Is it possible that at the same time your bundle gets perfectly resolved and yet class.forName throws
java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser

I explain in concreto:
- indirectly, a servlet creates an XMLReader (org.apache.cocoon.sax.util.XMLUtils.createXMLReader)

==> this exception is thrown
org.apache.cocoon.pipeline.ProcessingException: Cannot create and prepare an XMLReader. at org.apache.cocoon.sax.util.XMLUtils.createXMLReader(XMLUtils.java:138)
    at org.apache.cocoon.sax.util.XMLUtils.toSax(XMLUtils.java:87)
   ... caused by "ClassNotFoundException"

==> yet, I see that dependencies are adequately resolved for my bundle, even if I create a static access
to it.  No problem to statically declare a saxparser.

I know I should be using ClassLoader.loadClass
but the error comes from 'deeper': the sax library uses forName to load the parser defined
by a system property.

This isn't uncommon, most likely the sax library doesn't have access to the class in question or is using the wrong class loader. Sometimes libraries need the thread context class loader set before calling into them if they assume they can use it to load classes. I'm not sure about this specific case, since I don't use sax.

-> richard


What am I missing?

Thanks,
Jos




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]





---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to