Hi,
I'm developing a (signed) applet that requires access to the local printer. The applet will parse an XML document using [Flying Saucer|http://xhtmlrenderer.dev.java.net/] . I'm developing it in Eclipse.
When I run the applet from Eclipse, everything works fine, and a print is produced by the printer. I then export the applet as a jar file, sign it, and put it on a local server. When I run the applet in any browser (whether its IE or Firefox) the thing crashes with this error:
Exception in thread "AWT-EventQueue-2" javax.xml.parsers.FactoryConfigurationError: Provider <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> not found
This exception seems mangled to me - shouldn't it produce a classname as opposed to the DOCTYPE declaration String?
I've signed all the jars required (Flying Saucer's core-renderer.jar & jtidy.jar), accepted them in the browser. All dependencies should therefore be resolved.
To be sure: I am NOT referencing the DOCTYPE anywhere in the Java code, nor in the HTML source document, nor in the HTML document hosting the applet. In short, I cannot find
any trace of the DOCTYPE given in my source code. Where does it come from?
Here's a stack trace. Hopefully someone has a great tip! :)
Reading certificates from 2718 http://w2668.gerben.mylocalserver/overig/awtprinting/AwtPrinting.jar | C:\Users\jeroen\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\63\7843b8ff-292dbe4c.idx
Reading certificates from 10062 http://w2668.gerben.mylocalserver/overig/awtprinting/jtidy.jar | C:\Users\jeroen\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\20\1e6e98d4-7d7b6963.idx
line 1 column 110 - Warning: inserting missing 'title' element
Reading certificates from 76688 http://w2668.gerben.mylocalserver/overig/awtprinting/core-renderer.jar | C:\Users\jeroen\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\33\62996421-47904dc4.idx
Reading certificates from 53283 http://w2668.gerben.mylocalserver/overig/awtprinting/iText.jar | C:\Users\jeroen\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\4\1a988704-442d6437.idx
Exception in thread "AWT-EventQueue-2" javax.xml.parsers.FactoryConfigurationError: Provider <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> not found
at javax.xml.parsers.SAXParserFactory.newInstance(Unknown Source)
at org.xhtmlrenderer.resource.XMLResource.newXMLReader(XMLResource.java:145)
at org.xhtmlrenderer.resource.XMLResource$XMLResourceBuilder.createXMLResource(XMLResource.java:170)
at org.xhtmlrenderer.resource.XMLResource.load(XMLResource.java:75)
at org.xhtmlrenderer.pdf.ITextRenderer.setDocumentFromString(ITextRenderer.java:157)
at com.mycompanyname.printing.Printable.print(Printable.java:193)
at com.mycompanyname.printing.ClientPrinterApplet.print(ClientPrinterApplet.java:350)
at com.mycompanyname.printing.ClientPrinterApplet.paint(ClientPrinterApplet.java:145)
at sun.awt.RepaintArea.paintComponent(Unknown Source)
at sun.awt.RepaintArea.paint(Unknown Source)
at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)