pepite/play--pdf — Issue #22: ClassNotFoundException: org.w3c.dom.html2.HTMLDocument
Author: manuelp
Created: 2012-01-02 12:46:54+00:00
State: open

When I try to render a PDF I get the following exception:

```
Oops: CConvertException
An unexpected error occured caused by exception CConvertException: ERROR: An unhandled exception occured: org/w3c/dom/html2/HTMLDocument

play.exceptions.UnexpectedException: Unexpected Error
at play.modules.pdf.RenderPDFTemplate.apply(RenderPDFTemplate.java:102)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:244)
at Invocation.HTTP Request(Play!)
Caused by: org.allcolor.yahp.converter.IHtmlToPdfTransformer$CConvertException: ERROR: An unhandled exception occured: org/w3c/dom/html2/HTMLDocument
at org.allcolor.yahp.cl.converter.CHtmlToPdfFlyingSaucerTransformer.transform(CHtmlToPdfFlyingSaucerTransformer.java:809)
at play.modules.pdf.RenderPDFTemplate.renderDoc(RenderPDFTemplate.java:142)
at play.modules.pdf.RenderPDFTemplate.renderPDF(RenderPDFTemplate.java:118)
at play.modules.pdf.RenderPDFTemplate.apply(RenderPDFTemplate.java:100)
... 2 more
Caused by: java.lang.NoClassDefFoundError: org/w3c/dom/html2/HTMLDocument
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.allcolor.xml.parser.CDomHandler.(CDomHandler.java:135)
at org.allcolor.xml.parser.CShaniDomParser.(CShaniDomParser.java:382)
at org.allcolor.yahp.cl.converter.CHtmlToPdfFlyingSaucerTransformer.getCShaniDomParser(CHtmlToPdfFlyingSaucerTransformer.java:439)
at org.allcolor.yahp.cl.converter.CHtmlToPdfFlyingSaucerTransformer.transform(CHtmlToPdfFlyingSaucerTransformer.java:581)
... 5 more
Caused by: java.lang.ClassNotFoundException: org.w3c.dom.html2.HTMLDocument
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 21 more
13:38:18,401 ERROR ~
```

Probably it's the same issue that arised in the closed issues #8 and #9 (caused by the YaHP library?).

I also have some dependencies to render XLS documents:

```
- org.apache.poi -> poi 3.7
- net.sf.jxls -> jxls-core 1.0-RC-2
```

Unfortunately, I'm currently unable to generate PDF documents.