Archive for the 'BlazeDS' Category

Custom JDBC (MySQL) Realm Authentication with Livecycle Data Services (or BlazeDS)

LCDS ships with the default Tomcat roles based security ready to go. You simply add some users to the tomcat-users.xml and there you go. This is probably fine for some, but for my needs I want to be able to authenticate against a MySQL database. I addition, I want to use strong encryption to protect my users personal information, as well as potentially sensitive business data. In this article I am going to explain how to configure Tomcat and Livecycle Data Services to do just that. It is actually fairly painless, once you get all the pieces put together. Hopefully this will be an area of the LCDS documentation that will get some attention in the future.

There are many robust frameworks available to Java that provide authentication functionality. In addition to that, they provide a level of complexity that I want to avoid. My primary purpose is creating enterprise Flex/AIR applications with a strong service layer provided by LCDS. I simply don't want to learn the intrict workings of Spring, JBoss Websphere, or any of the other fine solutions that might solve this particular problem. What I want is a simple solution that provides the functionality I need without a host of extra features I won't ever use. My finite capacity for new information needs all the filtering it can get.

Continue reading 'Custom JDBC (MySQL) Realm Authentication with Livecycle Data Services (or BlazeDS)'

BlazeDS, Vista, and Streaming AMF Channels - For the Children

Maybe this isn't true for every installation of Vista, but we were having a helluva time tonight getting BlazeDS streaming AMF channels to communicate from an AIR client running on Vista. We were just trying to use the default example chat application to do some testing with AIR. It works great on XP, no problem at all. I sent out the little client to 4 or 5 people and it worked just as expected - that is until it hit a Vista machine (dum dum duuum).

Vista wouldn't connect at all, blank, nothing. I added some error checking to the application and it simply reported back that it couldn't connect. What the hell? My initial assumption, which turned out to be [edit] not so [/edit] correct, is that maybe Vista just sucks. After hours of combing the internet for The Answer™, I was having no luck what-so-ever.

Finally it occurs to me to check the Tomcat logs. Hey, a clue!

 [BlazeDS] [ERROR] Endpoint with id 'my-streaming-amf' cannot service the streaming request made with  HTTP 1.0. Only HTTP 1.1 is supported.

That's weird, you'd think the MOST ADVANCED OPERATING SYSTEM KNOWN TO MAN (this is a joke, calm down linux/OS X aficionados) would be using the current protocol, and not something relegated to Windows 98 and IE 5.5. At least now I have something to search for, and search for, and search for...

There was one mention on Christophe Conreate's blog, but no solution was provided. The BlazeDS DevGuide on Scribd mentions the following:

The streaming AMF and HTTP channels are HTTP-based streaming channels that the BlazeDS server can use to push updates to clients using a technique called HTTP streaming. These channels give you the option of using standard HTTP for real time messaging. This capability is supported for HTTP 1.1, but is not available for HTTP 1.0.

This seems reasonable. AIR is advanced technology. It should be using the current standard in HTTP protocols, but why is Vista screwing me around? Getting desparate I am throwing out edge case searches and find this gem on techalicious.tv about 'hacking' IE7 to allow more than 2 downloads at a time.

HKEY_ CURRENT_USER\ Software\Microsoft\ Windows\Current Version\Internet Settings

Hey, what's that? A reg key marked EnableHttp1_1 - which on my XP Machine is set to 1. Guess what it was set to on the Vista machine? 0. Yes, HTTP 1.1 was completely disabled. The key ProxyHttp1.1 was also set to 0, which isn't a key on XP. We had checked in Charles, and all browsers including AIR were using 1.0. This made a lot more sense after the regkey was discovered. After a reboot everything works fine.

This setting can be changed without hacking the registry in the control panel under Internet Options>Advanced>HTTP 1.1 Settings. User Error? Safety Conscious OS defaults? Switch happy application install? I don't know.

If somebody could provide an explanation of what might have caused this, or if by some off chance somebody reading this is actually using Vista could check this key and see if it is on or off, it would be appreciated. Otherwise I am baffled, yet really really happy to have squished this particular bug.

Onward.