Friday, July 30, 2010

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:

<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.

Monday, May 10, 2010

Coldfusion 9 orm where in clause

I was trying to do a where in clause using coldfusion 9 orm and it just didn't work. I know pretty fast when something is over my head. A quick search revealed this thread: http://groups.google.com/group/cf-orm-dev/browse_thread/thread/19dc48732d58fca0/f47f3d4ef2e75aab?lnk=raot&fwc=1 in the cf9 orm mailing list. This thread discusses the exact issue I was wondering about. At the end, Barney Boisvert gives an example of how to do this (you have to click on "show Text" in the Bob Sivlerberg Post)

Since I can't figure out how to post code to this STUPID blog, you will have to visit the link.

I also had another issue, I wanted to still use offset and maxrows.  That was easy enough even though I tried to make it hard, and you can see that solution in my post to the same group: http://groups.google.com/group/cf-orm-dev/browse_thread/thread/ab1f8badf28dfbb5?hl=en

Wednesday, May 05, 2010

No Row with the Given Identifier Exists: [contact#0]

So I was setting up coldfusion 9 orm and dumping an object that had lots of related objects, an they had lots of related objects etc.. I kept getting the above error when outputting a one-to-many related object. After searching the database I noticed that that particular foreign key was being set to a 0, instead of a null value, but both those values where present in the linking table.

The solution was to use the missingrowignored="true" option in my orm definition. The record with id = 0 didn't exist and cf 9 orm tried pulling a record with that value (usually it expects a null value when nothing related exists). This caused it to error but I also got a positive from hasContact(). Anyway the missingrowignored="true" was the fix.

Tuesday, May 04, 2010

Specifying Security Credentials in Amazon Web Services AWS EC2

At cfobjective this year Chris Peterson gave a great presentation on running coldfusion in the cloud. In his demo he showed Amazon EC2 and showed how he used it for cloud computing. I was excited about this and I have been checking it out.

Right off the bat I got confused on how to enter my security credentials. I created a key pair and tried to enter that, but it didn't work. So after a couple weeks (I only was able to look at it for a few minutes a couple of different times) I found out what was going on. To get the necessary information, I had to go to the AWS EC2 website and after you login you click "Account" then you click "Security Credentials". Now, after this click, I always have to logon again. NO problem. Then, down below, you will see a section "Access Credentials" with 3 tabs, Choose the "Access Keys" tab, it is probably already selected since it is the first one. You see where it says "Your Access Keys" you can see the Access Key Id, and you simply click on show under the "Secret Access Key" column to see your Secret Key.

Then, using elsaticfox I click on credentials, or it prompts me for them. You can enter anything for the "Account Name" and the AWS Access Key and AWS Secret Access Key where those that we saw above.

Seems simple enough but one of those things that tripped me up.

Wednesday, April 28, 2010

How do I install the latest version of JAVA on Linux Ubuntu?

This is not easy. It's no wonder more people don't use Linux. I cannot see any normal person doing this. Until stuff like this is resolved and made easier Linux won't be coming to many desktops any time soon.

I found this article that walked me through it, but I had no idea what I was doing, just followed the instructions.

http://ubuntuforums.org/showthread.php?t=1437100

Monday, January 11, 2010

Error while executing the Hibernate query.

org.hibernate.hql.ast.QuerySyntaxException: state is not mapped [from state]

This is the error I got when trying to do a simple ORMExecute("from state"). This happened because the from statement is case sensitive. I did change the name of the .cfc but I still am forced to use a uppercase "s" in "State". The tablename is tblState, so I am still confused on this one, but changing the case to match the original cfc did fix it.

Sunday, January 03, 2010

ColdFusion Builder Beta 3 and subclipse (subversion)

The ColdFusion Beta Builder 2 expired on Jan 1, 2010 so I was forced to do something that I wanted to do anyway, install beta 3. I did that on my mac over the weekend. Once I installed it I had a problem getting subversion back on so I could update my repositories.

The first problem was when i selected the subversion components from their site http://subclipse.tigris.org/ It had required dependencies. After unchecking a few, I think mylyn and the graphing one It allowed me to go to the accept licenses screen. However the next and finish buttons stayed greyed out no matter what I chose. I chose the radio button to accept the license agreements and even made sure to scroll through all of them to the end and everything. Nothing worked. Google search gave me this: http://hippiex.instantspot.com/blog/2009/07/13/Easy-Subclipse-and-Coldfusion-Builder. I don't know how it made a difference because I didn't choose any of the components from that site, but just adding it as a site seemed to fix the licensing issue.

After that, I got subclipse to install but upon trying to update to head my repository I got the error "Thread attempted to read nesting count of a lock it did not own". After googling that I found some advice to add all the optional components, which I went back and did, one at a time. I can't remember what order I did them in but I ended up having to add them all except for collabnet merge client before it actuall worked without giving me that error.