CF9 - Issue with method

377 views
Skip to first unread message

webpointz

unread,
Jan 11, 2011, 6:56:25 PM1/11/11
to javaloader-dev
I am using it to separately load a version of iTEXT to create PDF
files for digital signatures. However, moving over to CF9 there is a
problem.

When I run the application on localhost in CF9 it works fine. If I
create an iText object and dump the object it works great and shows
that objects methods.

However it doesn't work on the production CF9 server...I get back an
error that says "Could not find the method 'Constructor' in the class
com.lowagie.text.Rectangle ".

The weird part is that when i dump the variable locally it says
"object of com.lowagie.text.pdf.Rectangle" but the dump on production
says "component ePaymentCom.javaloader.JavaProxy".

The ONLY difference between the two environments is that locally i'm
running CF9 with JVM 1.6.0_14 using Java HotSpot(TM) Server VM, but
the server is running on CF9 with JVM 1.6.0_21 using Java HotSpot(TM)
64-Bit Server VM. Also, the server version is in an INSTANCE. Could
there be some sort of security permissions issue?

Mark Mandel

unread,
Jan 11, 2011, 7:02:19 PM1/11/11
to javaloa...@googlegroups.com
Is production a shared host?

When you say ' Also, the server version is in an INSTANCE.  Could
there be some sort of security permissions issue?' - what does that mean?

What is the full stack/error trace from the error you were getting on production. Can't do much without that.

What version of JavaLoader?

Mark
--
E: mark....@gmail.com
T: http://www.twitter.com/neurotic
W: www.compoundtheory.com

cf.Objective(ANZ) - Nov 18, 19 - Melbourne Australia
http://www.cfobjective.com.au

Hands-on ColdFusion ORM Training
www.ColdFusionOrmTraining.com

webpointz

unread,
Jan 12, 2011, 10:44:47 AM1/12/11
to javaloader-dev
When I employ the following code (works fine on CF9 locally):

<cfif not structKeyExists(server,"loader")>
<cfset paths = ArrayNew(1) />
<cfset paths[1] = expandPath("_lib/com/javaLoader/support/
cfcdynamicproxy/lib/cfcdynamicproxy.jar") />
<cfset paths[1] = expandPath("_lib/com/iText/iText-2.1.7.jar") />
<cfset paths[2] = expandPath("_lib/com/iText/bcprov-jdk14-138.jar") /
>
<cfset paths[3] = expandPath("_lib/com/iText/bctsp-jdk14-138.jar") />

<cflock scope="Server" type="exclusive" timeout="10">
<cfif not structKeyExists(server,"loader")>
<cfset server.loader = CreateObject("component",
"myMapping.javaloader.JavaLoader").init(loadPaths=paths,
loadColdFusionClassPath=true) />
</cfif>
</cflock>
</cfif>


I receive the following error (on production, it is an INSTANCE of CF9
with NO sandbox security setup)

A security exception occurred while invoking Java method on a
"java.lang.Class" object. MethodName is getClassLoader. Possible
cause: Either the createobject function and cfobject tag are disabled
in the security sandbox or you are trying to create a class in the
ColdFusion package and that is disabled.

Message: Java method security exception.

MethodName: getClassLoader

StackTrace:
coldfusion.runtime.StructBean$SecurityException: Java method security
exception. at
coldfusion.runtime.StructBean.checkPermission(StructBean.java:96)
at coldfusion.runtime.StructBean.invoke(StructBean.java:482) at
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2393) at
cfJavaLoader2ecfc198095096$funcINIT.runFunction(E:\inetpub\wwwroot
\myinstance\_lib\com\javaloader\JavaLoader.cfc:40)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:
405) at
coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:517) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:496) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:355) at
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2301) at
cffusebox2einit2ecfm1781891186.runPage(E:\inetpub\wwwroot\myinstance
\fusebox.init.cfm:27)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231) at
coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416) at
coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722) at
cfApplication2ecfc80585166$funcONREQUESTSTART._factor0(E:\inetpub
\wwwroot\myinstance\fusebox5\Application.cfc:166)
at cfApplication2ecfc80585166$funcONREQUESTSTART.runFunction(E:\inetpub
\wwwroot\myinstance\fusebox5\Application.cfc:162)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at
coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:337) at
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2360) at
cffusebox52ecfm1362636568.runPage(E:\inetpub\wwwroot\myinstance
\fusebox5\fusebox5.cfm:46)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231) at
coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416) at
coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722) at
cfindex2ecfm278061964.runPage(E:\inetpub\wwwroot\myinstance\index.cfm:
22)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231) at
coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416) at
coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65) at
coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:360)
at
coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:
48) at
coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at
coldfusion.filter.PathFilter.invoke(PathFilter.java:94) at
coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70) at
coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:
79) at
coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:
28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at
coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46) at
coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at
coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at
coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62) at
coldfusion.CfmServlet.service(CfmServlet.java:200) at
coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:
89) at
jrun.servlet.FilterChain.doFilter(FilterChain.java:86) at
coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:
42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:
46) at
jrun.servlet.FilterChain.doFilter(FilterChain.java:94) at
jrun.servlet.FilterChain.service(FilterChain.java:101) at
jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106) at
jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) at
jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:
286) at
jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:
543) at
jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:
203) at
jrunx.scheduler.ThreadPool
$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
at jrunx.scheduler.ThreadPool
$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at
jrunx.scheduler.ThreadPool
$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

webpointz

unread,
Jan 12, 2011, 10:46:20 AM1/12/11
to javaloader-dev
Sorry...production is an INTRANET, and JavaLoader version is 1.0
although 0.6 version doesn't work either.
> E: mark.man...@gmail.com

webpointz

unread,
Jan 12, 2011, 11:01:03 AM1/12/11
to javaloader-dev
Mark

As I mentioned in my original posting...the localhost environment is
32 bit and the production server is now CF9 64 bit...I was checking
out the following link, and if this is true, what can I do about this?

http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:61470

Mark Mandel

unread,
Jan 12, 2011, 5:38:27 PM1/12/11
to javaloa...@googlegroups.com
Sounds like, for whatever reason, they have disabled access to the internal ColdFusion Java objects on your production system (which I'm not sure why you would do it on a system you control, although I'm sure people could give us some good reasons?)

Since you've set it up so that loadColdFusionClassPath=true, it's throwing a Security exception, because you're not allowed access to the classLoader.

Is there a particular reason why you need the CF classloader as the parent class loader?

Mark
--
E: mark....@gmail.com

webpointz

unread,
Jan 12, 2011, 8:51:08 PM1/12/11
to javaloader-dev
The issue when i just use Javaloader on it's own is this.

I load as follows:

<cfif not structKeyExists(server,"loader")>
<cfset paths = ArrayNew(1) />
<cfset paths[1] = expandPath("_lib/com/iText/iText-2.1.7.jar") />
<cfset paths[2] = expandPath("_lib/com/iText/bcprov-jdk14-138.jar") /
>
<cfset paths[3] = expandPath("_lib/com/iText/bctsp-jdk14-138.jar") />
<cflock scope="Server" type="exclusive" timeout="10">
<cfif not structKeyExists(server,"loader")>
<cfset server.loader = CreateObject("component",
"myMapping.javaloader.JavaLoader").init( paths ) />
</cfif>
</cflock>
</cfif>

But when I run the following code:

<cfscript>
rectangle = server.loader.create("com.lowagie.text.Rectangle");
</cfscript>
<cfdump var="#rectangle#">

On my localhost, the dump shows the METHODS and FIELDS for the OBJECT
RECTANGLE.

On the production instance, it shows the COMPONENT listing FUNCTIONS
of JAVAPROXY.CFC

There actual error that gets thrown if I allow the whole file to
execute is :


Detail: Could not find the method 'Constructor' in the class
com.lowagie.text.Rectangle

Message: JavaProxy.MethodNotFoundException

StackTrace:

coldfusion.runtime.CustomException: JavaProxy.MethodNotFoundException
at coldfusion.tagext.lang.ThrowTag.doStartTag(ThrowTag.java:142) at
coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722) at
cfJavaProxy2ecfc2003052690$func_RESOLVEMETHODBYPARAMS.runFunction(E:
\inetpub\wwwroot\myApp\_lib\com\javaloader\JavaProxy.cfc:253) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:
405) at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at
coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2582) at
cfJavaProxy2ecfc2003052690$funcINIT.runFunction(E:\inetpub\wwwroot
\myApp\_lib\com\javaloader\JavaProxy.cfc:65) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at
coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:
405) at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:337) at
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2360) at
cfact_s34_extended_gen2ecfm2032207484._factor35(E:\inetpub\wwwroot
\myApp\generate.cfm:51) at
cfact_s34_extended_gen2ecfm2032207484.runPage(E:\inetpub\wwwroot\myApp
\generate.cfm:1) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:
231) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:
416) at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722)
at cfc_public2es34_extended_gen2ecfm1458378197.runPage(E:\inetpub
\wwwroot\parsed\c_public.generate.cfm:44) at
coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231) at
coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416) at
coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722) at
cfApplication2ecfc80585166$funcONREQUEST._factor2(E:\inetpub\wwwroot
\fusebox5\Application.cfc:229) at
cfApplication2ecfc80585166$funcONREQUEST.runFunction(E:\inetpub\wwwroot
\fusebox5\Application.cfc:219) at
coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at
coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491) at
coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:337) at
coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2360) at
cffusebox52ecfm1362636568.runPage(E:\inetpub\wwwroot
\fusebox5\fusebox5.cfm:57) at
coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231) at
coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416) at
coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2722) at
cfindex2ecfm278061964.runPage(E:\inetpub\wwwroot\myApp\index.cfm:22)
I'm completely stumped.

Mark Mandel

unread,
Jan 12, 2011, 9:52:03 PM1/12/11
to javaloa...@googlegroups.com
So, definitely sounds like whoever runs your prod server has disabled access to the internal CF Java objects (again, why, dunno).

On Thu, Jan 13, 2011 at 12:51 PM, webpointz <webp...@gmail.com> wrote:
The issue when i just use Javaloader on it's own is this.

I load as follows:

<cfif not structKeyExists(server,"loader")>
       <cfset paths = ArrayNew(1) />
       <cfset paths[1] = expandPath("_lib/com/iText/iText-2.1.7.jar") />
       <cfset paths[2] = expandPath("_lib/com/iText/bcprov-jdk14-138.jar") /
>
       <cfset paths[3] = expandPath("_lib/com/iText/bctsp-jdk14-138.jar") />
       <cflock scope="Server" type="exclusive" timeout="10">
               <cfif not structKeyExists(server,"loader")>
               <cfset server.loader = CreateObject("component",
"myMapping.javaloader.JavaLoader").init( paths ) />
               </cfif>
       </cflock>
</cfif>

But when I run the following code:

<cfscript>
       rectangle = server.loader.create("com.lowagie.text.Rectangle");
</cfscript>
<cfdump var="#rectangle#">

On my localhost, the dump shows the METHODS and FIELDS for the OBJECT
RECTANGLE.

On the production instance, it shows the COMPONENT listing FUNCTIONS
of JAVAPROXY.CFC

This is because of what was stated above.

When access to internal ColdFusion java objects is disallowed, JavaLoader creates it's own proxy, as a component, and uses onMissingMethod to proxy the underlying Java methods.

Hence you get back a component.
 

There actual error that gets thrown if I allow the whole file to
execute is :


Detail: Could not find the method 'Constructor' in the class
com.lowagie.text.Rectangle

Message: JavaProxy.MethodNotFoundException

So what is the code you are calling here:

gen2ecfm2032207484._factor35(E:\inetpub\wwwroot
\myApp\generate.cfm:51) at
Which seems to be around where the error is thrown.

For future reference, when reporting bugs, the full stack trace, version of CF, version of JavaLoader, and the incriminating code should be included from the beginning. it makes this process much easier :o)

Mark



 

webpointz

unread,
Jan 13, 2011, 4:14:11 PM1/13/11
to javaloader-dev
Hi Mark,

Thanks...it was indeed that the setting "Disable access to internal
ColdFusion Java components" was checked. We couldn't see it due to
limited setting view.

However, I was under the assumption that your JavaProxy.CFC was used
for this very situation??
Unfortunately, it seems that CF9 offers no granularity when it comes
to JAVA. Either it's on or it's off.

Thanks for your help!
Michael
> E: mark.man...@gmail.com

Mark Mandel

unread,
Jan 13, 2011, 5:30:29 PM1/13/11
to javaloa...@googlegroups.com
I believe that's what I explained above? Let me know if I wasn't clear.

To help rectify the issue, I need to see the code.


On Fri, Jan 14, 2011 at 8:14 AM, webpointz <webp...@gmail.com> wrote:
However, I was under the assumption that your JavaProxy.CFC was used
for this very situation??
Unfortunately, it seems that CF9 offers no granularity when it comes
to JAVA.  Either it's on or it's off.

Mark

--
E: mark....@gmail.com

webpointz

unread,
Jan 14, 2011, 3:20:46 PM1/14/11
to javaloader-dev
Basically, here's the code (for ease of use, I have a folder called
"newtest" which contains INDEX.CFM, the iText-2.1.7.jar file, and the
JavaLoader 1.0 folder, then I make a call using cfscript to the
iText-2.1.7 rectangle object and use cfdump to view the output:

index.cfm:
===========================================
<!--- using cfcdynamicproxy --->
<!---<cfif not structKeyExists(server,"loader")>
<cfset paths = ArrayNew(1) />
<cfset paths[1] = expandPath("javaLoader/support/cfcdynamicproxy/lib/
cfcdynamicproxy.jar") />
<cfset paths[2] = expandPath("iText-2.1.7.jar") />

<cflock scope="Server" type="exclusive" timeout="10">
<cfif not structKeyExists(server,"loader")>
<cfset server.loader = CreateObject("component",
"javaloader.JavaLoader").init(loadPaths=paths,
loadColdFusionClassPath=false) />
</cfif>
</cflock>
</cfif> --->

<!--- using JavaLoader regularly --->
<cfif not structKeyExists(server,"loader")>
<cfset paths = ArrayNew(1) />
<cfset paths[1] = expandPath("iText-2.1.7.jar") />

<cflock scope="Server" type="exclusive" timeout="10">
<cfif not structKeyExists(server,"loader")>
<cfset server.loader = CreateObject("component",
"javaloader.JavaLoader").init( paths ) />
</cfif>
</cflock>
</cfif>

<cfscript>
rectangle = server.loader.create("com.lowagie.text.Rectangle");
</cfscript>

<cfdump var="#rectangle#"><cfabort>

================================

When I run the above file with first block of code using
"cfcdynamicproxy" and "Disable access to internal ColdFusion Java
components" checked, I get the following error:

Java method security exception.
A security exception occurred while invoking Java method on a
"java.lang.Class" object. MethodName is getClassLoader. Possible
cause: Either the createobject function and cfobject tag are disabled
in the security sandbox or you are trying to create a class in the
ColdFusion package and that is disabled.

The error occurred in C:\Inetpub\wwwroot\newtest\javaloader
\JavaLoader.cfc: line 40

38 : //can't use above, as doesn't work in some... things
39 :
40 : arguments.parentClassLoader =
getPageContext().getClass().getClassLoader();
41 :
42 : //arguments.parentClassLoader = createObject("java",
"java.lang.ClassLoader").getSystemClassLoader();

Stack Trace
at cfJavaLoader2ecfc2106460248$funcINIT.runFunction(C:\Inetpub\wwwroot
\newtest\javaloader\JavaLoader.cfc:40) at
cfindex2ecfm1019747591.runPage(C:\Inetpub\wwwroot\newtest\index.cfm:8)

coldfusion.runtime.StructBean$SecurityException: Java method security
exception.
at coldfusion.runtime.StructBean.checkPermission(StructBean.java:96)
at coldfusion.runtime.StructBean.invoke(StructBean.java:482)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2393)
at cfJavaLoader2ecfc2106460248$funcINIT.runFunction(C:\Inetpub\wwwroot
\newtest\javaloader\JavaLoader.cfc:40)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod
$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:517)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:496)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:355)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2301)
at cfindex2ecfm1019747591.runPage(C:\Inetpub\wwwroot\newtest
\index.cfm:8)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416)
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:
381)
at
coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:
48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:
40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:94)
at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27)
$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

When I use the SECOND block of code without "cfcdynamicproxy" and
"Disable access to internal ColdFusion Java components" checked, I get
the following error:

Permission denied for creating Java object:
coldfusion.runtime.java.JavaProxy.
Access to Java objects in the ColdFusion package has been disabled by
the administrator.

The error occurred in C:\Inetpub\wwwroot\newtest\javaloader
\JavaLoader.cfc: line 329
Called from C:\Inetpub\wwwroot\newtest\javaloader\JavaLoader.cfc: line
87
Called from C:\Inetpub\wwwroot\newtest\index.cfm: line 27

327 : <cfargument name="class" hint="the java class to create the
proxy with" type="any" required="Yes">
328 : <cfscript>
329 : return createObject("java",
"coldfusion.runtime.java.JavaProxy").init(arguments.class);
330 : </cfscript>
331 : </cffunction>

Stack Trace
at cfJavaLoader2ecfc2106460248$funcCREATEJAVAPROXY.runFunction(C:
\Inetpub\wwwroot\newtest\javaloader\JavaLoader.cfc:329) at
cfJavaLoader2ecfc2106460248$funcCREATE.runFunction(C:\Inetpub\wwwroot
\newtest\javaloader\JavaLoader.cfc:87) at
cfindex2ecfm1019747591.runPage(C:\Inetpub\wwwroot\newtest\index.cfm:
27)

coldfusion.runtime.java.JavaProxyFactory
$ColdFusionJavaNotAllowedException: Permission denied for creating
Java object: coldfusion.runtime.java.JavaProxy.
at
coldfusion.runtime.java.JavaProxyFactory.getProxy(JavaProxyFactory.java:
77)
at coldfusion.runtime.ProxyFactory.getProxy(ProxyFactory.java:65)
at coldfusion.runtime.CFPage.createObjectProxy(CFPage.java:5002)
at coldfusion.runtime.CFPage.CreateObject(CFPage.java:4966)
at coldfusion.runtime.CFPage.CreateObject(CFPage.java:4907)
at coldfusion.runtime.CFPage.CreateObject(CFPage.java:4885)
at coldfusion.runtime.CFPage.CreateObject(CFPage.java:4842)
at cfJavaLoader2ecfc2106460248$funcCREATEJAVAPROXY.runFunction(C:
\Inetpub\wwwroot\newtest\javaloader\JavaLoader.cfc:329)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod
$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2582)
at cfJavaLoader2ecfc2106460248$funcCREATE.runFunction(C:\Inetpub
\wwwroot\newtest\javaloader\JavaLoader.cfc:87)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod
$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod
$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at
coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:
55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:337)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2360)
at cfindex2ecfm1019747591.runPage(C:\Inetpub\wwwroot\newtest
\index.cfm:27)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416)
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:
381)
at
coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:
48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:
40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:94)
at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27)
$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

So, is it true then that with CF Version 9,0,1,274733 (fully hotfixed
and patched) running on Java JRE 1.6.0_23, that if
"Disable access to internal ColdFusion Java components" is checked,
there is no way to use the JavaLoader?

Thanks for all of your help!
Michael









On Jan 13, 5:30 pm, Mark Mandel <mark.man...@gmail.com> wrote:
> I believe that's what I explained above? Let me know if I wasn't clear.
>
> To help rectify the issue, I need to see the code.
>
> On Fri, Jan 14, 2011 at 8:14 AM, webpointz <webpoi...@gmail.com> wrote:
> > However, I was under the assumption that your JavaProxy.CFC was used
> > for this very situation??
> > Unfortunately, it seems that CF9 offers no granularity when it comes
> > to JAVA.  Either it's on or it's off.
>
> Mark
>
> --
> E: mark.man...@gmail.com

Mark Mandel

unread,
Jan 21, 2011, 12:45:38 AM1/21/11
to javaloa...@googlegroups.com
What is the code that is run when the error is thrown?

I keep asking for this, and I can't seem to get it, so please help me help you out here :o)

Mark
--
E: mark....@gmail.com

ElKlaaso

unread,
Mar 8, 2011, 1:15:02 PM3/8/11
to javaloader-dev
Hi,
I have the same problem, the problem occurs in this method of
JavaProxy:

_resolveMethodByParams

It does these comparisons:

else if(param.getName() eq "int" AND class.getName() eq
"java.lang.Integer")
{
found = true;
}

The problem is, coldfusion converts numeric values to an actual
numeric value in a lazy way.
Event if you do: x=10; coldfusion makes that a string, only when you
start doing something like: y=x+1; it converts x into a number.

This is why the above comparison can be something like this:

elseif (int AND "java.lang.String) .. because the class is a string
still internally.

Im trying to make a fix.
> ...
>
> read more »

Mark Mandel

unread,
Mar 8, 2011, 5:47:53 PM3/8/11
to javaloa...@googlegroups.com

If you java cast your input that would work as well.

Mark

Sent from my mobile device.

Reply all
Reply to author
Forward
0 new messages