Over a million developers have joined DZone.

Pros and Cons of Deploying ColdFusion Apps as EAR Files?

DZone 's Guide to

Pros and Cons of Deploying ColdFusion Apps as EAR Files?

· Java Zone ·
Free Resource
I asked this question on CF-Talk, but didn't get any responses, so I'm trying again here...

At work we are beginning the transition from ColdFusion 7 to ColdFusion 9.  As part of the transition, we want to set up a ColdFusion 9 server cluster (using CF 9 Enterprise) to host those ColdFusion applications that need to have a high level of redundancy.  In order to reach this goal, the server admins want any apps hosted in this cluster to be deployed as EAR files.

From what I've read on the subject of EAR deployment, this is a sensible approach for a clustered environment, but it's unfamiliar territory for us.  We're used to having direct access to the application files so we can make minor adjustments rather quickly and I'm worried that adding a packaging and deployment step (even with the use of automation tools like Ant) is really going to slow down our ability to push out changes.  I'm also concerned about the fact that some of the apps in question are not self-contained:  they are integrated into websites that our clients have the ability to edit.  Based on what I've read, it's sounds like that wouldn't be an issue as long as the files and folders within the EAR were deployed in the right place for the client files to access them, but in practice…

So basically, I'm looking for some advice and input from anyone who deploys their apps as EAR files (especially from folks who've made the transition from deploying via file upload to deploying via EAR), anything from how we should plan for this, best practices, things to look out for, etc.


Responses on Brian's Blog:

  1. Sam Farmer Says:
    Mar 29, 2011 at 9:18 AM When deploying to enterprise apps the places I've worked at have always tied each instance to a directory as opposed to EAR files. Then used syncing software to keep the directories in, well, sync across different machines.

    That way you still can edit files on the server if you need to.
  2. Brian Swartzfager Says:
    Mar 29, 2011 at 9:42 AM @Sam: That would certainly be a scenario I'd be more comfortable with. It's not entirely clear to me yet if our server admins have their own particular reasons for going the EAR route (a desire to package CF Admin settings with the deployment, or perhaps to control the deployment process over on their end) or if they simply read a particular article that touted EAR deployment as a best practice for enterprise environments and are just going along with that. I'm just trying to gain some intel on the topic in case I need to argue against going down that route.
  3. Matthew Says:
    Mar 29, 2011 at 10:12 AM We deploy our applications in an EAR file. I would say a pro would be you are deploying one file, instead of a directory of files. Id say a con would be if you make a change to one or two files and want to redeploy an ear file, we have to package the ear with all the unchanged files and the updated files. Our Coldfusion ear files are rather large. I know there are some files/folders we can leave out, but I dont know which ones they are.

    Im sure an ANT script can help speed up some of these processes.
  4. Larry C. Lyons Says:
    Mar 30, 2011 at 2:20 PM I guess it really depends on what you're running for an application server. For both JBoss and Tomcat, cluster deployment is very easy. For JBoss just drop the war or ear file into the Farm directory and it will handle the deployment to the other members of the cluster for you on the next round of the lifecycle. This is the recommended deployment method.

    You can manually deploy the file, but its very inefficient and somewhat of a risk. There are additional issues. For instance what happens if a user is directed to an instance in the cluster that doesn't have the application.

    AS for deploying a san ear or war file, you need to consider whether you have any associated EJB's - JBoss won't pick that up in a war file for example. There's a good discussion of the issue at http://www.theserverside.com/discussions/thread.tss?thread_id=31978

    But generally IMNSHO unless you specifically need what an EAR file provides, I'd go with using a WAR file. - its less complicated and simpler to set up. Its easily created (I'll either rename the zip file or use an ANT task). And finally its a little smaller than an EAR file.


Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}