Fusioncube

The online journey of a technophile, by Steve Brownlee

Archive for July, 2005

ColdFusionMX 7 on JBoss Review

  • Filed under: cfml, jboss
Saturday
Jul 23,2005

Well, it’s been a long road, but I finally have a solid build of CFMX running on JBoss 4.0 SP1 application server. Here’s what I’ve learned.

Flexible Deployments
One of the most useful features I’ve found is that I can deploy either a single instance of ColdFusion that every web application can share, or one instance for each webapp. Simply by modifying the some properties of the web.xml file, you can have your ColdFusion libraries located anywhere1 on your system. This will allow you to have multiple apps share the same settings, datasource connections, and logs which greatly decreases the time required to maintain the server. It’s easy, too. All you need to do is set up one app with the settings and copy the entire WEB-INF directory2 to another app.

Streamlined Servers
While JBoss has all kinds of management tools just like all the other J2EE application servers out there, none are essential. You can eliminate everything from your deployment except Tomcat and your application and still run fine. Granted, advanced developers and adminstrators will want some of these features – such as the JXM Console – but if you just want to deploy a quick, simple application that starts and runs lean, you can cut a lot of fat.

Removing Unneeded Features
For many people running CF7, the new Flash Paper and PDF generating tools, or the SMS Gateways simply aren’t needed. However, by default, ColdFusion 7 starts all of these features. They are simple to remove from the startup schedule thereby reducing the amount of used memory in the JVM. For instance, you can stop CF7 from loading the Flex engine by removing the servlet mapping from your web.xml file.

Java Community Tools
While learning about JBoss, I discovered Eclipse because they released their own specialized version of the IDE. This, in turn, led me to discover CFEclipse which I feel is the best tool for coding ColdFusion available today.

I’ve also started using Ant much more than I had previously because now I could use it to script my ColdFusion apps into WAR or EAR files and hot deploy them to a JBoss instance.

There’s also a grass roots effort to incorporate Hibernate into ColdFusion application development that might be of interest to those familiar with, or interested in, object persistence.

So far I’m very happy with the results on JBoss. Even though it is not officially supported by Adobe, it has worked smoothly without a single major glitch.

1 Any permanent mounted drive
2 After you have uncompressed the CFUSION war/ear file built during installation

Passing Byte Arrays to Java

  • Filed under: cfml, java
Saturday
Jul 23,2005

I’ve been trying lately to convert text to a byte array for use with a Java-based mail proxy service. I need to bypass the CFMAIL tag so that I don’t have to take the performance hit of two CFFILEs to write a file to disk and then read it when creating the email. So create an attachment, I had to send the class a byte array instead of straight text.

I tried this code which worked but still took a measurable amount of time to process

<cfscript>
attachment = createObject("java", "the.attachment.class");
attachText = toByte(toBase64(origText));
attachment.setContent(attachText);</blockquote>
</cfscript>

Then I discovered Chris Cantrell’s blog where he already went through this process for one of his projects and discovered it couldn’t be more simple.

<cfscript>
attachment = createObject("java", "the.attachment.class");
attachText = origText.getBytes();
attachment.setContent(attachText);
</cfscript>

Now this saved about 80ms-210ms per transaction, which at the level this application is creating emails, is a huge savings. Of course, this is on top of a savings of approximately 500ms over the CFMAIL solution.

Latest Tweets

  • Watch video on this page to see a quick shot my family's biz and a heapin' helpin' of Pittsburghese - http://bit.ly/aMxuLN
  • Ever wonder how insignifcant the Earth is on a cosmic scale? http://bit.ly/PV4o
  • How did I miss this highlight??? Hasek takes out Gaborik http://su.pr/1KZtN2
  • Rooted & upgraded my HTC Hero w/#Froyo. Holy shit is it faster and have improved features. Painless, too. http://bit.ly/cBjvuH #fusprint
  • @Antipimp You will do what Father Jobs tell you to do, peon.