Status: New
Owner: ----
Labels: Type-Defect Priority-High Maintainability

New issue 1016 by erights: Applet broken, perhaps because of new Xerces dependency
http://code.google.com/p/google-caja/issues/detail?id=1016

When I try to use the testbed, I get a

java.lang.NullPointerException
        at 
com.google.caja.parser.html.DomParser.makeDocument(DomParser.java:126)
        at
com.google.caja.opensocial.DefaultGadgetRewriter.parseHtml(DefaultGadgetRewriter.java:182)
        at
com.google.caja.opensocial.DefaultGadgetRewriter.rewriteContent(DefaultGadgetRewriter.java:143)
        at
com.google.caja.opensocial.DefaultGadgetRewriter.rewriteContent(DefaultGadgetRewriter.java:134)
        at
com.google.caja.opensocial.applet.CajaApplet.runCajoler(CajaApplet.java:183)
        at 
com.google.caja.opensocial.applet.CajaApplet.cajole(CajaApplet.java:135)


The NPE occurs on the impl.createDocument(..) call on the last line of
makeDocument(..) below:


public static Document makeDocument(DocumentType doctype, String features) {
    if (features == null) { features = "XML 1.0 Traversal"; }
    DOMImplementation impl;
    try {
      impl = DOMImplementationRegistry.newInstance()
          .getDOMImplementation(features);
    } catch (ClassNotFoundException ex) {
      throw new RuntimeException(
          "Missing DOM implementation.  Is Xerces on the classpath?", ex);
    } catch (IllegalAccessException ex) {
      throw new RuntimeException(
          "Missing DOM implementation.  Is Xerces on the classpath?", ex);
    } catch (InstantiationException ex) {
      throw new RuntimeException(
          "Missing DOM implementation.  Is Xerces on the classpath?", ex);
    }
    return impl.createDocument(null, null, doctype);
  }

getDOMImplementation() is documented as returning null if it doesn't find
anything, but makeDocument() doesn't check for null. From the text of the
other error messages above, I'm guessing we now depend on having Xerces on
our classpath. How does one do so for a browser applet?

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

Reply via email to