Problem with cfdocument pdf's - error - java.lang.NoClassDefFoundError - Could not initialize class sun.awt.windows.WToolkit

389 views
Skip to first unread message

Michael Bragg

unread,
Dec 2, 2013, 1:30:21 PM12/2/13
to ra...@googlegroups.com
All,

I've been looking for an answer to this problem for a few days. Running Railo 4 using Tomcat on Windows 8 as a development environment. I get the following error when attempting to make a pdf using cfdocument.

Really nothing special about the pdf, just some text. I can manage to safe a file, but it's zero-length and in an invalid pdf format (errors on opening).

It looks to me like I'm missing a Windows class, WToolkit, or Java can't find it.

Has anyone else had a similar problem, can offer a solution?

Much thanks,

- Michael

additional
Struct
Cause
stringjava.lang.NoClassDefFoundError
Detail
string
ErrorCode
string0
Extended_Info
string
ExtendedInfo
string
Message
stringCould not initialize class sun.awt.windows.WToolkit
StackTrace
stringCould not initialize class sun.awt.windows.WToolkit at java.lang.Class.forName0(Native Method):-2 at java.lang.Class.forName(Unknown Source):-1 at java.awt.Toolkit$2.run(Unknown Source):-1 at java.security.AccessController.doPrivileged(Native Method):-2 at java.awt.Toolkit.getDefaultToolkit(Unknown Source):-1 at org.zefer.font.c.<init>(Unknown Source):-1 at org.zefer.cache.ResourceCache.getFontMetrics(Unknown Source):-1 at org.zefer.html.doc.m.ø00000(Unknown Source):-1 at org.zefer.html.doc.r.<init>(Unknown Source):-1 at org.zefer.html.doc.PD4MLHtmlParser.buildDocument(Unknown Source):-1 at org.zefer.pd4ml.PD4ML.super(Unknown Source):-1 at org.zefer.pd4ml.PD4ML.render(Unknown Source):-1 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method):-2 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source):-1 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source):-1 at java.lang.reflect.Method.invoke(Unknown Source):-1 at railo.commons.pdf.PDF.invoke(PDF.java:160):160 at railo.commons.pdf.PDF.render(PDF.java:127):127 at railo.commons.pdf.PDFDocument.content(PDFDocument.java:397):397 at railo.commons.pdf.PDFDocument.render(PDFDocument.java:307):307 at railo.runtime.tag.Document.render(Document.java:627):627 at railo.runtime.tag.Document._doEndTag(Document.java:531):531 at railo.runtime.tag.Document.doEndTag(Document.java:485):485 at ad_import.includes.test_cfm$cf.call(C:\railo\tomcat\webapps\ROOT\ad_import\includes\test.cfm:1):1 at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:834):834 at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:786):786 at railo.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:206):206 at railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:18):18 at railo.runtime.PageContextImpl.execute(PageContextImpl.java:2167):2167 at railo.runtime.PageContextImpl.execute(PageContextImpl.java:2134):2134 at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:335):335 at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:29):29 at javax.servlet.http.HttpServlet.service(HttpServlet.java:728):728 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305):305 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210):210 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222):222 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123):123 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171):171 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99):99 at mod_cfml.core.invoke(core.java:131):131 at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936):936 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118):118 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407):407 at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004):1004 at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589):589 at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310):310 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source):-1 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source):-1 at java.lang.Thread.run(Unknown Source):-1

Adrian Lynch

unread,
Dec 2, 2013, 1:44:42 PM12/2/13
to ra...@googlegroups.com
Do you get a result from:

<cfscript>
x = CreateObject("java", "sun.awt.windows.WToolkit")
dump(x)
</cfscript>

A


--
Did you find this reply useful? Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/railo/8f50fb46-2ad1-4fda-afe8-04b2761c55a3%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Michael Bragg

unread,
Dec 4, 2013, 9:27:17 AM12/4/13
to ra...@googlegroups.com
Hi Adrian - sorry for the delay - on the Win8 laptop, I get an Unsatisfied Link Error :

Catch
additional
Struct
Cause
stringjava.lang.UnsatisfiedLinkError
Detail
string
ErrorCode
string 0
Extended_Info
string
ExtendedInfo
string
Message
stringsun.awt.Win32GraphicsEnvironment.getEUDCFontFile()Ljava/lang/String;
StackTrace
stringsun.awt.Win32GraphicsEnvironment.getEUDCFontFile()Ljava/lang/String; at sun.awt.Win32GraphicsEnvironment.getEUDCFontFile(Native Method):-2 at sun.awt.Win32GraphicsEnvironment.<clinit>(Unknown Source):-1 at sun.awt.windows.WToolkit.<clinit>(Unknown Source):-1 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method):-2 at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source):-1 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source):-1 at java.lang.reflect.Constructor.newInstance(Unknown Source):-1 at railo.runtime.reflection.pairs.ConstructorInstance.invoke(ConstructorInstance.java:34):34 at railo.runtime.reflection.Reflector.callConstructor(Reflector.java:772):772 at railo.runtime.java.JavaObject.init(JavaObject.java:274):274 at railo.runtime.java.JavaObject.init(JavaObject.java:260):260 at railo.runtime.java.JavaObject.getEmbededObject(JavaObject.java:287):287 at railo.runtime.reflection.Reflector._clean(Reflector.java:528):528 at railo.runtime.reflection.Reflector.cleanArgs(Reflector.java:516):516 at railo.runtime.reflection.Reflector.getMethodInstanceEL(Reflector.java:452):452 at railo.runtime.reflection.Reflector.getSetter(Reflector.java:1023):1023 at railo.runtime.tag.TagUtil.setAttributeCollection(TagUtil.java:91):91 at dump_cfm$cf.udfCall(C:\railo\lib\railo-server\context\library\function\dump.cfm:25):25 at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:94):94 at railo.runtime.type.UDFImpl._call(UDFImpl.java:307):307 at railo.runtime.type.UDFImpl.call(UDFImpl.java:211):211 at railo.runtime.functions.system.CFFunction.call(CFFunction.java:73):73 at ad_import.test_cfm$cf.call(C:\railo\tomcat\webapps\ROOT\ad_import\test.cfm:3):3 at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:834):834 at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:786):786 at railo.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:206):206 at railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:18):18 at railo.runtime.PageContextImpl.execute(PageContextImpl.java:2167):2167 at railo.runtime.PageContextImpl.execute(PageContextImpl.java:2134):2134 at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:335):335 at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:29):29 at javax.servlet.http.HttpServlet.service(HttpServlet.java:728):728 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305):305 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210):210 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222):222 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123):123 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171):171 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99):99 at mod_cfml.core.invoke(core.java:131):131 at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936):936 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118):118 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407):407 at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004):1004 at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589):589 at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310):310 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source):-1 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source):-1 at java.lang.Thread.run(Unknown Source):-1


Michael Bragg

unread,
Dec 4, 2013, 9:30:05 AM12/4/13
to ra...@googlegroups.com
On my Win7 PC, I see the object dump you'd expect.

Adrian Lynch

unread,
Dec 4, 2013, 9:36:46 AM12/4/13
to ra...@googlegroups.com
Something to do with the path to the jars?

Their location might be different between 7 and 8.


A


Michael Bragg

unread,
Dec 4, 2013, 9:52:11 AM12/4/13
to ra...@googlegroups.com
Don't mean to be dense, but do you mean the Java jars, or Railo jars? I updated Java a few weeks ago (Version 7 Update 45), ran the "Remove old versions" - didn't find any. These sorts of issues are outside the scope of my experience, so I "go with what works" and resorted to moving to the Win7 box for the document development and testing part of the application.  

I'm curious if anyone on the list is successful with Railo / cfdocument / Win8 / Java 7.45 ?? If so, I'll suppose there is "hope" and spend the additional effort to debug/fix my configuration.

Adrian Lynch

unread,
Dec 4, 2013, 10:01:09 AM12/4/13
to ra...@googlegroups.com
Some of the links in that search talk about library jars not being where they're supposed to, so I'd guess (and it's a big guess) that it's the Railo lib jars.

A


On 4 December 2013 14:52, Michael Bragg <m.bra...@gmail.com> wrote:
Don't mean to be dense, but do you mean the Java jars, or Railo jars? I updated Java a few weeks ago (Version 7 Update 45), ran the "Remove old versions" - didn't find any. These sorts of issues are outside the scope of my experience, so I "go with what works" and resorted to moving to the Win7 box for the document development and testing part of the application.  

I'm curious if anyone on the list is successful with Railo / cfdocument / Win8 / Java 7.45 ?? If so, I'll suppose there is "hope" and spend the additional effort to debug/fix my configuration.

--
Did you find this reply useful? Help the Railo community and add it to the Railo Server wiki at https://github.com/getrailo/railo/wiki
---
You received this message because you are subscribed to the Google Groups "Railo" group.

Michael Bragg

unread,
Dec 11, 2013, 7:01:02 PM12/11/13
to ra...@googlegroups.com
Just thought I'd post the "fix" - uninstall and re-install Railo w/ latest version. I suppose that there was something corrupt with the previous install.


Reply all
Reply to author
Forward
0 new messages