House of Fusion
Home of the ColdFusion Community

Search cf-talk

December 02, 2008

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
   1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31       

Search over 2,500 ColdFusion resources here  >>>      
Home /  Groups /  ColdFusion Talk (CF-Talk)

ColdFusion not seeing standard Java classes when using CFINVOKE

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Hello folks,
Joel Parramore
08/29/08 12:43 A
You just did...
Andrew Scott
08/29/08 10:48 A
Hello folks,
Joel Parramore
08/29/08 12:44 A
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Joel Parramore
08/29/2008 12:43 AM

Hello folks, I'm converting a CFC to use <cfinvoke> instead of createObject becase of a hosting provider's restrictions.  When using cfinvoke, ColdFusion (v8 Developer edition, under Windows 2003 Server) does not see standard Java classes; however, when using createObject, there does not appear to be a problem.  A short example: THIS FAILS (Could not find the ColdFusion Component or Interface java.lang.System.): <cfinvoke component="java.lang.System" method="getProperties" returnvariable="prop2"> <cfdump var="#prop2#"> THIS WORKS: <cfset prop = createObject("java", "java.lang.System").getProperties()> <cfdump var="#prop#"> If someone has encountered a similar issue and resolved it, I'd appreciate hearing it.  Thanks in advance... Regards, Joel

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Andrew Scott
08/29/2008 10:48 AM

You just did... There is really no difference between the two methods. The thing is that if you are on a shared hosting, they lock everything down and you need to request the tag you would like to have added. They Sandbox everything to deny, then until someone asks they will not open it. The hosting provider should have that information on their home page. HTH -- Senior Coldfusion Developer Aegeon Pty. Ltd. www.aegeon.com.au Phone: +613 9015 8628 Mobile: 0404 998 273 Hello folks, I'm converting a CFC to use <cfinvoke> instead of createObject becase of a hosting provider's restrictions.  When using cfinvoke, ColdFusion (v8 Developer edition, under Windows 2003 Server) does not see standard Java classes; however, when using createObject, there does not appear to be a problem.  A short example: THIS FAILS (Could not find the ColdFusion Component or Interface java.lang.System.): <cfinvoke component="java.lang.System" method="getProperties" returnvariable="prop2"> <cfdump var="#prop2#"> THIS WORKS: <cfset prop = createObject("java", "java.lang.System").getProperties()> <cfdump var="#prop#"> If someone has encountered a similar issue and resolved it, I'd appreciate hearing it.  Thanks in advance... Regards, Joel

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Joel Parramore
08/29/2008 12:44 AM

Hello folks, I'm converting a CFC to use <cfinvoke> instead of createObject becase of a hosting provider's restrictions.  When using cfinvoke, ColdFusion (v8 Developer edition, under Windows 2003 Server) does not see standard Java classes; however, when using createObject, there does not appear to be a problem.  A short example: THIS FAILS (Could not find the ColdFusion Component or Interface java.lang.System.): <cfinvoke component="java.lang.System" method="getProperties" returnvariable="prop2"> <cfdump var="#prop2#"> THIS WORKS: <cfset prop = createObject("java", "java.lang.System").getProperties()> <cfdump var="#prop#"> If someone has encountered a similar issue and resolved it, I'd appreciate hearing it.  Thanks in advance... Regards, Joel

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Brad Wood
08/29/2008 02:11 AM

I do not believe you can use cfinvoke to create instances of Java classes-- Only CFC's. Try <cfobject type = "Java" ~Brad

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Joel Parramore
08/29/2008 08:52 AM

>I do not believe you can use cfinvoke to create instances of Java classes-- > Only CFC's. > I saw in the docs the use w/CFC or web services, but I've seen enough examples being used with Java code that not explicitly saying that one couldn't invoke Java classes didn't seem to be an issue. > Try <cfobject type = "Java" > > ~Brad The hosting provider (GoDaddy) blocks using createObject and <CFOBJECT>; otherwise, I wouldn't need to change any code.  It may be moot, since, after going thru some of GoDaddy's docs on the subject, it appears that they don't allow the use of Java objects on a ColdFusion account. :-( Regards, Joel


<< Previous Thread Today's Threads Next Thread >>

Mailing Lists