Monday, December 26, 2005

AJAX Experience...Yet another boondoggle

A colleague of mine upon hearing of the Spring experience, said "what a boondoggle". That captured exactly how I felt about it.

Now, I don't object to one man's opinion of enterprise. I know Jay Zimmerman and I applaud him for putting up a fabulous show time and time again with his No Fluff Just Stuff series. However a symposium just on Spring? C'mon. If you are new to Spring, a symposium isn't a way to learn to use it. If you already using Spring, you may get something out of 10-20% of the sessions. How do I figure? Due to many level 101 sessions, and others that you can't attend due to conflicts.

Hard on its heels comes the AJAX experience. A symposium essentially on one Javascript API call! Do we really need a conference on AJAX? Aren't there enough online articles, blogs, and books (don't get me started) on the subject?

My prediction: Coming soon shall be a Ruby Experience -- which actually is a topic worthy of an "experience". I guess what I really envy is Jay's entrepreneurial spirit. You go Jay!

Thursday, July 21, 2005

Maven catch-22 with multiproject builds

Maven's multiproject plug-in is a very useful tool on a large project that's been organized into several sub-projects. Using the dependencies the reactor figures out the correct order in which to build the entire project. However Maven gets in its own way when doing such builds. Here's how:

Consider a multiproject with sibling sub-projects that are interdependent. Having been bitten one too many times for not doing so, I have become fastidious about maven cleaning before every build. Just as with any other plugin, when you invoke clean, Maven checks the dependencies. However, when this happens the first time the multiproject is being built, the dependencies cannot satisfied and so the build quits with a failed dependency.

If you are wondering why get so anal about cleaning and that it isn't needed before the first-ever build, consider setting up your builds to be managed by CruiseControl. That's an automated process and needs to be given the goal(s) that must be executed at every build cycle.

So, the only solution I know is to perform a one-off build manually without a clean and then let CruiseControl loose. Can you suggest a better alternative?

Speaking of cleaning and multiprojects, why doesn't multiproject:clean clean the root directory? Why do I have to maven clean multiproject:clean?

Monday, June 13, 2005

Reasons to attend a NoFluffJustStuff conference

I just spent the last three days at my third NoFluffJustStuff conference -- the Research Triangle Software Symposium. My brain is full and I am wiped and extremely invigorated!! It is my annual shot-in-the-arm booster that makes me look forward to going to work! Here are some of my reasons why you shouldn't miss the next opportunity. (Of course you can also see their top-10 reasons):

The speakers: The speakers are uniformly exceptional. They not only know what they are talking about, they want to be on the stage and are good at it. Further, they don't mind answering questions -- and not just during the session. Speakers are routinely found mingling with the attendees at lunch and breaks.

Constant innovations: In the three years that I've been attending these conferences, it has constantly been evolving, never leaving well enough alone. First it was end-of-day keynotes, then it was the introduction of .Net topics, then it was BOFs, web-site with speaker blogs, etc etc.

Timely topics:At any given time there are invariably 5 active sessions. The topics being discussed at these session are not only of high quality, they are timely. Let's take the latest conference. There were sessions on AJAX, Tapestry, Spring, Hibernate, Ruby, Rails, the list goes on.

Doesn't cut corners: The high quality doesn't stop with the speakers and the sessions, it includes the other amenities. You get all the session materials on CD, with binders, in a nice laptop carrying case (another innovation for this year). Meals (read: breakfasts, lunches, snacks and opening night dinner) during the conference are provided. Jay Zimmerman (the organizer) could very easily have just thrown in the "continental breakfast" fare. But meals here would put most restaurants to shame. There is of course the obligatory raffle during the conference. Even there this one outshines. There are two raffles. At the recent conference, up for grabs were books, an iPod and the new Sony PSP.

I think there are about 28 events over the course of the year at different locations across the US. So, if you are in the country, chances are, there is one in your neighborhood. Don't miss it.

Thursday, May 12, 2005

Freeware installer recommendation?

I have been using Null Soft's product and frankly, I just don't get the NSI scripting language. It just seems too arcane and doesn't seem to flow right -- if you know what I mean. I spend more time digging through the help docs and Googling to figure out how to get something going.

I would welcome any alternative tool recommendation -- freeware of, course :) My target environment is Windows and so the tool doesn't have to be cross-platform capable.

Tuesday, May 10, 2005

Visualizing Web Logic's domain configuration

Web Logic's config.xml is the center of WL universe. This is what WL uses to keep track of all servers, deployments, services etc and is one gnarly XML file. Yes it isn't for human consumption but it helps to be able to read it when diagnosing problems. Now you have a handy-dandy XSL stylesheet that'll present this file in HTML. Element names are hyperlinks. Following these links takes you to the appropriate reference documentation page. Now, why didn't I think of that? This works with IE and Firefox although with the latter it doesn't work for a file:// URL. Any ideas why?

Attributes: I can't place the actual blog where I came across this tip. So thank you, anonymous.

Wednesday, April 20, 2005

StrutsTestCase and Tokens

How does one get around the usage of Struts tokens when unit testing using StrutsTestCase? If the action class under tests for duplicate submissions using tokens,

if(isTokenValid(request) == false) {
// don't perform the action and route the user
// to an appropriate location
}

it'll always fail. This is because, the token is set in the request by the tag and of course when running a StrutsTestCase, the JSP isn't involved.

The application functions correctly, however, I cannot run my unit tests :(

Thursday, April 07, 2005

Clustering mutable objects

One of things a clusterable application server (for example, Web Logic) does for an application is to broadcast objects placed in the user's session. This happens (at least with Web Logic) whenever the application invokes the setAttribute method of the HttpSession interface. This has a subtle impact when the thing being placed in the session is a mutable object. To explain, first consider a simple (non-mutable) example

1: String name = "John";
2: session.setAttribute("username", name);

The application server will serialize the value associated with the key username to all the nodes in the cluster. Now suppose that the node executing the above steps turns around and changes the value of name. IOW

1: String name = "John";
2: session.setAttribute("username", name);
..
15: name = "Mary";
16: String sessionValue = (String)session.getAttribute("username");

Since Java passes a copy of a reference to a method call, sessionValue is guaranteed to be John -- on all the nodes. No harm. No foul.

Now consider placing a mutable object such as a java.util.List in the session.

1: List cart = new ArrayList();
2: session.setAttribute("shoppingcart", cart);

Just as with the String before, this will get propagated to all the nodes in the cluster. Now suppose the cart is updated in one of the nodes:

1: List cart = new ArrayList();
2: session.setAttribute("shoppingcart", cart);
..
19: cart.add(aLineItem);
..
// More business logic
25: List sessionValue = (List)session.getAttribute("shoppingcart");
26: System.out.println("Cart size = " + sessionValue.size());

Now, line 26 above will display different values depending on the node on which it was executed. The node which added the item to the cart will display Cart size = 1 while the others will display Cart size = 0.

This is bad! This can be avoided if we place an item in the session as the last step of responding to a user request. Application development and application deployment are -- in large part -- independent activities. This is an instance where the developer needs to be aware that (s)he is developing an application that's going to be deployed to a clustered environment.

Monday, March 07, 2005

Jira's service -- Legendary or just a legend

[Updated: See end of posting]
Recently, we came across some critical problems with our Jira installation. When we couldn't figure out/fix the problem ourselves, I posted a support request to Jira's support site. In response, I received a request for additional information. Since the request involved a fairly sizeable attachment I wrote back to clarify the request. Didn't get a response. I decided to send the attachment anyway and updated the support request with the required information and waited for a response. That was 4 days ago...The silence is deafening.

When you stick your neck out so far and claim "Legendary services"....well, you have to deliver. Atlassian's web-site quotes Jeff Bezos

"If you have an unhappy customer on the Internet, he doesn't tell his six friends, he tells his 6,000 friends"

The trouble is, there is no apparent way to escalate an issue. I couldn't find a phone number to call or any other email addresses -- other than for sales. I finally located a contact page. I filled out the form stressing the urgency of our problem and asking about an escalation process. Still not a peep.

We were considering purchasing Confluence. The one reservation that I had thus far was the lack of coherent documentation. I am now wondering if going for Confluence would be wise given the trouble I'm having with Jira; which, btw has excellent documentation.

I realize the irony of using javablogs to publish my gripe...

[Update: Mar 9 2005 2300]
Since originally posting the above, I have heard back from Atlassian. I hope the timing was just a coincidence.

The problems are being handled.

Tuesday, January 25, 2005

Struts and checkboxes

The following is a reminder to those working on implementing checkboxes on their pages.


It is essential that you implement the ActionForm's reset() method. In this method, you must set the fields that populate the checkboxes to false. The reason is that an HTTP request only includes values for selected checkboxes. Any de-selected box will not be a part of the request and so the server-side will be none the wiser that a user un-checked a box.

An important side note (one that cost me quite a while): The reset() method is overloaded with the following variants

 

void reset(ActionMapping mapping, ServletRequest request)

and

void reset(ActionMapping mapping, HttpServletRequest request)


For a web UI, you need to implement the latter. If you use your IDE's intellisense, it is easy to accidentally pick the former since it shows up first in the list of choices.

Tweety thoughts

    follow me on Twitter