[Open Office] The dreaded HelpLinker NullPointerException and how to fix it

Bernhard Rosenkraenzer bero at arklinux.org
Sun Feb 26 16:25:35 EST 2006


On Sunday, 26. February 2006 21:51, Caolan McNamara wrote:
> > I guess the right workaround for now is to force HelpLinker to use an
> > org.apache.xerces.jaxp.SAXParserFactoryImpl as opposed to a
> > gnu.xml.stream.SAXParserFactory -- any objections to this?
>
> Hmm, I wonder if that's the sort of thing that the "alternatives" setup
> on fedora addresses, i.e.

Yes, that seems to be what it does -- seems to be a set of wrappers that 
define the properties.

If we add 
-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl
to the command line building, it does the same thing for everyone, including 
ppl without the alternatives script (or with a messed setup thereof).

Creating a $JAVA_HOME/lib/jaxp.properties saying
javax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl
would have the same effect too (but we shouldn't touch the running system from 
the makefiles).

After fixing this, it still breaks a bit later here though:

ERROR: XmlDocument.createXmlDocument() failed for 
'../../unxlngi6.pro/misc/en-US/text/shared/guide/space_hyphen.xhp': 
NOT_SUPPORTED_ERR: The implementation does not support the requested type of 
object or operation

But that's again caused by classpath defaulting to an implementation with 
fewer functionalities than Xerces -- using Xerces wherever possible fixes 
that too:

-Djavax.xml.datatype.DatatypeFactory=org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl
-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl
-Djavax.xml.validation.SchemaFactory=org.apache.xerces.jaxp.validation.XMLSchemaFactory
-Dorg.w3c.dom.DOMImplementationSourceList=org.apache.xerces.dom.DOMXSImplementationSourceImpl
-Dorg.xml.sax.driver=org.apache.xerces.parsers.SAXParser

I guess we should just hardcode all of them, our build process requires xerces 
anyway, so there's no need to use something else for its job -- I don't think 
this can hurt.
My build with all of them set has progressed way past the HelpLinker 
invocation now.


More information about the Openoffice mailing list