Archive for the ‘Languages’ Category

A Regular Expression To Proxy Basic ColdFusion Requests

Thursday, April 3rd, 2008

(Note: I’m cleaning up some old drafts which have been sitting around for awhile.)

A couple of years ago while setting-up a new J2EE server cluster using the Implementing Multitier Hardware Load Balancing with ColdFusion MX for J2EE or JRun article, I needed to setup a proxy filter for ColdFusion requests. Given that the application I was setting up used a context root of /, the proxy rule listed in that article would not work. Instead, thanks to my former co-worker Rod, I now have a regular expression which will redirect all basic requests for ColdFusion:

[code]
^((?:\S*.cfml?\S*)|\S*/(?:\?\S+)?)$
[/code]

This regexp works for the following combinations:

[code]
hello.cfm?hello=2
hello/
sadfa/
dasd/?hello=231
xo.cfm/hello
hello/dookie.cfm
dookie/hello.cfm?thisvar=dookie
/
[/code]

And the following requests are not proxied:

[code]
/hello.html
hello.html
hello/hello.html
[/code]

Obviously these are just basic test cases, but it should leave all CSS, image, JavaScript, etc. type requests to the webserver, and pass on everything else to the app servers. You would also need to change it to include direct requests for .cfc files if you’re doing anything like Flash Remoting, Web Services, etc directly to CFC’s.

Getting Behind Python: Sun Hires Python & Jython Developers

Tuesday, March 4th, 2008

As both a fan and user of the great technologies Python, and the Sun JVM (primarily via Java), jython.png I was very happy to come across this eWeek article which says that Sun announced the hiring of two key Python engineers. You can read more about the hiring of Ted Leung and Frank Wierzbicki at their respective blogs.

I had pretty much written off Jython as being dead quite some time ago, but luckily it has had a lot of recent activity and is starting to catch back up with C-Python. By both hiring key JRuby and Jython developers, it looks like Sun is making sure the JVM stays relevant beyond Java and continues to evolve as what in my opinion is the best option for cross-platform applications.

Having a long background in ColdFusion (an Adobe language which compiles down to Java bytecode and runs on the JVM), I’ve seen first hand the benefits of moving a language to the JVM, and I look forward to seeing more progress on both JRuby and Jython on the JVM.

Maven: Including Axis2 Artifacts into EAR’s

Wednesday, January 30th, 2008

I’m going to skip over a rant about how much Axis2 sucks in order to pass a tip on how to include Axis2 artifacts (AAR’s, MAR’s, etc) into an EAR file using the Maven plugin to package EAR files, maven-ear-plugin. It’s a pretty obvious solution but if you’re in a hurry like I’ve been to convert a project from a single WAR to one with several EJB’s, a WAR, etc, there are a lot of new things to learn all at the same time (how classloading works with EAR’s in JBoss, how to share the same Hibernate transactions between your web app and EJB’s, etc), and this was one of those little things which wasn’t immediately obvious. If you’re seeing exceptions like these when trying to package an EAR in Maven:

[code]
[INFO]
————————————————————————
[ERROR] BUILD ERROR
[INFO]
————————————————————————
[INFO] Failed to initialize ear modules

Embedded error: Unknown artifact type[mar]
[INFO]
————————————————————————
[DEBUG] Trace
[/code]

… you’ve came to the right place. :)

There are many ways to setup your package structure under Maven2 to build EAR’s, but essentially what I do is create a root level project which packages a given application into an EAR, and nothing more. Once you have the maven-ear-plugin setup for the most part, all that you need to do is to tell the Maven EAR Plugin to treat the various Axis2 pieces of shit packages like JAR’s:

[code]

maven-ear-plugin



true






[/code]

This is just one of many gotcha’s I learned about while working on an aforementioned project. In fact it’s really pretty hard to find any comprehensive documentation on getting EJB3, Spring, and Hibernate working together on JBoss with a typical Java web application, especially while using Maven. I have a sample project I used to work through some of the integration issues with this, and will hopefully be able to wrap it up and add it to Google Code in the next few weeks to provide an example of getting all of these technologies to play together.

News Flash: Apple Finally Released Java 6 for MacOS X!

Friday, December 14th, 2007

UPDATE: I was up too late, and didn’t notice that it’s update 6 for Java, not Java 6. This is just another update for Java 5… *sigh*

I’ve been up pretty late doing a little work and tying-up some last minute Christmas shopping, and out of the blue this Apple update window popped-up:


Java 6 for MacOS X is here!

I’m super glad to finally see an Apple release of Java 6! I’ve been developing with SoyLatte lately and was going to write a quick tutorial on how to get it up and running on MacOS X, so I guess I don’t necessarily need to do that now. Although given Apple’s secrecy about Java releases and the future of Java on MacOS X, it certainly doesn’t hurt to have an alternative around.

I’m still on Tiger– I assume Leopard users are seeing this update too?

Java 6 for Developers on MacOS X: SoyLatte Reaches 1.0

Thursday, December 6th, 2007

For those many of you (including myself) who have been waiting almost a year now for Java 6 to be properly supported on the Mac, the wait is over if you’re a developer– Landon Fuller has released SoyLatte 1.0, which is a port of FreeBSD Java 6 to MacOS X which will eventually end-up as part of the OpenJDK. This seemed to come together very quickly once Leopard came-out and was missing Java 6.

Though Java 6 didn’t provide quite as much new syntactic sugar as Java 5, the performance increases in Java 6 are pretty dramatic. I highly recommend giving Java 6 a look if you’re doing any development which runs on the JVM if you haven’t already switched.

Keep in mind that this is mostly a developers port as it’s not yet integrated into Cocoa, the MacOS X native GUI. Desktop applications will run under X11, but this is the next hurdle to tackle (though it seems to be a pretty big one).

Just Installed MadKast - Blog Sharing Made Simple

Saturday, September 29th, 2007

I’ve been heads down coding for what seems like 8 years now when in reality it’s just a few months, so I’ve been a little out of touch with what else is going on in the Boulder start-up scene. This also explains my spotty blog posting, but hopefully I’ll get a chance to post a bit more frequently soon. Josh from MadKast recently contacted me about installing their product, so I decided to give it a whirl. (On a side note, I have no affiliation with them at all, I just like to support fellow start-up companies.)

What is MadKast? I guess I would describe it as the FeedBurner of social bookmarking & discovery– it gives your blog readers a way to share your posts, and also supposedly gives you a way to see other sites that your readers are viewing, analytics behind what your readers are sharing with other people, etc. I haven’t yet received any sort of confirmation e-mail about a way to login and view this information, but maybe that happens automagically once they have some data to work with. Until then I don’t have a good idea about the latter parts, but the concept seems cool at least.

Just thinking about how functionality similar to this usually works, I fully expected to have to go download a Wordpress plug-in, unzip it and SCP to my server, then enable it in Wordpress and have to edit my post templates, etc. I never really looked into it because I just assumed I’d have to go through all of that work and I honestly just don’t have the time or interest currently for that. I’m just spending an hour today to try and get caught-up on personal e-mail and decided to give it a whirl. When I saw that I just needed to include a link to their script, I was still a bit skeptical thinking I would still need to edit my post template to get it to work. Not so– it literally took just a few seconds to get up and running on my blog, so color me impressed.

I’m interested to see what sort of information I can gleam from the analytics portion of MadKast, and hopefully I can start blogging somewhat more frequently soon to make that sort of thing more valuable to me. I do feel like my site is starting to get a bit widget heavy, but it still seems to load quickly for now.

Have you tried MadKast? What do you think about it? Have you seen the analytics portion of it?

Farewell CFDJ: My Last Year on the Editorial Board in Review

Monday, September 10th, 2007

Although this is a topic which has gotten much coverage, to the point of beating a dead horse, I felt obligated to comment on it as someone who served on the Editorial Board of the ColdFusion Developer’s Journal until is was recently shuttered.

When I was originally asked to join the board, I had some strong reservations about it for many reasons, but decided to give it a try for the purpose of helping out the community in a constructive way. For instance, I’d heard about a previous editorial board for LinuxWorld who all resigned at the same time, I think not compensating people who contribute to the magazine is completely unethical, and their website reminds me of a “warez” site where popups, videos, and all kinds of other annoying crap invade your computer. Despite all of that, I assumed that being part of an editorial board would help voice developers concerns like “Your site makes the baby Jesus cry, make it stop!”, “What kind of monkeys are editing the articles?”, and “Why do you keep stealing people’s content and publishing it as your own?”.

I thought perhaps as a board member, I’d have a chance to read articles which were still in draft and help with the code and articles, offer suggestions, and maybe even catch some of those typos which seem to plague the CFDJ. Having worked in ColdFusion for (at the time) 8 years, writing somewhat useful blog entries for quite some time, as well as doing tech editing for a ColdFusion book, and having a Computer Science background (kind of a rarity among CF Developers?) this seemed like a pretty good fit.

Instead, I think it just entailed having some community names added to the board to show that they were involved but in reality none of the people listed had any say in anything, nor even had any idea what things were being put in each issue. We never saw any articles, or even previews of what a printed issue would look like. I would have even appreciated a free subscription for writing and editing articles, but I never got that either– it certainly wasn’t worth paying for. I saw the final version of magazines the same way everyone else does, by going to the PDF download site. As others have noted, we had no idea it was being shut down until the entry was posted at the CFDJ itself.

I really never went out of my way to promote the CFDJ or even write new articles for them because it didn’t seem like anything had changed. It fact, it only got worse as time went on– it was hard to even get any sort of e-mail response from anyone on SysCon on the editors mailing list as time went on.

That said, the board really put a lot of time and effort into trying to breathe life back into the publication, but it was for little to no gain. It is with a little sorrow however– I can remember when I was first getting started with CF how valuable the publication was. I’d say most of us were all ready to resign out of frustration, though it wouldn’t have really mattered since communicating with SysCon has been like talking to a black hole for quite some time.

I think the only way I can sum this up is– I for one welcome the Fusion Authority overlords.

Dilbert Groks Java

Friday, September 7th, 2007

I can’t say I’m an avid reader of Dilbert by any means, but today’s comic features a mention of Java:

Don’t bother. I already coded a Java app to do everything you do.

Good stuff.

Development in Mac OS X: How To Fix the Lame Default Font in Eclipse

Wednesday, July 11th, 2007

The default Eclipse for Mac OS X font is kind of annoying since it’s way too big and reminds me of MS Comic Sans. If you try to replace it with one of the wonderful ProggyFonts without tweaking them first, you get stuck with anti-aliased fonts that look terrible. During my quest to get past this problem, I came across a way to setup a more programming friendly font in Mac OS X which uses one of the Proggy Fonts in aliased mode.

Although the above instructions aren’t terribly explicit, you can find the various Eclipse font settings under Eclipse > Preferences > General > Apperance > Colors and Fonts once you’ve installed the font and made the appropriate changes to your System Preferences.

Adobe ColdFusion 8 Public Beta Now Available

Tuesday, May 29th, 2007

Hey look, the public beta of ColdFusion 8 is now available for download at Adobe Labs. This is the beta you have been looking for.