cfcdynamicproxy outside javaloader in Railo

41 views
Skip to first unread message

Chris Coppenbarger

unread,
Dec 5, 2014, 2:53:22 PM12/5/14
to javaloa...@googlegroups.com
Maybe this is a new one, but I can't figure out what's going on necessarily from the stack trace.
This is modified code from an example, I think from cfSearching...

Anyways, using itext 5.0 with the jar in both my Railo Lib and Web_INFO folders.

the CFCDynamicProxy jar is also in both places.

Railo restarted a couple of times.

It seems that stuff is loaded until it gets to "createInstance"



//initialize the building blocks used by the custom page handler
    textColor
= CreateObject("java","java.awt.Color").decode( "##800040" );
   
BaseFont = CreateObject("java","com.itextpdf.text.pdf.BaseFont");
    textFont
= BaseFont.createFont(BaseFont.COURIER, BaseFont.WINANSI, BaseFont.EMBEDDED);

   
//intialize the page event handler component
    eventHandler
= CreateObject("component", "PdfPageEventHandler").init( font=textFont, fontSize=8, textColor=textColor);
    eventHandler
.setFooterText( "** i.dream.of.cfcDynamicProxy **  " );

   
//we can pass in an array of strings which name all the interfaces we want out dynamic proxy to implement
    interfaces
= ["com.itextpdf.text.pdf.PdfPageEvent"];

   
//get a reference to the dynamic proxy class
   
CFCDynamicProxy = CreateObject("java","com.compoundtheory.coldfusion.cfc.CFCDynamicProxy");

   
// create a proxy that we will pass to the iText writer
    eventHandlerProxy
= CFCDynamicProxy.createInstance(eventHandler, interfaces);



Stack trace:

Railo 4.2.1.000 Error (java.lang.NoClassDefFoundError)
Message coldfusion/runtime/TemplateProxy$InvalidMethodNameException
Cause java.lang.NoClassDefFoundError
Stacktrace The Error Occurred in
/shop/Checkout/pdfDownload.cfm: line 138
136:
137: // create a proxy that we will pass to the iText writer
138: eventHandlerProxy = CFCDynamicProxy.createInstance(eventHandler, interfaces);
139:
140: ///////////////////////////////////////////

Java Stacktrace coldfusion/runtime/TemplateProxy$InvalidMethodNameException
  at java.net.URLClassLoader$1.run(URLClassLoader.java:366):366
  at java.net.URLClassLoader$1.run(URLClassLoader.java:355):355
  at java.security.AccessController.doPrivileged(Native Method):-2
  at java.net.URLClassLoader.findClass(URLClassLoader.java:354):354
  at java.lang.ClassLoader.loadClass(ClassLoader.java:425):425
  at java.lang.ClassLoader.loadClass(ClassLoader.java:358):358
  at java.lang.Class.getDeclaredMethods0(Native Method):-2
  at java.lang.Class.privateGetDeclaredMethods(Class.java:2570):2570
  at java.lang.Class.privateGetPublicMethods(Class.java:2690):2690
  at java.lang.Class.getMethods(Class.java:1467):1467
  at railo.runtime.reflection.storage.WeakMethodStorage.store(WeakMethodStorage.java:49):49
  at railo.runtime.reflection.storage.WeakMethodStorage.getMethods(WeakMethodStorage.java:32):32
  at railo.runtime.reflection.Reflector.getMethodInstanceEL(Reflector.java:473):473
  at railo.runtime.reflection.Reflector.getMethodInstance(Reflector.java:662):662
  at railo.runtime.java.JavaObject.call(JavaObject.java:213):213
  at railo.runtime.java.JavaObject.call(JavaObject.java:238):238
  at railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:724):724
  at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:1554):1554
  at shop.checkout.pdfdownload_cfm$cf.call(/shop/Checkout/pdfDownload.cfm:138):138
  at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:913):913
  at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:865):865
  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: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.valves.RemoteIpValve.invoke(RemoteIpValve.java:683):683
  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
 


Reply all
Reply to author
Forward
0 new messages