Removing bluedragon from one iis7 website

I am working on a site that was using NewAtlanta bluedragon. I don't know that much about bluedragon but I simply wanted to create another site in IIS and NOT use bluedragon.

I set up the site, installed railo using this great document by Matt Woodward that explains railo and tomcat installation and it worked when testing with just a simple hello world example in index.cfm.

So I uploaded my little fw/1 app and it broke. I got the following error:

view plain print about
1Server Error in '/' Application.Object reference not set to an instance of an object.Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
2
3Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
4
5Source Error:
6
7An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
8Stack Trace:
9
10[NullReferenceException: Object reference not set to an instance of an object.]
11 com.naryx.tagfusion.cfm.engine.cfComponentData.buildPolymorphList() +354
12 com.naryx.tagfusion.cfm.engine.cfSession.onRequestStart(cfFile requestFile) +311
13 NewAtlanta.BlueDragon.CfmModule.OnBeginRequest(Object sender, EventArgs e) +599
14 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +79
15 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +269

From that error message I could tell that bluedragon was still intercepting calls. I looked all over IIS and searched for everything. Posted to the railo group and the fw1 group and also posted to the New Atlanta support forums. Many people were very helpful.

After several weeks of trying to find a solution here and there I finally stumbled on to it. I had tried removing the newatlanta entries from 'Handler Mappings' in the IIS7 site that I was using. That didn't work. Finally, I removed the bluedragon reference in the 'Modules' section of the website I was trying to configure and that immediately fixed it. The attached image highlights the line that needed to be removed.

CFSCRIPT loop over a query and a big mistake

I have to look this one up every time. You can use cfscript to loop over a query by doing the following:

view plain print about
1for (var i=1; i <= qry.recordcount;i++) {
2                
3}
4
5OR
6
7for (var i=1; i <= qry.recordcount;i = i+1) {
8
9}

You notice a slight difference between the part that increments. The top one has an 'i++' the bottom has 'i+1'. I am pretty sure these do the same thing but later version sof coldfusion allowed you to use the double plus sign ++ to increment by 1.

I got stuck half way between and had i=i++. That put my loop into eternal running mode and I had to keep stopping the application to make the thing quit running. I am embarrassed how long this stumped me. So don't do that.

cfmail using Gmail SMTP

I am trying to switch over to a fax service through vocalocity from our own fax server. Either way I send an email to the fax server to actually send a fax. But with this new one I only have on box and so emails have to come from the assigned email account. Since I have some faxes that are sent out automatically (as part of our newsletter subscription) I need to be able to let the server handle the whole process including logging in to the email account to send the faxes.

Enter cfmail. I knew I could do it but hadn't played with it for a while. First google search I found exactly what I needed from Jamie Crug: cfmail using Gmail SMTP.

I couldn't get TLS to work but I only tried once and since SSL worked I stuck with that.

How I Configure ColdFusion ORM and Why

A great article from one of the ColdFusion/CFML community leaders, especially when it comes to ORM, Mark Mandel. He demonstrates his base ORM configuration and explains why he does it like he does. Mark created Transfer ORM which was my first foray into ORM. I used that for a couple years before Coldfusion 9 offered ORM built in using Hibernate.

A great read. I should be better to follow his lead. I hear this stuff all the time but just don't do a lot of it. I usually start with the defaults. I especially appreciate the part where he says not to us ORMFlush() but instead use transactions.

A great read. Here is another link to the article.

Free Coldfusion - CFML

Ok, the title of this blog entry is a little misleading. You can't actually get Coldfusion for free (well, there is a developer edition for local development and a trail period for the full edition) but you can download the Railo CFML engine. There are free alternatives to coldfusion that still let you utilize the cfml markup language and the RAD (Rapid Application Development) benefits of coldfusion. Open Blue Dragon is another one.

I am more familiar with Railo because I have played with it, although only briefly. And haven't used it more because I have a paid version of Coldfusion and for my business I develop in ColdFusion.

But I am glad these other engines are available because It makes CFML available to a larger audience. True there has been some fighting within the community and I don't know that Adobe loves these alternatives but, like I said, I have only seen the benefit of the CFML door opening to more and more people.

Railo just announced their latest release: Railo 3.3 released

Now you have no excuse to not give CFML a run. Get the ColdFusion engine or download one of the Open Source Engines: Railo or Open Blue Dragon

Importing from blogger to blogcfc

Here is the code that I used too import from my blogger account to this new blogcfc blog. It does an OK job and did import my entries, but they weren't perfect.

The first thing you have to do is sign in to your blog over at blogger, for me it was at http://mineer.blogspot.com. Then click settings and the top section is blog tools. Choose "Export Blog". The download and save that file somewhere on your computer. You then need to upload that file to somewhere public so you can get to it with the following code:

view plain print about
1<cffeed action="read" source="http://www.yourserver.com/daveblog.xml"
2query="feedQuery" properties="feedMetadata" >

3
4<CFSET blogurl = 'http://yourblog.blogspot.com/' >
5<CFSET bloguser = 'admin' >
6<CFSET blogname = 'Default' >
7
8<TABLE>
9<CFOUTPUT query="feedquery">
10    <CFIF findnocase("post", feedquery.CATEGORYTERM) >
11        <TR><CFSET endalias = find('.html',LINKHREF) >
12            <CFSET startalias = len(blogurl)+9 >
13            <CFSET alias = mid(LINKHREF,startalias,endalias-startalias) >
14            <CFSET vartitle = replacenocase(alias,'-',' ','all') >
15            <CFIF left(content,2) eq '<s' or left(content,2) eq '<b' >
16                <CFSET start = find('>',content) >

17                <CFSET end = find('<', content, start) >
18                <CFIF end - start gt 1 >
19                    <CFSET vartitle = mid(content,start+1, end-start-1) >
20                </CFIF>
21            </CFIF>
22            <!--- Content Fixes --->
23            <CFSET divstart = findnocase('blogger-post-footer',content) >
24            <CFSET varcontent = left(content,divstart-13) >
25            
26            
27            <CFSET vardate = #dateformat(left(publisheddate,10),"short")# />
28            <CFQUERY datasource="blogdsn" name="insert" >
29                insert into tblblogentries (id,title,body,posted,alias,username,blog,allowcomments,released,mailed)
30                VALUES ('#createUUID()#','#left(vartitle,100)#','#varcontent#','#vardate#','#alias#','admin','default',1,1,1)
31            </CFQUERY>
32            <td>
33                #createUUID()#<BR>
34                ALIAS: #alias#<BR>
35                Title: #vartitle#<BR>
36                Divstart: #divstart#
37            </td>
38            <TD><pre>#content#</pre></TD>
39            <td>#dateformat(left(publisheddate,10),"short")#</td>
40        </TR>
41        <TR>
42            <TD colspan=2><hr></TD>
43        </TR>
44    </CFIF>
45</cfoutput>
46</TABLE>
47
48<cfdump var="#feedquery#">

Railo on mac

Railo on mac

I have had a great time at CFUNITED this year. One of the things that has been a hot topic, which I haven't really caught wind of until today, is the battle between Adobe and the CFML open source alternatives, mainly Railo and Open BD.  I will save that topic for another post.  But that, along with the fact that I have been wanting to do it anyway, prompted me to give Railo a run.

I am mac challenged.  I spend 95% of my time on a PC.  The only time I seriously use my mac is when I travel, and at home in the evening, so maybe I only spend 80% of my time on a PC.  So I can't handle any advanced stuff on a mac.

Railo provides a version that you don't have to install.  That is good for me.  It is called "Railo Express (Jetty)".  It worked just as expected.  I dropped in my apps folder after unzipping the archive and double clicked on "Start" and there you go.  I pointed my browser to http://localhost:8888/ and up came a screen prompting me for a new password.  After selecting one I was presented with the admin interface for railo.

I snooped around the admin interface for a minute, but then I wanted to just see a regular page.  I opened up the index.cfm file in the railo directory (under applications for me, it had a weird name that represented the relase number and everything) under webroot and noticed there was a cflocation:

view plain print about
1<cflocation url="railo-context/admin.cfm" addtoken="no">

I commented that out and then I was able to use that page like any other cfm page and add cfml to it however I want.

Pretty nice that railo makes it so easy to get started with CFML. I have a hard time articulating my thoughts on stuff, like the adobe vs open source battle, but being able to start coding in CFML so easily seems like a good thing for our community.