Friday, August 31, 2012

ColdFusion 10 update 1 :: UPDATE

It appears the ColdFusion team has released the 1st update to ColdFusion 10 which appears to solve a lot of important issues, especially for those of us that relied on using friendly URLs and much more.

Find out more in the following tech note
http://helpx.adobe.com/coldfusion/kb/coldfusion10-update-01.html


UPDATE

The cgi.path_info problem is finally gone!!! The update thru the admin worked perfectly, I truly love this new feature! Now one thing to note, on my Mac I ran the update and did not have to do anything but on my windows machines I did have to reconfigure the sites using the Web Server Configuration Tool as they specify. I just opened it up, removed all IIS sites and then added them all back again. I guess it registers a new connector and everything works again. Now we can use our favorite frameworks (community or homegrown) without having to add the previous little hack I had blogged about. Thank you Adobe!

Friday, July 13, 2012

ColdFusion 10 on OS X Mountain Lion Server - Apache Config

Ok so this rattled my brain a little today as I was installing ColdFusion 10 on my new Mac Mini Server using the new OS X Mountain Lion Server (Registered developer - I have the Gold Master Release). Well, when I would try to configure the connector, apparently OS X Server does not use the default /etc/apache/httpd.config instead this is located in /Library/Server/Web/Config/apache2/ and the default file is not httpd.conf even though it is in there, instead it is httpd_server_app.conf.

So real simple add your reference to the mod_jk.conf to :
/Library/Server/Web/Config/apache2/ httpd_server_app.conf

And then you are Golden - CF10 up and running!

Monday, June 11, 2012

ColdFusion 10 and AJAX HTTP POST Request hangs

For the past few days I was working on an old application that now runs on ColdFusion 10 in my test environment and all the Ajax calls where just hanging with no response. The funny thing, is in the production server which is CF 8 everything was working fine and in 9 they worked as well as my development server was 9 before. After a little debugging I noticed the problem was because we had the calls being sent as HTTP POST request rather than GET. Now I remember the reason for doing this was an IE issue with caching that would be fixed by making the calls as POST rather than GET.

So how come ColdFusion 10 fails, well it is quite weird. First I will show you an example of how our calls where structured.

First our test CFC (ajax.cfc) we will use an example.


As you can see it is quite simple. We have a function called TestCall which requires an argument called name and then returns a struct with the name value back in it. Real simple just for this simple test.

Now below is an example of how our calls were structured.


As you can see we saved our CFC's url into a global variable in case we used it more than once, then our params in an object that get passed in the simple jQuery ajax function. At success I am just dumping our response to the console log. Absolutely nothing wrong here but in ColdFusion 10 this would just hang. Below is an example with 3 different calls and the firebug output for a better visual representation.




As you can see our first call is just hanging and honestly never responds and the following 2 do work. The difference between each, is that the second request is made as a GET HTTP request and the third is a POST but with the method name in the URL portion rather than as a POST param. So to me it appeared that CF is now only looking for a method definition in the GET (URL) scope and if passed in the POST (form) scope, it just didn't know what to do. As you can see I thought I had it solved but then one thing happened by mistake. As I was writing this post I forgot to add the wsdl to the URL and everything worked.




This time everything worked. Now when I started playing with AJAX a couple of years back it was my understanding that we had to append WSDL to our CFC request but it appears it is not needed and by removing this everything worked fine in 10. So if you are experiencing this same issue do 1 of 2 things.

  1. Remove WSDL from your URL if you have it
  2. Make sure the method request is in the URL portion in a POST request

Hope this helps someone from pulling out as many hairs as I did .. good night world!

Wednesday, June 06, 2012

ColdFusion 9, Mac OS X 64 Bit, missing intel-macosx64

So today, I reinstalled ColdFusion 9 on my Mac so I can have both 9 and 10 running. As fas as my apache server, I have 2 config files that I choose which to use depending on which version of CF I want running (note you can use the buit in webserver and avoid this). Anyways, while I was doing this, I referenced Andy Allan's instruction on how to bypass wsconfig. Now everything is pretty straight forward and it all works fine except the the 64 bit installer is missing the 64 bit connector in the wsconfig.jar file. Basically the following directory connectors/apache/intel-macosx64/ is not in the jar file, you actually have to go get the wsconfig.jar file from hotfix CVE-2009-1876 which is part of Adobe Security Bulletin APSB09-12. I know, it is frustrating but at least there is a solution :-).

Directory named manager in webroot not accessible in ColdFusion 10

So today I ran into another little ColdFusion 10 related problem. I am not calling it a bug because I guess it has its purpose but I am calling it a problem, because it has now become something I need to figure what to do with. Apparently if you have a site with a directory named manager from the root, so /manager/ you will get a 404 from Tomcat like displayed below.



Apparently Tomcat is giving another directory precedence over my local /manager folder. Now the fix is really easy, just rename my folder and all works but I wanted to find out what folder Tomcat was running instead of mine. After some tinkering, the folder is located in (based on single server install) ColdFusion10/cfusion/runtime/manager/. I believe this folder is for the Tomcat manager app, which I don't know much of since this is my first time really working with Tomcat so it is all a learning experience. Now, if I rename this folder to something other than manager and restart ColdFusion, then everything works great but I don't know if this will have a negative impact on ColdFusion. This is a development server so I will continue to play and test but maybe someone smarter will be able to comment here.

A couple of things I tried is doing a rewrite, but if the folder in the end that you are pointing to is /manager at your webroot it will fail but a manager folder 1 level or more deep is fine. So /app/manager/ will work without any problems.

I thought this was quite weird and some people may ask why did I call the directory /manager but at the time when this particular app was built it is what seemed right. Hope this answers someone else similar issue with a simple Google search.