Showing posts with label ColdFusion. Show all posts
Showing posts with label ColdFusion. Show all posts

Thursday, August 4, 2011

To frequent adventures using DotNet with ColdFusion

Adventure: Your CF and DotNet code are working great and talking on your dev server and integration server but not on test or production? Error says "Class xxx not found in the specified assembly list".  Even though you can call built in dotnet methods, so the CF .Net integration service is working, you can't call any of your assemblies.

After comparing, trying and reading many, many, many things. The final solution was to uninstall and re-install the CF 8 .Net integration service. There is an install on the Adobe ColdFusion product downloads page. I found the solution on this forum post.

Friday, July 22, 2011

Not another adventure using DotNet with ColdFusion via the side agent

Adventure: SVN fails to update the code when deploying to a server
Remember to stop the ColdFusion .Net service when doing an svn update. It hangs onto the DLL like candy in a 3 year old's hand. Stop the service, svn update, start the service. You should build this into your deployment process if you are able, ANT, powershell or batch files work well.  Or you could use those nice MS deployment tools. We'll get there but we're still converting.

Friday, July 8, 2011

Yes, more adventures using DotNet with ColdFusion

Adventure: Method not found!
When you get the error "method was not found", pause and take off your CF typeless hat and put on the hard typed language hat. The one with the big HTL on it. Even though in CF a number might be a string, the java proxy will convert it to a number. I was trying to set a CF variable holding a number into a dotnet property of type string and kept getting the "method not found". After a javacast to string it worked. The java proxy must have hard typed it to a numeric.

Wednesday, June 29, 2011

Yes even more adventures with DotNet and ColdFusion

Adventure: pre-build and post-build events in Visual Studio
This adventure is more of a work flow improvement. Now I had been pointing my CF code at the Visual studio project's bin folder for the assembly. I do this using ColdSpring and a config object that has blocks of settings per environment. So on local dev I point at the project but on integration, test and prod I point at an assembly (dll) that is with my CF package folder structure. So on my laptop it uses the dll in the project so every time I build (restart the ColdFusion .Net service first) I get the new code. However I am not testing the deployed assembly in the CF package and I had to copy it from my VS project when I wanted to release that version.


I used a post build event in VS to copy the dll from my project to the CF package with something like this.

copy /y "$(TargetPath)" "C:\YourWebSiteDir\notWebRoot\dotnet" 

Next I said why am I restarting the ColdFusion .Net service by hand.

Pre-build event:

Net stop "ColdFusion 8 .Net Service"

Post-build event (after the copy event):
Net start "ColdFusion 8 .Net Service"

So now I just build in VS and services are restarted and the dll updated in my CF source code.

ColdFusion 9 issues with SBS Sharepoint and other sites.

I had helped someone install CF9 on their web server and we choose all sites when asked what IIS sites to connect it to. They had several IIS sites for their MS Small Business Server and one CF site. The CF site worked and we called it a day. A few days later they contacted me saying the SBS Sharepoint and other sites where breaking and the MS tech support thought it was ColdFusion. Well I had not heard of this before but went out to help. It seems that the CF 9 install adds a wild card IIS handler mapping for "*" so all requests go through CF. When they turned of the CF application service images were broken until they removed the wild card mapping. Why CF 9 needs a wildcard mapping I do not know.

Wednesday, June 8, 2011

Even more adventures with DotNet and ColdFusion

Adventure 6: no automatic ToString() on DotNet string properties
I have some string properties in my dotnet poco (or transfer object) and I map them to my CF business object. But if the dotnet property is null the set fails in CF saying the parameter to the CF versions set method was not passed. So wrapping the get on the dotnet poco with the CF function ToString() solves this. Its as if CF can't convert the dotnet null to an empty string with out some help.  No biggy, just interesting.

Tuesday, June 7, 2011

More adventures using DotNet with ColdFusion

Adventure 4: What to send across the boundary.
When you instantiate a DotNet object in CF its always a good idea to dump it to see how the proxy changed any method names. Well the vendors wsdl I am working with has about 60 classes, enums and interfaces. Not very abstracted. In several cases a property would be one of two different depending on the results of the web service call. And they did not inherit any base class. I had to inspect the type and then cast the property to use it. Ouch. So instead of passing back nested business objects, enums and other dotnet fun stuff I decided to make a poco with all the information I needed. Boiling down about 7 to 10 objects and enums into one object with about 25 properties including some for exception messages.

Adventure 5: Who is the web.config for? Not ColdFusion.
In Visual Studio I had setup Fiddler as a proxy with https termination so I can see my soap call that are SSL. I had done this in the web.config. Well once I started calling the assembly (dll) from CF Fiddler stopped seeing the calls. Hmm. Come to find out the web.config is for IIS. Solution:  the web service objects expose a proxy property you can set at run time by creating a WebProxy object. Warning: if the proxy is not available, fiddler running, it will not work. So this is just for debug.

Friday, June 3, 2011

Adventures using DotNet with ColdFusion via the side agent

 I have a project were the web service of a vendor would not work with the Apache Axis 1.2.1 that CF uses.
However I was able to call it via dotnet. So I decided to use the CF to .Net integration. I'd used it before but rebuild my dev machine since and forgot some of the glitches.

This is all for ColdFusion 8.01 and .Net 3.5 framework. CF 8 does not work with .Net 4 and we are not on CF 9 yet.

Adventure 1: the java.lang.ClassNotFoundException error.
For starters if you are running the multi-server install the process that creates new server instances has a huge fault. It does not copy the dotnet proxy config to the created CF server instances.  Find in the master cfusion instance this file, dotnet_coreproxy.config, and copy it to the same location in your server instance.

Adventure 2: unable to copy file [your assembly dll] another process is using it.
For development in CF I pointed at the dll in my projects bin directory. However once you invoke it from CF the CF .net side agent service locks this so when you recompile in Visual Studio it will error. Restarting the .net side agent service temporarily breaks the link.

Adventure 3: .net exception passed to CF = java.lang.ClassNotFoundException
Passing some exceptions back work just fine but if the exception has nested objects that CF does not know how to find to proxy it will error. Even if they are in my assembly. They must not be in base .net library that CF is using. I have not found a good solution other than creating my own object to pass back to CF.
Update: I implemented an exception processing function that catches several types of exceptions like  SoapHeaderException and pulls the information out and adds it to a poco I created to simplify what CF has to deal with.

Wednesday, May 12, 2010

The CF awesomeness of Ben Nadel

I'd just like to say that Ben Nadel has done a heck of lot for the CF community. Many of the people on my team including me have used or referenced his code samples over and over. His recent reMultiMatch() regEx post is another "spot on Ben". (reference to a youTube video)

Tuesday, February 9, 2010

ColdFusion Contractors Wanted

We are hiring some ColdFusion contractors. Skills in OO, web services, xml, MSSQL, Model-Glue, ColdSpring are all desirable. These are senior positions. The positions will most likely be at least a year if not longer. Post a comment if you would like to apply or need more info.

Tuesday, February 2, 2010

Change vs Progress

When does change become progress? Is progress planned ahead of time? Does change just morph into progress at some point? Or is it only in reflection that you can say progress was made? Our shop is converting technologies and I'm trying to figure out if we are making progress or just change. Its early yet so perhaps progress only comes with reflection.

Thursday, November 19, 2009

Scratch that, switching to .Net

We were told yesterday by our IT leadership that we are switching to .Net. Talk about a change that rocks you to the core.

Thursday, August 20, 2009

BeerXML SDK Project

BeerXML is a standard for storing beer recipes. Some applications and sites can read and export recipes in this format however the compliance to the standard varies WIDELY. A while back I wrote a BeerXML parser for our club web site so we can post recipes. Doing so I said wow there should be some tools to help developers out. So I asked around and posted some messages on blogs asking if anyone wants to form an open source project. After getting two replies I decided to create this Google group. BeerXML SDK to aid in the groups communication and planning.

Current languages represented:
ColdFusion
C#
Java
Ruby

Anyone is welcome to join. The main goal is to make some SDK's to help import BeerXML into native objects and data types. Other goals are exporting and other tools to work with the objects.
However this is all up for discussion.

Tuesday, August 11, 2009

Model-Glue 3 is here!

The long awaited release of Model-Glue 3 (Gesture) is here. http://model-glue.com/coldfusion.cfm
Some of the features I like are helpers, formats and event types. We've been using concepts similar to some of these features and had Joe on sight a few times and he was the inspiration for a few. What a great MVC framework. We use MG across several of out applications both as the entire site or several MG apps nested within another framework. Model-Glue helps use split up the view and model tasks very nicely.

Monday, July 13, 2009

ColdFusion 9 & Bolt Public Beta. Special CF Meetup today.

ColdFusion 9 and ColdFusion Builder (formerly Bolt) are now on Adobe Labs.

http://labs.adobe.com/technologies/coldfusion9/
http://labs.adobe.com/technologies/coldfusionbuilder/


Also there is a CF meetup special session today with Terry Ryan presenting on Centaur and Bold. This is basically an online CFUG meeting done via Adobe Connect. Just bring your browser. http://www.meetup.com/coldfusionmeetup/calendar/10841349/?a=nr1p_grp

Monday, July 6, 2009

CF 8.01 - vulnerability

UPDATE: Adobe hotfix for below issue. http://www.adobe.com/support/security/bulletins/apsb09-09.html

Please read.
http://blogs.adobe.com/psirt/2009/07/
http://www.codfusion.com/blog/post.cfm/cf8-and-fckeditor-security-threat

FCKEditor vulnerability http://www.ocert.org/advisories/ocert-2009-007.html
FCKEditor patch 2.6.4.1 http://www.fckeditor.net/whatsnew


Tuesday, June 23, 2009

Mayo Clinic Hiring ColdFusion Developers

My team is hiring senior level ColdFusion developers. Below is the posting.

Senior Analyst Programmer

Mayo Clinic in Rochester, MN, is seeking qualified candidates for the position of Senior Analyst Programmer. Our Global Product Service is in immediate need of a highly motivated individual to be part of the Population Health technical team who is capable of designing and implementing interactive web-based applications and services. Duties will include supporting the monitoring and maintenance of multiple web sites and working closely with other members of the Population Health technical team to help architect applications for the EmbodyHealth portal. You will also assist in the integration of EmbodyHealth with other business units at Mayo and other vendor partners. To qualify, you must have a Bachelor's degree and three years of professional software development experience; or an Associate's degree and five years professional software development experience; or nine years of professional software development experience. Three to five years' experience in web application development and a background working with ColdFusion are required. Experience in data modeling and design on enterprise level DB such as Microsoft SQL Server is also essential

Mayo Clinic, one of Fortune magazine's "100 Best Companies to Work For," offers an excellent salary and benefits package. To apply or learn more about this or other opportunities, please visit http://www.mayo-clinic-jobs.com/job/ROCHESTER,-MN-Senior-Analyst-Programmer-23956-Job/497314/

Stephanie Bowron, Human Resources Phone: 800-562-7984

Mayo Clinic is an affirmative action and equal opportunity employer. Post-offer/pre-employment screening is required.

Friday, June 12, 2009

Cross Site Scripting and SQL Injection in CGI scope

This is not another post telling you what 100 other have. We all know you need to check....
However often times there are a few variables forgotten when checking for CSS and SQL injection.
In ColdFusion there is a scope called CGI. It contains things like CGI.QUERY_STRING and CGI.SCRIPT_NAME. If you use either of these in your code these are susceptible to attack also. I have seen a malformed URL create attacks in both of these.

Here is one SQL injection tool that may help you. http://portcullis.riaforge.org/

Tuesday, June 9, 2009

Performance Tuning ColdFusion

This is a great place to start "Performance tuning for ColdFusion applications". Don't be scared off by the Jvm memory tuning stuff. If you can tune your JVM this article has other good nuggets of info.

My tuning tips:
  • Turn on the debugging info and the " " setting. Or just this setting as enabling everything can suck up a lot of memory. Look for not only long running code but code that you did not expect to run more than once or N times. If something only takes 30ms but runs 100 times maybe you could still tune it to run less. Especially something that may only take 30ms in development could make a huge impact if it starts taking 100ms say.
  • Indexing your db tables properly can help a lot. Sometimes we create tables, write a bunch of code and forget to go back and look at what fields we actually used in the where clause or joins. Sometimes things change and that primary key may not be "the field" you used.
Enjoy

Wednesday, May 20, 2009

ColdFusion performance and stability

Once in a while I hear a comment or a question about ColdFusion and its performance and stability. Usually this is coming from an experience where the CF environment was not architected well, not best practice. We follow best practices and our stability is 99.5% to 100% and usually its some maintenance or non web server outage that lessens that number.

Let me tell you that my team has been running several very success medical information sites for over 8 years on CF. One site now gets about 70 to 80 million page views a month. It uses FarCry for a CMS and does a lot of caching. Its no static site by any means of the imagination. Especially considering FarCry is not a page based CMS but rather the objects have views and the data can be displayed in a multitude of ways. Makes caching more fun that way. lol.

We have a host of other sites we run that are more db bound. One of them maintains about 1000+ logins an hour durring peak load. That is just logins, not counting users who are on the site already. It also rocks for stability and performance.

We run multiple instances of CF on our servers. Some servers have 5 instances running 5 different sites. Sure we do run in to times when we need to tune the code to utilize memory better but that's not a bad thing. By the way CF8 and a newer JVM gave us a nice performance boost. Some apps saw a 20% improvement.

My tips (from the top of my head):
  1. Use multiple instances to isolate applications.
  2. Use trusted cache and save class file settings if you can.
  3. Cluster - using a hardware load balancer.
  4. Use CFC's, ColdSpring and other frameworks where you can. Like Model-Glue.
  5. Use stored procedures or at least cfqueryparam
  6. Use a var scope checker.
  7. Use session scope to lessen db writes, this will require sticky sessions in a cluster.
  8. Look at you debug output and see where you can tweak performance.
  9. Look at your db performance, can you cache data, indexing...
  10. Benchmark and load test.
  11. Have a dedicated administrator who can actually spend the time needed on the servers.

If you follow best practices ColdFusion is very fast and stable.