Friday, June 19, 2009

LiveCycle Data Service 3.0 Beta available

We launched LiveCycle Data Services (LCDS) 3 public beta yesterday on http://labs.adobe.com/technologies/livecycle_dataservices3/.

We have beefed up tooling and simplified developing flex application development. You can now develop new fully functional flex applications with no server code in under 10 minutes. We have a few videos to help people get started http://labs.adobe.com/technologies/livecycle_dataservices3/videos/, and plan to add more (I am on the hook for one or two).

Now is the chance for folks to try out the new Data Model development features we have added and give us some feedback.

Wednesday, June 10, 2009

ColdFusion 8 Performance Tuning

Check out this new Dev Center article written by Kunal Saini - Performance tuning for ColdFusion applications. Lots of good information on VM tuning, Administrator settings and CFML code writing.

Tuesday, May 12, 2009

Brendan Meutzner on LCDS and CF

I recently had an email exchange with Brendan Meutzner about a problem he was trying to solve when using an integrated ColdFusion and LiveCycle Data Services system. He wanted some way to use dynamic data sources in his LCDS assembler CFC. He blogged about his problem and the solution here.

Thursday, April 23, 2009

Make ColdFusion 8 work with Apache CXF

"Alan" left a comment on one of my older posts ("ColdFusion 8 Getting Started code available") detailing how to get ColdFusion 8 to work with Apache CXF. I figured it would be useful to repost in its own entry.

DISCLAIMER: I have not tried this, nor do I make any guarantees that this wont do bad stuff to your server. Try it on a Developer Edition on your desk before messing with any production server.


If anyone is interested, I have been able to make ColdFusion 8 work with Apache CXF, which supports a variety of web service standards and libraries - SOAP 1.1, SOAP 1.2, REST, etc.

Caveats: CF8 works with CXF in the sense that CXF objects can be instantiated as Java objects in CFML and their operations successfully invoked. It does NOT work as a native CF web service call using or CreateObject("webservice", "..."). Also, this technique requires some low-level changes to the default CF8 installation, so it is not for the faint of heart.

In general, the procedure is to grab the CXF libraries and get CF to recognize them. You can drop them directly into a /lib folder that's in the CF classpath, or if you want to be a bit more cautious you can point the CF classpath to the folder that contains the CXF JAR files.

Detailed steps:
  1. Download the latest CXF distribution and extract/install it somewhere. If your CXF root is /foo, then find /foo/lib. You'll see a bunch of JAR files, and your mission is to get CF to recognize these files and load the classes in them.

  2. Stop the CF server.

  3. CF8 and the JRE that comes with it use an older, incompatible version of the JAXB library, so we need to get the newer one in place. Create /foo/lib/endorsed and copy the jaxb-api-version.jar file into that folder.

  4. Find jvm.config in your CF installation and open it in a text editor. Append the following to the JVM arguments: -Djava.endorsed.dirs=path_to_foo/lib/endorsed -Djava.protocol.handler.pkgs=javax.net.ssl. Find the string -Dcoldfusion.classPath= in the JVM arguments and place the path to /foo/lib immediately after the equals sign (i.e., at the FRONT of the classpath), with a comma to separate it from the rest of the classpath entries. Do not set the classpath using the CF administrator. It will not permit adding elements to the front of the classpath, and will in fact overwrite the classpath if it is used to change Java settings at any future point.

  5. A suspected bug in the CF classloader causes the wrong part of the CF architecture to load the SAAJ classes. [Tom Here: This isn't a bug, CF maintains absolute control over which classes it loads via its own classloader. A better workaround would be to edit the jrun.properties file in the WEB-INF/lib/cfmx_bootstrap.jar file and change the exceptions list] Get around this by copying /foo/lib/saaj-api-version.jar into {java.home}/lib of your CF installation. Then delete or rename saaj-api-version.jar in /foo/lib so it does not get loaded from that location. Also delete or rename saaj.jar from the main CF library location (ColdFusion8\lib on a Windows installation, standalone configuration).

  6. Disable the native JAXB library in ColdFusion by deleting or renaming jaxb-impl.jar in the main CF library location.

  7. Restart the CF server.


With these steps, you will be able to invoke Java objects that serve as clients for the web service endpoints. These Java objects need to be created, compiled, and installed to a location in the CF classpath in order to be invoked. The CXF documentation describes ways to create the Java objects; wsdl2java might be your best bet. You can have it create classes that are SOAP 1.1 and SOAP 1.2 compatible, allowing you to call those services via the Java objects from inside ColdFusion files.

After doing this, I did a cursory test of the native CF web service functionality (Axis 1.1) and it seems to work still, so existing code shouldn't be affected.



There ya go, I would be interested in posting an update if Alan or someone else figures out what the classloading issues with the SAAJ libraries are.
Thanks Alan!

Tuesday, February 17, 2009

Contribute CS4 does blogs

I recently had to re-image my laptop (note to self: make sure disk de-fragmentation software is known to work with exactly the version of disk encryption software you have installed on your system), so I had to re-install all of the software that I think I need to do my day-to-day. For me this includes development stuff like IntelliJ IDEA, Perforce, Eclipse, FlexBuilder, ColdFusion, TortoiseSVN, etc, etc.

Eventually I want to actually edit some HTML for some reason, so I need to get a copy of Dreamweaver.  Plus Homesite+ 'cause I am still old-school when I need to edit CFML.  I have a secret stash of Homesite+ (we haven't sold it as a product in quite a while), but I like to stay current on Dreamweaver cause they be adding in some good stuff that I'll probably never use, but I like to know that I have it.  So I went looking for the CS4 - Web Premium installer.

I found it and after installing the 4 Gigabytes worth of software, I had my Dreamweaver CS4 along with ~10 other programs that all look really neat and that I will never use in my day job of writing Java server code.  But again, its nice to know that I have it and hey there are some perks to working at Adobe, like being able to install $10,000 worth of software you probably wont use on your Adobe laptop (did I mention the disk encryption software?).

To make a long story longer, one of the included programs was Contribute CS4.  I love Contribute and in fact have written lots of ColdFusion specifications using it (now we write specs in a Wiki, which is the spawn of the devil, but I think that is the topic for another post).  By this point, it should come to no surprise to those who have read the title of this entry that I am typing this very blog post in Contribute.  And I must say it's really nice.  It integrated with Blogger quickly with just the entry of my user name and password.  The editor grabs the look and feel of my pages and does a real nice job of showing me how the final post will look.  There are IE and Firefox plug-ins that give me one button access to create a new post.  All-in-all it is a very nice interface and the Contribute team has done a great job with this release.

So I lied, maybe I will use some of the other software included in CS4.  Now if I could just figure out how to use Photoshop....


Thursday, January 08, 2009

Happy New Year

Happy New Year. I realized I haven't posted anything for quite a while. I have been heads down working on the next version of LiveCycle Data Services, which of course I can't talk about. :-) So here is wishing you and yours a happy, healthy 2009.

Wednesday, October 22, 2008

LiveCycle Data Services Capicity Planning Guide

Adobe has published a Capacity Planning Guide white paper that gives guidance and test results on how LiveCycle Data Services scales up to to thousands of end users.

Stealing from the introduction:

This document presents the results of software benchmark tests performed by Adobe engineers in 2008. These tests show how LiveCycle Data Services 2.6 software can scale and perform under load using various messaging scenarios that represent real-world situations. The goal of this paper is to provide a starting point for those who need to plan a hardware and software infrastructure that can scale to meet peak demand.

Check it out here: Adobe LiveCycle Data Services 2.6 Capacity Planning Guide

Friday, August 29, 2008

BlazeDS HTML LiveDocs updated

The BlazeDS HTML Livedocs are now updated to match the updated PDF files I posted about a while ago. This brings the BlazeDS document up to date with the release of LCDS 2.6, including a much better organization of the chapters to explain the RPC and messaging concepts.

I think most folks use the HTML version, not the PDF (I know I do), so it was pretty confusing having two different versions of the doc around, with the most popular being the out of date version.

Thanks to the documentation team for responding to our complaints!

Invoking Flash remoting requests using the Java AMF Library

In a follow up to my recent post about the new Java AMF client available in BlazeDS, I was recently asked how to send a 'typical' flash remoting request to ColdFusion.

Here is how you do that in Java:

Object[] args = ...
String sourceName = "my.cfc.path.Component";
RemotingMessage message = new RemotingMessage();
message.setMessageId(flex.messaging.util.UUIDUtils.createUUID());
message.setOperation("myCfcFunctionName");
message.setBody(args);
message.setSource(sourceName);
message.setDestination("ColdFusion");
Object returnValue = amfConnection.call(null, message);

and accessing the body of the response like this.

Object body = ((AcknowledgeMessage) returnValue).getBody();

Not that the "args" variable is an array of the arguments you are passing to the CFC function. It can also be a Java List, or a simple object. See the BlazeDS source for RemotingMessage.java for details. This sends the same kind of message that the mx:RemoteObject tag does in MXML, so in ColdFusion terms you are using the "Flash Remoting Update". If you use the 'raw' AMFConnection API, you would be using the "classic" Flash Remoting. Both will work, but I recommend using the RemotingMessage style.

What does this do for you? Well if you are exclusively using Flex as a client, not much. But if you would like to write Java code to invoke a CFC, this alows you to do that very easily.

Wednesday, August 06, 2008

New Java AMF Client feature in BlazeDS

You may not have noticed, (what, you aren't subscribed to the BlazeDS commits forum?) but a few weeks ago Mete committed an enhancement that adds a Java AMF client API to the flex-messaging-core.jar file in BlazeDS.

You can find a specification posted here and its linked from the Developer Documentation page.

What does this do? Well, you can use this API to call (from Java) Flash Remoting end points in BlazeDS, LiveCycle Data Services, ColdFusion, PHP or whatever you have that supports AMF. Which of course is a published specification.

This feature is available in any nightly build after 3.1.0.2602 or in the trunk nightly build. Find those builds on the BlazeDS build download page.

Thursday, July 31, 2008

BlazeDS Documentation Update

The documentation team has posted an update of the BlazeDS documentation that includes all of the relevant content from the new LCDS 2.6 Developers Guide.

By the way, here is a gateway page to all of the LCDS 2.6 documentation, which has been reorganized to be much easier to read and use.

The HTML in Livedocs has not been updated yet, but a new PDF version is available.

See details on the Flex documentation blog here.

Tuesday, July 22, 2008

AIR Data Synchronization via LiveCycle Data Services ES 2.6

This is a nice article on the offline sync feature of LiveCycle Data Services 2.6 - AIR Data Synchronization via LiveCycle Data Services ES 2.6. It was written by John C. Bland II.

I worked on this feature for LCDS 2.6 (which by the way just got released last week). The SQLite DB built in to AIR is really nice to work with and the Actionscript APIs for using it were nicely designed by Jason, one of my coworkers here at Adobe.

I think the offline feature is pretty neat. There is still lots of room for improvement, but the basics that we do have are pretty powerful. We are in the planning stages for the next LCDS release and I expect that improving our offline story, particularly for AIR, will be on the list.

Check it out!

Friday, July 11, 2008

Setting optional parameters in the SMS Gateway

Paul Hastings sent me a questions yesterday about the ColdFusion SMS Event Gateway. He wanted to know how users could set their own optional parameters in the text messages sent from the gateway. He blogged my answer, which means I can just link to it without writing it up myself.

A few notes: If the gateway receives optional parameters in a message, it will be included in the data struct that is returned to the onIncomingMessage CFC function under the "optionalParameters" key. CFDump to a file or console is your friend in these cases.

If you do not format the key (has to be able to be parsed by the Java Short.decode(String) function) or the value (must be a byte[], which in CFML is a "binary object") correctly the setting is silently ignored.

This functionality has been in the SMS Gateway since 7.0.2. It is not in the 7 or 8 documentation, which is bad, but we will correct this moving forward.

Wednesday, July 02, 2008

Special Axis types and ColdFusion

A mere hours after I posted about how to figure out why CF does not like the arguments you are passing to invoke an operation in a web service, Sean Corfield pinged me with a problem exactly like that. Feeling pretty good, I pointed him to the post I made hours before. He of course had already tried the wsdl2java trick and still could not get CF to do the deed.

He sent me the WSDL and his test and everything looked OK. It was a pretty complex input to an operation (names changed to protect privacy):
public com.example.RegisterResponse register(com.example.RegisterRequest parameters)

The RegisterRequest was a JavaBean that included the following members:

private java.lang.String sessionID;
private com.example.ThingyType importantThing;
private com.example.ThingyType otherThingy;
private com.example.ThingsILike likeList;
private org.apache.axis.types.UnsignedInt duration;

Fun stuff. Sean had done all the right things creating CFML structs that matched each of the JavaBean types (ThingyType, and ThingsILike). ThingsILike was interesting because it contained a single item that was an array. His code was right on the money here, notice that the ThingsILike object had a single member named "things" that was the array. Here is what he did and (rightfully) expected to work:

thing1 = { name = "bobby", location = "Portland" };
thing2 = { name = "sally", location = "Boston" };
iLike = { things = ["Bunnies", "Kittens", "Koalas", "ColdFusion"] };
args = { sessionID = 0, importantThing = thing1, otherThingy = thing2, likeList = iLike, duration = 60 };

Bonus points to Sean for using the new ColdFusion 8 syntax to create arrays and structures. So the array wasn't the problem. What was? Well you may have noticed that duration is listed in the Java function as being of type org.apache.axis.types.UnsignedInt. this is because the XMl Schema type in the WSDL says that the number is an Unsigned Integer:

<xsd:element name="Duration" type="xsd:unsignedInt" />

As an aside here, XML Schema has a lot of different types that elements can be. Things like NonNegativeInteger, nonPositiveInteger and other slightly wacky things. Java on the other hand doesn't have any of these. So the Axis folks (which included me) came up with a set of classes that would enforce the limitations of the Schema types and allow you to 'round trip' a service that you generated from a WSDL, then deployed and allowed Axis to create the WSDL from the Java. This is good, and when you are writing Java directly against the WSDL2Java generated code no big deal because you can pretty quickly notice that you need one of these types and make one.

But back to ColdFusion. In order for the "60" given in the code to turn in to the class UnsignedInt, ColdFusion has to be smart about how to construct this object. It's not. However there is a simple work around - create the object yourself. Here is how that would look:

duration = CreateObject("java", "org.apache.axis.types.UnsignedInt").init(60);

Notice that I call init(60), which invokes the constructor of the class. Setting this object as the value of duration in our argument structure works like a charm. So problem solved, and I hope that we can make CF smarter about these types in a future release, but encountering these XML Schema types in the wild is pretty rare so I don't expect you will need this workaround much if at all.