<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Penguinspeak &#187; ColdFusion</title>
	<atom:link href="http://macmartine.com/blog/category/coldfusion/feed" rel="self" type="application/rss+xml" />
	<link>http://macmartine.com/blog</link>
	<description>This is how I see it.</description>
	<lastBuildDate>Tue, 19 Oct 2010 00:39:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Installing Coldfusion and JRun on OS X</title>
		<link>http://macmartine.com/blog/2008/04/installing_coldfusion_and_jrun_1.html</link>
		<comments>http://macmartine.com/blog/2008/04/installing_coldfusion_and_jrun_1.html#comments</comments>
		<pubDate>Thu, 10 Apr 2008 13:21:53 +0000</pubDate>
		<dc:creator>99miles</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://macmartine.com/blog/?p=35</guid>
		<description><![CDATA[I spent a lot of time getting ColdFusion to run on Leopard. I wish I had kept better track of all the errors I sorted through on path to figuring it out, but unfortunately I didn&#8217;t. Here were the biggies though. First make sure to get Update 7 for JRun. I didn&#8217;t find the updates [...]]]></description>
			<content:encoded><![CDATA[<p>I spent a lot of time getting ColdFusion to run on Leopard. I wish I had kept better track of all the errors I sorted through on path to figuring it out, but unfortunately I didn&#8217;t.<br />
Here were the biggies though. First make sure to get Update 7 for JRun. I didn&#8217;t find the updates at first which slowed me down.<br />
Additionally (and the most frustrating), is it turned out that setting java.home in jvm.config was not enough to make JRun use the specified JRE. I wanted it to use JVM 1.5.0. Running &#8216;./jrun -info&#8217; (from the JRun bin directory) returned &#8220;Apple Inc. 1.5.0_13-119 Java HotSpot(TM) Client VM&#8221;, so it appeared to be finding the JVM I wanted it to use, but it wasn&#8217;t working. So I set the classpath in ~/.bash_profile as well. That didn&#8217;t cut it either. Finally I found <a href="http://www.talkingtree.com/blog/index.cfm/2006/5/17/CFMX-MacOSX-JVM142">Steven Erat&#8217;s entry</a> where he had similar issues.<br />
What did resolve it was to change the CurrentJDK alias in System/Library/Frameworks/JavaVM.framework/Versions in addition to the changes already made.<br />
Steven&#8217;s entry has good directions on how to do so. It seemed to me that setting java.home in jvm.config should have taken care of everything, but it didn&#8217;t You can to set the JVM in 3 places.<br />
Once I had it running with JDK 1.5, I&#8217;d get this error:<br />
Error 500<br />
Could not invoke Java compiler, please make sure jikesw is in /Applications/JRun4/bin or put a JDK bin directory in your path.<br />
jrunx.compiler.JavaCompiler$NoCompilerFoundException: Could not invoke Java compiler, please make sure jikesw is in /Applications/JRun4/bin or put a JDK bin directory in your path.<br />
at jrunx.compiler.JavaCompiler.outProcessCompile(JavaCompiler.java:474)<br />
&#8230;&#8230;&#8230;&#8230;&#8230;..<br />
Basically it can&#8217;t find javac, and I still have no idea why. The servers running but the sample JSP&#8217;s aren&#8217;t getting compiled. You could probably just compile the apps manually but I haven&#8217;t done that.<br />
Well, there&#8217;s no great solution here, but hopefully this&#8217;ll help you to get going with whatever you decide.  The problem with changing the CurrentJDK alias to 1.4.2 is that then everything on your system will be using that. That&#8217;s a hassle for me with all my Eclipse installs, etc where I need JDK 1.5.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Installing+Coldfusion+and+JRun+on+OS+X+http%3A%2F%2Fbit.ly%2F1xMmvx" title="Post to Twitter"><img class="nothumb" src="http://macmartine.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://macmartine.com/blog/2008/04/installing_coldfusion_and_jrun_1.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex and ColdFusion: RemoteObjects and WebServices</title>
		<link>http://macmartine.com/blog/2008/04/flex_and_coldfusion_remoteobje.html</link>
		<comments>http://macmartine.com/blog/2008/04/flex_and_coldfusion_remoteobje.html#comments</comments>
		<pubDate>Wed, 02 Apr 2008 16:33:57 +0000</pubDate>
		<dc:creator>99miles</dc:creator>
				<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://macmartine.com/blog/?p=31</guid>
		<description><![CDATA[Once you have a ColdFusion CFC you can call it&#8217;s methods with a RemoteObject or via a WebService. RemoteObjects are usually preferred for their performance speed. Here we&#8217;ll create a super basic example of calling a CFC from both a WebService and a RemoteObject. The application will simply let you enter your name, click a [...]]]></description>
			<content:encoded><![CDATA[<p>Once you have a ColdFusion CFC you can call it&#8217;s methods with a RemoteObject or via a WebService.<br />
RemoteObjects are usually preferred for their <a href="http://www.themidnightcoders.com/blog/2007/03/flex-remoteobject-vs-webservice.html">performance speed</a>.<br />
<br/><br/><br />
Here we&#8217;ll create a super basic example of calling a CFC from both a WebService and a RemoteObject. The application will simply let you enter your name, click a button, call the CFC and return a welcome message including your name.<br />
<br/><br/></p>
<p><span id="more-31"></span><br />
To set up our examples, let create a most basic CFC. Let&#8217;s call this file NEWCFComponent.cfc and this&#8217;ll be it&#8217;s contents:<br />
<br/><br/><br />
<textarea rows="10" cols="60"><br />
<cfcomponent displayname="CF_Service" output="false"><br />
<cffunction name="WelcomeMsg" access="remote" returntype="string"><br />
<cfargument name="name" type="string" required="yes"><br />
<cfreturn "YO, #name#!"><br />
</cffunction><br />
</cfcomponent><br />
</textarea><br />
<br/><br/><br />
You can see this simply takes the #name# variable that it retrieves and returns the welcome message &#8220;Yo, #name#!&#8221;.<br />
<br/><br/><br />
Okay, let&#8217;s first call this with a WebService. Just create a basic local Flex project.<br />
Here&#8217;s the main application for that project:<br />
<br/><br/><br />
<textarea rows="25" cols="60"><br />
<?xml version="1.0" encoding="utf-8"?><br />
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"><br />
<mx:Script><br />
<![CDATA[<br />
import mx.rpc.events.FaultEvent;<br />
import mx.rpc.Fault;<br />
import mx.rpc.events.ResultEvent;<br />
private function onResult( e : ResultEvent ) :void<br />
{<br />
msg.text = e.result.toString();<br />
}<br />
private function onFault( e : FaultEvent ) :void<br />
{<br />
trace( 'Oops!' );<br />
}<br />
]]&gt;<br />
</mx:Script><br />
<mx:WebService id="ws"<br />
wsdl="http://<server-name-or-IP>:8500/cf/CF_Service/NewCFComponent.cfc?wsdl&#8221;<br />
showBusyCursor=&#8221;true&#8221;><br />
<mx:operation name="WelcomeMsg"<br />
result="onResult(event)"<br />
fault="onFault(event)"><br />
<mx:request xmlns=""><br />
<name><br />
{_name.text}<br />
</name><br />
</mx:request><br />
</mx:operation><br />
</mx:WebService><br />
<mx:Button x="284" y="10" label="Get Welcome Message." click="ws.WelcomeMsg.send()"/><br />
<mx:TextInput id="msg" x="681" y="10"/><br />
<mx:TextInput id="_name" x="116" y="10"/><br />
<mx:Label x="10" y="12" text="Enter your name:"/><br />
</mx:Application><br />
</textarea><br />
<br/><br/><br />
Modify the &#8216;wsdl&#8217; attribute of the WebService tag as necessary to point to your CF server.<br />
<br/><br/><br />
That&#8217;s it! Now Run the Flex app, enter your name, click the button and see your welcome message!<br />
<br/><br/><br />
Now let&#8217;s do the same thing but use a RemoteObject.<br />
<br/><br/><br />
Create a Flex Project and in the Flex Project Wizard choose &#8216;ColdFusion&#8217; for the server type and &#8216;ColdFusion Flash Remoting&#8217;. Point the &#8216;Web root&#8217; and &#8216;Root URL&#8217; to your CF server.<br />
<br/><br/><br />
Use the same contents for the Flex application as above except remove the WebService tag and all it&#8217;s contents, and put this in it&#8217;s place:<br />
<br/><br/><br />
<textarea rows="5" cols="60"><br />
<mx:RemoteObject id="ws" destination="ColdFusion" source="cf.CF_Service.NewCFComponent"><br />
<mx:method name="WelcomeMsg" result="onResult(event)" fault="onFault(event)"/><br />
</mx:RemoteObject><br />
</textarea><br />
<br/><br/><br />
The &#8216;destination&#8217; is the remote destination as defined in remoting-config.xml (located in the <cf-server-root>/WEB-INF/flex directory). &#8216;ColdFusion&#8217; is a pre-defined, built-in destination.<br />
The &#8216;source&#8217; attribute should point to the location of your CFC starting at the server root. Note that this does not include the CFC extension, just the name of the CFC.<br />
<br/><br/><br />
Go ahead and run the app and it should behave just the same as the WebService version we created above, but maybe faster.<br />
<br/><br/><br />
If you want to create you own destination you can do that easily. Open remoting-config.xml (located in the <cf-server-root>/WEB-INF/flex directory and add this destination:<br />
<br/><br/><br />
<textarea rows="25" cols="60"><br />
<destination id="cfRemotingExample"><br />
<channels><br />
<channel ref="my-cfamf"/><br />
</channels></p>
<properties>
<source>cf.CF_Service.NewCFComponent</source><br />
<!-- define the resolution rules and access level of the cfc being invoked --><br />
<access><br />
<!-- Use the ColdFusion mappings to find CFCs, by default only CFC files under your webroot can be found. --><br />
<use-mappings>false</use-mappings><br />
<!-- allow "public and remote" or just "remote" methods to be invoked --><br />
<method-access-level>remote</method-access-level><br />
</access></p>
<property-case>
<!-- cfc property names --><br />
<force-cfc-lowercase>false</force-cfc-lowercase><br />
<!-- Query column names --><br />
<force-query-lowercase>false</force-query-lowercase><br />
<!-- struct keys --><br />
<force-struct-lowercase>false</force-struct-lowercase>
</property-case>
</properties>
</destination><br />
</textarea><br />
<br/><br/><br />
The &#8216;source&#8217; attribute should point to the location of your CFC starting at the server root. This should be identical to the &#8216;source&#8217; attribute you had in your RemoteObject tag.<br />
<br/><br/><br />
Now a couple quick modifications to the RemoteObject and we&#8217;re good to go:<br />
<br/><br/><br />
<textarea rows="5" cols="60"><br />
<mx:RemoteObject id="ws" destination="cfRemotingExample" showBusyCursor="true"><br />
<mx:method name="WelcomeMsg" result="onResult(event)" fault="onFault(event)"/><br />
</mx:RemoteObject><br />
</textarea><br />
<br/><br/><br />
Notice we just changed the &#8216;destination&#8217; attribute to point to our new destination name, and we removed the &#8216;source&#8217; attribute because we included that in the <source> of our custom destination in remoting.config.xml.<br />
For now we&#8217;ll just use the default remote destination configured in remoting-config.xml (located in the <cf-server-root>/WEB-INF/flex directory)</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Flex+and+ColdFusion%3A+RemoteObjects+and+WebServices+http%3A%2F%2Fbit.ly%2F1T1ZPs" title="Post to Twitter"><img class="nothumb" src="http://macmartine.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://macmartine.com/blog/2008/04/flex_and_coldfusion_remoteobje.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

