[coldbox 3.8.1] event.renderData() breaks on Railo 4.2

We have a Coldbox App which has been running fine for about 6 months on ACF 9 and 10 and Railo 4.1.2 without issue.

Recently deployed the app to Railo 4.2 and we are getting the following error on event.renderData()

return event.renderData(data=response,type='JSON');

Note that the issue is on all event.renderData() calls in the app… not just one instance.

The full error being returned is:

lication Execution ExceptionError Type: java.lang.NoClassDefFoundError : 0

Error Messages: com/lowagie/text/DocumentException

Tag Context:
ID: ??
LINE: 305
Template: /coldbox/system/core/util/Util.cfc
ID: ??
LINE: 578
Template: /coldbox/system/ioc/config/Mapping.cfc
ID: ??
LINE: 249
Template: /coldbox/system/ioc/Injector.cfc
ID: ??
LINE: 137
Template: /coldbox/system/web/services/PluginService.cfc
ID: ??
LINE: 153
Template: /coldbox/system/web/services/PluginService.cfc
ID: ??
LINE: 371
Template: /coldbox/system/web/Controller.cfc
ID: ??
LINE: 250
Template: /coldbox/system/Coldbox.cfc
ID: ??
LINE: 75
Template: /Application.cfc
Framework Snapshot
Current Event: admin:main.dologin
Current Layout: login.cfm (Module: )
Current View: N/A
Bug Date: 07/18/2014 11:21:26 AM
Coldfusion ID: CFID=162ca1d2-3eb6-4a67-b7fa-049627c8ca67 ; CFToken=0 ; JSessionID=6B360061A0160FD82E2FF869A2D158C4_162ca1d2-3eb6-4a67-b7fa-049627c8ca67_0
Template Path : /var/www/sites.membes.com.au/index.cfm
Path Info : /admin/main/dologin/
Host & Server: adia.membes.com.au membes
Query String:
Referrer: Rapid web development with Lucee!
Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36
Remote Address: 127.0.0.1
Form variables:
password: test
remember: false
email: test@test.com
Session Storage:
Cookies:
ckfinder_path: Files:/:1
cfid: 162ca1d2-3eb6-4a67-b7fa-049627c8ca67
jsessionid: 1680BA7724831206C388C2C35C61E22F
cftoken: 0
Stack Trace:

com/lowagie/text/DocumentException
	at java.lang.Class.getDeclaredMethods0(Native Method):-2
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2570):2570
	at java.lang.Class.getMethod0(Class.java:2813):2813
	at java.lang.Class.getMethod(Class.java:1663):1663
	at railo.transformer.library.tag.TagLibTag.hasBodyMethodExists(TagLibTag.java:603):603
	at railo.transformer.bytecode.statement.tag.TagHelper.writeOut(TagHelper.java:190):190
	at railo.transformer.bytecode.statement.tag.TagBase._writeOut(TagBase.java:119):119
	at railo.transformer.bytecode.statement.tag.TagOther._writeOut(TagOther.java:25):25
	at railo.transformer.bytecode.statement.StatementBase.writeOut(StatementBase.java:54):54
	at railo.transformer.bytecode.util.ExpressionUtil.writeOut(ExpressionUtil.java:129):129
	at railo.transformer.bytecode.BodyBase.writeOut(BodyBase.java:170):170
	at railo.transformer.bytecode.statement.tag.TagIf.__writeOut(TagIf.java:68):68
	at railo.transformer.bytecode.statement.tag.TagIf._writeOut(TagIf.java:59):59
	at railo.transformer.bytecode.statement.StatementBase.writeOut(StatementBase.java:54):54
	at railo.transformer.bytecode.util.ExpressionUtil.writeOut(ExpressionUtil.java:129):129
	at railo.transformer.bytecode.BodyBase.writeOut(BodyBase.java:170):170
	at railo.transformer.bytecode.BodyBase.writeOut(BodyBase.java:122):122
	at railo.transformer.bytecode.statement.tag.TagSwitch.addCase(TagSwitch.java:108):108
	at railo.transformer.bytecode.statement.tag.TagSwitch._writeOut(TagSwitch.java:65):65
	at railo.transformer.bytecode.statement.StatementBase.writeOut(StatementBase.java:54):54
	at railo.transformer.bytecode.util.ExpressionUtil.writeOut(ExpressionUtil.java:129):129
	at railo.transformer.bytecode.BodyBase.writeOut(BodyBase.java:170):170
	at railo.transformer.bytecode.BodyBase.writeOut(BodyBase.java:122):122
	at railo.transformer.bytecode.BodyBase._writeOut(BodyBase.java:115):115
	at railo.transformer.bytecode.statement.StatementBase.writeOut(StatementBase.java:54):54
	at railo.transformer.bytecode.statement.NativeSwitch._writeOut(NativeSwitch.java:55):55
	at railo.transformer.bytecode.Page.writeOutUdfCallInner(Page.java:781):781
	at railo.transformer.bytecode.Page.execute(Page.java:590):590
	at railo.runtime.compiler.CFMLCompilerImpl.compile(CFMLCompilerImpl.java:58):58
	at railo.runtime.PageSourceImpl._compile(PageSourceImpl.java:309):309
	at railo.runtime.PageSourceImpl.compile(PageSourceImpl.java:283):283
	at railo.runtime.PageSourceImpl.loadPhysical(PageSourceImpl.java:242):242
	at railo.runtime.PageSourceImpl.loadPage(PageSourceImpl.java:166):166
	at railo.runtime.PageSourceImpl.loadPage(PageSourceImpl.java:858):858
	at railo.runtime.component.ComponentLoader.load(ComponentLoader.java:235):235
	at railo.runtime.component.ComponentLoader.loadComponent(ComponentLoader.java:41):41
	at railo.runtime.PageContextImpl.loadComponent(PageContextImpl.java:2893):2893
	at railo.runtime.functions.other.CreateObject.doComponent(CreateObject.java:210):210
	at railo.runtime.functions.other.GetComponentMetaData.call(GetComponentMetaData.java:33):33
	at coldbox.system.core.util.util_cfc$cf.udfCall2(/coldbox/system/core/util/Util.cfc:305):305
	at coldbox.system.core.util.util_cfc$cf.udfCall(/coldbox/system/core/util/Util.cfc):-1
	at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:92):92
	at railo.runtime.type.UDFImpl._call(UDFImpl.java:306):306
	at railo.runtime.type.UDFImpl.call(UDFImpl.java:207):207
	at railo.runtime.ComponentImpl._call(ComponentImpl.java:623):623
	at railo.runtime.ComponentImpl._call(ComponentImpl.java:506):506
	at railo.runtime.ComponentImpl.call(ComponentImpl.java:1738):1738
	at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:724):724
	at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1554):1554
	at coldbox.system.ioc.config.mapping_cfc$cf.udfCall6(/coldbox/system/ioc/config/Mapping.cfc:578):578
	at coldbox.system.ioc.config.mapping_cfc$cf.udfCall(/coldbox/system/ioc/config/Mapping.cfc):-1
	at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:92):92
	at railo.runtime.type.UDFImpl._call(UDFImpl.java:306):306
	at railo.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:194):194
	at railo.runtime.ComponentImpl._call(ComponentImpl.java:624):624
	at railo.runtime.ComponentImpl._call(ComponentImpl.java:506):506
	at railo.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:1755):1755
	at railo.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:755):755
	at railo.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1564):1564
	at coldbox.system.ioc.injector_cfc$cf.udfCall1(/coldbox/system/ioc/Injector.cfc:249):249
	at coldbox.system.ioc.injector_cfc$cf.udfCall(/coldbox/system/ioc/Injector.cfc):-1
	at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:92):92
	at railo.runtime.type.UDFImpl._call(UDFImpl.java:306):306
	at railo.runtime.type.UDFImpl.call(UDFImpl.java:207):207
	at railo.runtime.ComponentImpl._call(ComponentImpl.java:623):623
	at railo.runtime.ComponentImpl._call(ComponentImpl.java:506):506
	at railo.runtime.ComponentImpl.call(ComponentImpl.java:1738):1738
	at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:724):724
	at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1554):1554
	at coldbox.system.web.services.pluginservice_cfc$cf.udfCall1(/coldbox/system/web/services/PluginService.cfc:137):137
	at coldbox.system.web.services.pluginservice_cfc$cf.udfCall(/coldbox/system/web/services/PluginService.cfc):-1
	at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:92):92
	at railo.runtime.type.UDFImpl._call(UDFImpl.java:306):306
	at railo.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:194):194
	at railo.runtime.type.scope.UndefinedImpl.callWithNamedValues(UndefinedImpl.java:757):757
	at railo.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:755):755
	at railo.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:1564):1564
	at coldbox.system.web.services.pluginservice_cfc$cf.udfCall1(/coldbox/system/web/services/PluginService.cfc:153):153
	at coldbox.system.web.services.pluginservice_cfc$cf.udfCall(/coldbox/system/web/services/PluginService.cfc):-1
	at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:92):92
	at railo.runtime.type.UDFImpl._call(UDFImpl.java:306):306
	at railo.runtime.type.UDFImpl.call(UDFImpl.java:207):207
	at railo.runtime.ComponentImpl._call(ComponentImpl.java:623):623
	at railo.runtime.ComponentImpl._call(ComponentImpl.java:506):506
	at railo.runtime.ComponentImpl.call(ComponentImpl.java:1738):1738
	at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:724):724
	at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1554):1554
	at coldbox.system.web.controller_cfc$cf.udfCall5(/coldbox/system/web/Controller.cfc:371):371
	at coldbox.system.web.controller_cfc$cf.udfCall(/coldbox/system/web/Controller.cfc):-1
	at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:92):92
	at railo.runtime.type.UDFImpl._call(UDFImpl.java:306):306
	at railo.runtime.type.UDFImpl.call(UDFImpl.java:207):207
	at railo.runtime.ComponentImpl._call(ComponentImpl.java:623):623
	at railo.runtime.ComponentImpl._call(ComponentImpl.java:506):506
	at railo.runtime.ComponentImpl.call(ComponentImpl.java:1738):1738
	at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:724):724
	at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1554):1554
	at coldbox.system.coldbox_cfc$cf.udfCall1(/coldbox/system/Coldbox.cfc:250):250
	at coldbox.system.coldbox_cfc$cf.udfCall(/coldbox/system/Coldbox.cfc):-1
	at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:92):92
	at railo.runtime.type.UDFImpl._call(UDFImpl.java:306):306
	at railo.runtime.type.UDFImpl.call(UDFImpl.java:207):207
	at railo.runtime.ComponentImpl._call(ComponentImpl.java:623):623
	at railo.runtime.ComponentImpl._call(ComponentImpl.java:506):506
	at railo.runtime.ComponentImpl.call(ComponentImpl.java:1738):1738
	at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:724):724
	at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1554):1554
	at application_cfc$cf.udfCall(/Application.cfc:75):75
	at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:92):92
	at railo.runtime.type.UDFImpl._call(UDFImpl.java:306):306
	at railo.runtime.type.UDFImpl.call(UDFImpl.java:207):207
	at railo.runtime.ComponentImpl._call(ComponentImpl.java:623):623
	at railo.runtime.ComponentImpl._call(ComponentImpl.java:506):506
	at railo.runtime.ComponentImpl.call(ComponentImpl.java:1738):1738
	at railo.runtime.listener.ModernAppListener.call(ModernAppListener.java:388):388
	at railo.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:114):114
	at railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:18):18
	at railo.runtime.PageContextImpl.execute(PageContextImpl.java:2218):2218
	at railo.runtime.PageContextImpl.execute(PageContextImpl.java:2185):2185
	at railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:332):332
	at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:29):29
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727):727
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303):303
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208):208
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52):52
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241):241
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208):208
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220):220
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122):122
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501):501
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171):171
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102):102
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116):116
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408):408
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040):1040
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607):607
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314):314
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145):1145
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615):615
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61):61
	at java.lang.Thread.run(Thread.java:745):745

Line 305 of …/core/util/Util.cfc is

I’ve been looking for possible answers for hours, but can’t find anything relating to this.

Has anyone else being able to succesfully run event.renderData() on Railo 4.2?

Many Thanks

Jason

Funny you mention this. I just ran into this a few days ago with a client. The error is happening when Railo tries to compile the cfdocument tag inside the utilities.cfm plugin. Java either can’t find the classes used for PDF generation, or there is a conflict with multiple jars in your classpath that contain the same class. The person I was talking to just commented out the cfdocument tag since they weren’t using any PDF rendering and the error went away but I never followed up to see if they tracked down the actual issue with the Java classes. Did you just update Railo, Tomcat, or anything else on your server that might have included the itext libraries? My Railo install defines the com/lowagie/text/DocumentException class in the lowagie.itext.jar file.

I’ll check with that person and see what conclusion they came to on their server. In their case, it was a new CentOS server, I believe using Open JDK.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Thanks Brad… to be honest, I’m a bit relieved someone else is experiencing similar issue…I just haven’t been able to find anything.

In my case I am trying to render JSON, but my guess is the issue is related. Wasn’t an upgrade… a fresh install on a new server… A Ubuntu on Rackspace /

I’ll take a look in my Railo install a bit later to see if I have those files also.

Thanks!

I may stretching the limits of my abilities here, so apologies if I am asking silly questions…

I found lowagie.itext.jar in railo/lib. How do I find out if it defines the com/lowagie/text/DocumentException.

Would it be worth trying to just copy this file from my 4.1.2 Railo install into the 4.2 install? Or am I being a bit too simplistic?

Thanks again!

Also, I just noticed that lowagie.itext.jar is in railo/lib/ext on 4.1.2 and railo/lib in 4.2… Could this be causing the issue?

You can view the contents of a jar file, but making a copy, renaming it to a zip extension and then just unzipping it. The class paths are defined by the folders relative to the root. There is also a manifest usually (in web-inf I think) that will give you a version number. If you have that file, I’m pretty sure it’s the same as the one on my PC that does contain those classes. The question is whether they are binary compat with what Railo is looking for, or if another jar somewhere else in the classpath also has the same class in it. There are multiple lib folders that can be part of the classpath. It is possible to get the name of the jar file form a loaded class, however I don’t know of any way to scan all the jars in the classpath for a particular class.

Can you tell me what JDK you’re using? I pinged the person I was talking to last week to see what solution they found, if any. Also, it might be useful if you put a cfdocument tag in a standalone test .cfm page to ensure it gets the same error. If so, we can probably take this to the Railo list, but it will help to confirm that you get the error outside of ColdBox just to make sure there’s no conflict there.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Hi Brad, you are spot on. I’ve ran a <cfdocument test, and get the same error… can be viewed here: http://adia.membes.com.au/public/cfdocumenttest.cfm

I’ll work my way through your your how-to on viewing the .jar contents and see what I find.

Thanks for your skilled guidance on this… no way I could have got this far without it… appreciated!

Have posted to Railo Group: Google Groups

Brad, I got the following from /top/railo/jdk/jre/release

JAVA_VERSION="1.7.0" OS_NAME="Linux" OS_VERSION="2.6" OS_ARCH="amd64" SOURCE=" .:f0cdb08a4624 corba:80f65a8f5850 deploy:2b1995e2c8f5 hotspot:12374864c655 hotspot/make/closed:2c0b7ecdd92d ho$ BUILD_TYPE=commercial

Interestingly, if I run "java -version, I get the following rather than the version number

`
The program ‘java’ can be found in the following packages:

  • default-jre
  • gcj-4.8-jre-headless
  • openjdk-7-jre-headless
  • gcj-4.6-jre-headless
  • openjdk-6-jre-headless
    Try: apt-get install
    `

I have no idea if this is an issue, but I would have expected a version number . hmm

java -version shows what’s installed on the OS, but not necessarily what JRE Railo is actually using. Dump out the server scope, or look on the main server admin page under “java” and you will get the version AND vendor information. Ex:

Java
1.6.0_29 (Sun Microsystems Inc.) 32bit

If you are using Open JDK that would be the same as the other person and I would be interested to see you install the Oracle JDK and test.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Here is what it is showing me in Server Admin:

Configuration File /opt/railo/lib/railo-server/context/railo-server.xml
OS Linux (3.13.0-30-generic) 64bit
Remote IP 58.6.224.32
Host Name site.membes.com.au
Servlet Container Apache Tomcat/7.0.54
Railo Server ID 8968a6b756ed5a83008c5b1268a5e69d
Java 1.7.0_60 (Oracle Corporation) 64bit
Architecture 64bit
Classpath

/opt/railo/tomcat/bin/tomcat-juli.jar
/opt/railo/tomcat/lib/railo-inst.jar
/opt/railo/tomcat/bin/bootstrap.jar

Hi guys,

We sort of did a hack to resolve this issue by commenting out the PDF case of the marshallData function in Util.cfc. We don’t usually modify the core but in the interest of time we did as out app wasn’t using PDF’s. Our intention is to install the Oracle JDK as our assumption is that OpenJDK is causing the issue. If you go this route I would be interested to know if it worked but in the interim you should be able to resolve by commenting out that code.

Nolan

Thanks Nolan, I will give commenting out the PDF case in marshalData a crack as an interim.

How do I know if I am currently running Oracle JDK or Open JDK? The Java version displayed in Railo Admin is “1.7.0_60 (Oracle Corporation) 64bit”… does that mean I am running Oracle JDK? If not, how do I find that out?

Thanks!

Just found this… Google Groups

Looks like a problem with Railo 4.2 installer… apparently patch available, but I couldn’t find.

In case you guys didn’t see, there was a reply on Jason’s Railo thread that pointed to another Railo thread (I’m not sure how I missed in my Googling) that claims the latest installers are fixed and there was just a corrupted jar.
https://groups.google.com/forum/#!topic/railo/P6QW5xKkWm8

"Patched installers (railo-4.2.1.000-pl2) are now available at
http://railo.viviotech.net/. Updated installers will be available on the
getrailo.org site as soon as they finish uploading. " – Jordan Michaels on July 9th

I would recommend ensuring you download the latest installer, and reinstall. If that doesn’t fix it, please post on that thread in the Railo list and let them know the installers are still broken.

Note, “ckindle” also gave the following work around in the thread:

“I could solve the problem by copying the file /opt/railo/lib/lowagie.itext.jar from a former railo installation to the new version.”

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Not sure how I missed it either Brad… probably because I thought it was a JSON problem.

I just copied lowagie.itext.jar from a Railo 4.1.2 install and problem fixed!

Jason