Home| faqs| resources| exchange| about
Previous Posts
Log In
Username:

Password:
 
Forgot your password?
Register now >>
Sponsored by
Tracking Tools

On the bookshelf... Bookshelf unavailable

Powered with CFMX

Thursday, January 20, 2005

Mach-II for Newbies - Part 1

Trond Ulseth has written a Mach-II tutorial for Newbies and it's up on http://easycfm.com. It's a good article (though Trond mentions there were some corrections that didn't make it to the published version). Check it out and if you like it give him your vote.

4 Comments:

Anonymous said...

Hi,

I followed your example and got an error.

-----------
Exception
Message name can't be empty
Detail
Extended Info
Tag Context C:\Inetpub\wwwroot\MyGuestbook\model\message\messageCRUD.cfc (24)
C:\Inetpub\wwwroot\MyGuestbook\model\message\messageListener.cfc (17)
C:\Inetpub\wwwroot\machii\framework\invokers\CFCInvoker_Event.cfc (24)
C:\Inetpub\wwwroot\machii\framework\commands\NotifyCommand.cfc (33)
C:\Inetpub\wwwroot\machii\framework\EventHandler.cfc (27)
C:\Inetpub\wwwroot\machii\framework\EventContext.cfc (272)
C:\Inetpub\wwwroot\machii\framework\EventContext.cfc (240)
C:\Inetpub\wwwroot\machii\framework\EventContext.cfc (194)
C:\Inetpub\wwwroot\machii\framework\RequestHandler.cfc (54)
C:\Inetpub\wwwroot\machii\framework\RequestHandler.cfc (23)
C:\Inetpub\wwwroot\machii\mach-ii.cfm (50)
C:\Inetpub\wwwroot\MyGuestbook\index.cfm (8)
--------------

Can anyone elaborate when the form is submitted, how are the parameter being passed through the "event-bean"? I was able to understand the whole process except this piece.

Thanks,
MachII newbie

6:28 PM  
Phil said...

You have a better chance of getting an answer if you post to the Mach-II mailing list or the Mach-II forums (links in the Resources section of this site).

9:19 PM  
Anonymous said...

I was getting the exact same error and was mystified until we went through line by line.

Basically, there's a bug in the tutorial code. If you cut and paste the Application variables in the properties section of your mach-ii.xml, you'll notice that it says:

<property name="dns" value="MyGuestbook" />

But when you go to call messageCRUD, the cfc refers to:

<cfquery name="messageInsert" datasource="#variables.dsn#">

So it's a basically a typo. ("dns" vs "dsn")

Unfortunately, the error being thrown by Mach-II is less than intuitive. Rather frustratingly so, to be honest -- typos happen, but the resulting errors shouldn't be that mysterious to track down. If I'm going to be comfortable coding and maintaining Mach-II apps, I would like to see a little more explicit and informative exceptions being thrown by the framework.

Also note that if you are using Access as your demo database (hey, put that tomato down!) the tutorial app will throw a SQL error unless you put the field named "date" in brackets in your SQL statement. I.e,

INSERT INTO guestbook (
                [date],

Nice effort on the tutorial, however. It is appreciated.

-Tom Lommel

3:18 PM  
Anonymous said...

Tom,

Thanks for the info (and the [date] field), that solved the problem. I found another error with the insert statement, which has an extra comma.

MachII newbie

4:42 PM  

Post a Comment

<< Home