MyFaces and JBoss built-in implementation

I’m working on a WebSphere-based application, and need to get it running on my Mac. RAD isn’t available for the Mac, and even if it was, it’s so far behind in Eclipse revisions that I can’t use most of the Eclipse plugins I find useful.

So there’s a couple options for developing WebSphere-based applications on Eclipse/Mac:

  • MyEclipse Blue Edition : An Eclipse distribution with WebSphere connectors. Bring your own WebSphere (e.g. WebSphere Express)
  • Make your application portable and develop on another app server : Develop on JBoss & Eclipse, but deploy on WebSphere

Right now I’m going with the second option, since a colleague already did most of the work of getting the application running under JBoss. I took the changes he had to make to get it to run under JBoss, and made them into a patch I could apply on top of the latest code from source control.

So far it’s working great. I just have to be careful to do a regression test in a RAD/WebSphere environment before any changes can be handed over to QA.

I did run into a problem with clashing JSF libraries in JBoss:

09:25:40,120 WARN [JBossJSFConfigureListener] MyFaces JSF implementation found! This version of JBoss AS ships with the java.net implementation of JSF. There are known issues when mixing JSF implementations. This warning does not apply to MyFaces component libraries such as Tomahawk. However, myfaces-impl.jar and myfaces-api.jar should not be used without disabling the built-in JSF implementation. See the JBoss wiki for more details.
09:25:40,126 WARN [config] Unable to process deployment descriptor for context ‘null’
09:25:40,443 ERROR [STDERR]
java.lang.UnsupportedOperationException
09:25:40,444 ERROR [STDERR] at com.sun.faces.config.ConfigureListener$InitFacesContext.getViewRoot(
ConfigureListener.java:1690)
09:25:40,444 ERROR [STDERR] at com.sun.faces.util.MessageFactory.getMessage(
MessageFactory.java:113)
09:25:40,444 ERROR [STDERR] at com.sun.faces.util.MessageUtils.getExceptionMessageString(
MessageUtils.java:277)
09:25:40,444 ERROR [STDERR] at com.sun.faces.config.ConfigureListener.configure(
ConfigureListener.java:855)
09:25:40,444 ERROR [STDERR] at com.sun.faces.config.ConfigureListener.configure(
ConfigureListener.java:502)
09:25:40,444 ERROR [STDERR] at com.sun.faces.config.ConfigureListener.contextInitialized(
ConfigureListener.java:402)
09:25:40,444 ERROR [STDERR] at org.jboss.web.jsf.integration.config.JBossJSFConfigureListener.contextInitialized(
JBossJSFConfigureListener.java:69)

The MyFaces Tomahawk components are an implementation of, and extension of the standard JSF components. This complicates things because when you use application servers that bring their own implementations, such as JBoss and WebSphere, you have to somehow get the application server to not load its implementation ahead of MyFaces. I wish MyFaces had just made their extended components use a separate namespace and we could then use their components while still keeping the application server JSF implementation.

For JBoss, the solution is to set a parameter that instructs JBoss to ignore its own JSF implementation in favor of yours. The following article describes the solution:
http://www.jboss.org/community/docs/DOC-10182

Posted in Java, Web | Leave a comment

Semantic documentation markup languages: XDocs, DocBook, Dita

I’ve been using the Maven XDoc markup language for documenting design on a client project. Looking into editors for XDoc led me to taking a closer look at DocBook, and Dita, a relative newcomer. All of these formats allow you to write documentation in a semantic manner, separate from the presentation. You can then generate HTML, PDF, RTF, etc from your document using your choice of transformers. DocBook has been around the longest, but is still active, with the 5.0 version recently released.

The best editor for these formats I’ve found is XMLMind XMLEditor. Here is information on using XMLEditor to edit XDoc documents. The latest version of XMLEditor supports DocBook v4 and v5 out of the box, and support for Dita can be downloaded as a plugin. Currently I’m leaning towards using DocBook for technical documentation due to its wider support, although Dita sounds interesting.

Posted in Tools | Leave a comment

Change Management and Bug Tracking

A project I’m involved with is in need of a change management tool, so I’m in the process of re-evaluating the landscape of open source change management tools, and testing a couple out.

Change management is one of those software software development practices that I rarely see implemented in IT projects, although it helps to organize development and cuts down on the more tedious project management activities (gathering status, updating detailed project plans). Change management is similar to defect tracking, which is frequently used, but is broader is scope. Defect tracking is really a subset of change management.

In a change management process, every proposed and actual change to an artifact is recorded and tracked in a change management tool. I say artifact rather than code because it can be used to track changes to requirements, test scripts, documentation, design; not just code. Every change to an artifact and commit to VCS has an associated record in the change management tool associated with it, describing the nature of the change, who requested it, what release it was planned for, etc.

Open source projects seem to more frequently use change management, which isn’t surprising considering they are made up of distributed teams who need a good way to keep track of what changes are planned for, and tracking the progress of those changes.

There’s a bunch of open source change management tools out there. Roundup, JTrac, XPlanner, Scarab, Mantisbt, ITracker, Trac, and Bugzilla are the tools I took a look at.

I have several criteria for a change management tool, including:

  • Ability to link one change request to another
  • This can be used to set up dependencies between changes or defects (this bug has to be fixed before that one can) or to break up large changes into smaller ones to be worked on by different people (e.g. have a change request to track the development of a feature, linked to smaller change requests to track the changes to implement the feature).
  • RSS feeds for reports/searchs
  • Support for representing enhancements and defects
  • Support for components, with the ability to assign change requests to components, and to assign owners for each component
  • Easy to administer – Ability to administer products, components, and users through a web UI
  • Ability to authenticate against LDAP
  • Active development community
  • Easy to use, web-based on-demand reporting and charting
  • Can run on Windows (it’s the box I have)
  • Support by Mylyn

I narrowed the choice down to Bugzilla and Trac, and settled on Bugzilla after installing both. I’ve used and installed Bugzilla before, so I was already pretty comfortable with it. The Bugzilla Windows installation has come a long way since the last time I tried it (~2001). Back then I gave up and ended up installing Linux on a box just to be able to run Bugzilla. It still requires quite a few steps, but it worked without too much trouble.

I installed stable version 3.0.4 following the instructions at http://www.bugzilla.org/docs/win32install.html. At a high level, the steps were:

  • Download and unpack tarball
  • Install MySQL 5.0.51a
  • Create Bugzilla database and database user
  • Installe ActiveState Perl 5.8.8
  • Installed a bunch(!) of Perl packages via bundled PPM tool
  • Install & Configure Apache 2.2
  • Had to upgrade Email and Mime related Perl packages (see this blog posting).
  • Download and install Graphviz, and tell Bugzilla where the ‘dot’ executable can be found (Bugzilla parameters->Dependency Graphs)
  • Execute perl collectstats.pl (not sure if this is doing anything)
  • I had to execute the following to get graphical reports to work: ppm install Template-GD
Posted in Software Development, Tools | Leave a comment

Using IntelliJ IDEA

I’ve started using Intellij IDEA as an IDE. I’ve always heard good things about it but stuck with Eclipse because it’s pretty good, and the standard used by most clients I’ve worked with.

What got me to try it out was the Groovy/Grails support. I’ve been doing some work with Grails and had heard they had a good plugin. After working with it a while, the Groovy support is the best out of the three major Java IDEs (Eclipse, NetBeans, IDEA). The Maven 2 support is great too.. It’s by far the best support for Maven 2 in any IDE. There are some features I would still like them to add (such as a Maven repository index/search feature), but the important things work well (handling Maven dependencies).

In general, I find myself having to fiddle with the UI less than I do with Eclipse (configuring and switching perspectives, resizing panes, etc).

The other plugin I was really interested in was the Mercurial IDEA plugin. This plugin is still early in the development cycle. Unfortunately it gave me an error when starting up – it was compiled for JDK 1.6 and I’m stuck with 1.5 on my Mac. I imported the MercurialIdea plugin source into Idea, reset it to use the Idea platform runtime, and rebuilt the plugin without success. No biggie, the Mercurial command line is easy enough to use.

Posted in Software Development, Tools | Leave a comment

OpenID, Yahoo, and other news

Recent OpenID developments…

At the end of this month, Yahoo will be supporting OpenID. Any Yahoo user that chooses to enable the feature will be able to use their Yahoo ID on sites that support OpenID. The announcement doesn’t mention Yahoo accepting OpenIDs from other providers, so this is probably only one-way for now. So put together the population of Yahoo users which are now getting OpenID support, and AOL users, which have had it for a while, and you have a pretty large chunk of the web population that have OpenIDs (once they enable them anyways). Now we need more websites to accept OpenIDs from other providers.

I’m waiting for Acegi to support OpenID so I can build support into a webapp I’m working on. Looks like there’s been some recent progress on that front.

Another OpenID related, if a bit old, tidbit – MyOpenId now supports Information Card as a means to authenticate with MyOpenID. So when prompted to authenticate to MyOpenID, you can present an Information Card and authenticate without using a username or password at all.

Posted in Tools, Web | Leave a comment

Handy Java utility: jarexplorer

Wanted to give kudos to a handy little Java utility I started using: jarexplorer. It’s a Swing-based app that indexes the contents of jar files found in an entire directory structure, and lets you search for classes and files within those jar files. It’s blazingly fast and also provides viewers to look into classes, text files, and images. Double click on the search results and the viewer comes up. Nice to see tools that do one thing and do it well.

Posted in Java, Tools | Leave a comment

Using Mercurial

As I posted earlier, I’ve been looking at some of the decentralized version control systems and started using Mercurial. There are several decentralized VCSs, including Bazaar, GIT, Mercurial, and others. Out of the decentralized VCSs, Mercurial and GIT seemed to have the greatest momentum and adoption rate. GIT is being used by the Linux Kernel, Wine project, and others. Mercurial is being adopted by OpenJDK, OpenSolaris, Mozilla, among others. Having wide adoption and momentum are important to me because I want to use something that’ll be around several years from now and will be supported by GUI tools, build and continuos integration tools, and IDEs.

After looking into both, I ended up going with Mercurial over GIT. Both Mercurial and GIT seem to fit my needs; decentralized, fast, and flexible, but GIT didn’t seem as well supported on non-Linux platforms and the Java IDE plugins are further behind. Mercurial has binaries available for Mac, Windows, and of course Linux. On the Mac and Windows side, there are a couple different options for how to install Mercurial; using a ports packaging system such as Cygwin on Windows or MacPorts on Mac, or installing natively on the OS. The Eclipse IDE plugin is still early in development, but it sounds like the NetBeans plugin is pretty full featured.

When working with Mercurial, everything is a copy of the repository, including branches and the local repository that developers work out of. Each repository is as fully capable as any other and includes all of the change history. It sounds inefficient to have a full copy of the repository on each workstation, but it turns out that Mercurial repositories are usually smaller than a Subversion working directory. This is partly because Mercurial stores changes to files in a very efficient manner, and partly because Subversion stores a significant amount of extra data in a working directory in order to avoid accessing the server for some operations.

In Mercurial, changes to files are committed to a local repository as a unit of work, called a change set. The change sets can then be pushed or pulled from other repositories in order to share work with others. It’s then up to you how you organize your work and manage the exchange of change sets between repositories. You can have a single master repository that everyone pushes/pulls from, you can have multiple masters for better performance and reliability, you can have a hierarchical model where committers receive change sets from the community, then pass it up to module owners, who pass them up to release owners (from what I’ve heard the Linux Kernel is organized in this way), or even have no master and have members of the team exchange change sets directly with each others’ repositories (this sounds like too much work though).

Most of all, I was impressed with Mercurial’s attention to details in their design decisions:

  • Mercurial never makes updates to a revision log of a file, just appends to it. This minimizes the opportunities for data getting corrupted; if you never update or delete data, there is very little chance of it being accidentally corrupted beyond repair.
  • Mercurial stores the diffs to files (text and binary) rather than storing the full copy of a file for every revision. It then “replays” the diffs in order to reconstruct the full copy of a revision of a file when needed. This is much more efficient than it may seem, but after a large number of changes it can become expensive. To compensate for this, Mercurial stores a snapshot copy of a file revision for fast access when the chain of diffs becomes too long.
  • Minimize locking – read and update operations have been ordered in such a manner that locking isn’t necessary for most commands. Reads and clone/pull operations don’t lock the repository at all. Mercurial uses locks to ensure only one process writes to a repository at a time, but read and clone/pull operations are not affected by this.
  • Minimizing filesystem seek operations – Seek operations are relatively expensive, so Mercurial has been designed to minimize this. This is one of the reasons that Mercurial keeps repository metadata in a single directory (.hg at the root) rather than stored with each directory as Subversion does (.svn directories) – having separate metadata directories would require a seek for every directory.

I’ll follow up later with a post on setting up & working with Mercurial.

Posted in Software Development, Tools | Leave a comment

pyAntTasks moved to Mercurial

I’ve started using the Mercurial version control system lately and switched over some projects over to it from Subversion. Since Google Code doesn’t yet support hosting Mercurial repositories, pyAntTasks has stayed on Subversion. Until now that is – I set up a Mercurial repository for pyAntTasks on sharesource here. I’ll also push out any new releases to Subversion on Google Code, so people can still use that as well.

Posted in Python | Leave a comment

This blog is now an OpenID

[update: when I switched to WordPress, I made http://rpstechnologies.net/ron my OpenID page – see that URL instead of this blog for the OpenID headers]

This blog is now my OpenID. OpenID is a decentralized single sign-on system for the web. I’d been hearing about it for a while, and when I looked into it, I liked what I saw, so started using it for Magnolia and Plaxo. Unlike single sign-on systems such as MS Passport, OpenID is completely open in licensing and implementations, and is truly decentralized. Anyone can set up to be an OpenID provider, and there are several options including myOpenID, Verisign, AOL, and open source providers. I also like that it’s a simple system and relatively easy to implement. There are several OpenID libraries, including libraries for Java, Python, Ruby, and PHP.

When using OpenID, a URL is your unique identifier, which you use to sign into websites that support OpenID. Normally the URL is hosted on a OpenID provider such as myOpenID (e.g. http://rsmith847.myopenid.com/). But OpenID also supports delegation, where you can use any web page as your OpenID. For this to work, the web page you want to use as your OpenID has to have some tags in the header that instruct any OpenID consumer (the site you’re trying to log into) to go to your OpenID provider to sign you in. Why this extra level of indirection? So you can use the same web page as your OpenID even if you change OpenID providers. Simon Willison’s blog has clear instructions on how to set up any web page as an OpenID.

So if you look at the source for this web page, you’ll see two tags at the bottom of the header, which point to my OpenID provider (myOpenID at the moment). For some reason Plaxo had problems accepting my web page URL as an OpenID, so I had to fall back to using my myOpenID URL. Magnolia had no problems with it.

Technorati Tags:

Posted in Web | Tagged | Leave a comment

Version control systems: Going decentralized

I’ve used a number of version control systems over time, starting out with SCCS and RCS. I used CVS for many years for my own work and for client projects where CVS could be used. For the last 4 years I’ve been using and recommending Subversion, a relatively recent centralized version control system. Subversion is a big improvement over CVS, and I’ve found it to be a good VCS, but it still suffers from problems common to all centralized version control systems.

In a centralized version control system, there’s a single repository that tracks the changes to all files, and any version control operations (check out, commit, merge, etc) must go through the central repository. Lately I’ve been tracking the decentralized version control systems that have come out and have been getting attention. As the name implies, in a decentralized version control system, there isn’t a single central repository and server responsible for tracking changes to files. In a decentralized version control system, you can have any number of repositories tracking changes to the same set of files. Each repository is as fully capable as the next and able to carry out all of the version control operations (commit, checkout, merge, etc) on the files. No repository is inherently more important than another. The changes to files (change sets) can be pushed and pulled from one repository to another. Although no repository is inherently more important than another, when teams work with decentralized version control systems, they typically designate one repository as the “master” repository to which all changes ultimately get pushed and from which other repositories can pull changes. Another variation on this is to have two or more “master” repositories which exchange change sets between them. This model of having multiple repositories extends all the way down to the workstation. In most decentralized VCSs, developers work off a local repository, which is just as full fledged and capable as any “master” repository.

There are several real world “itches” I experienced that got me looking into decentralized version control systems:

Working offline

I sometimes work somewhere that doesn’t have a connection to the central Subversion repository – either I’m working somewhere without an internet connection, or don’t have a connection to the internal network where the Subversion repository resides. This is actually not that uncommon for me. With a central repository, this means I can’t rename files in Subversion, commit changes, create a new branch to work on an independent change, merge work, etc. I’m basically limited to editing files without renames/moves. With a decentralized VCS, I could do everything I can do with a central repository while disconnected, because every developer has a full fledged repository they are locally working from. When I’m again connected with the “master” repository, I can push my changes up to it.

Delays in getting central VCS repository set up

Sometimes getting a new repository added to a centralized VCS for a new project can take quite a while. The repository has to be set up, permissions have to be granted, and the person responsible for it may be out, or have a million other things to do. Until the repository is set up, the team has to share source code by some other means (email, etc) which is error prone and no versioning information is captured. With a decentralized VCS, a team could start working together using their own repository, then push all of the changes into a “master” repository when it becomes available. The team is able to get work done without being blocked, and the system administrators are able to control access to the authoritative VCS.

Distributed teams with poor network access

When working with distributed teams, the network access for offsite teams has frequently been average to poor. Sometimes connectivity to the central repository goes down altogether, and when connectivity is up, operations such as commits, merges, and updates from the repository are painfully slow. Teams work around this by falling back to sharing code via email (error prone, cumbersome), or holding off sharing changes, which makes for muddled commits and makes integration more difficult.

Moving a repository from one server to another

Sometimes you need to switch a VCS repository from one server to another; maybe the server needed to be used for something else, a more powerful server was needed, or the VCS repositories were being consolidated onto fewer servers. With a centralized VCS, when this happens, the entire team needs to switch over at the same time. This means that any changes that are going on have to be committed (hopefully they don’t break the build), the repository has to be copied over to the new location, the continuous integration process needs to be switched over, and all developers need to switch their workstations to point to the new repository. Needless to say this disrupts development and incurs a real cost.

With a decentralized VCS, the new repository could be set up with a copy of the old repository while the old repository is still being used. The continuous integration process and developers could gradually switch to the new repository when practical (e.g. after completing development of a story). All the while, the new repository can pull any changes that are committed to the old repository, ensuring the new repository is up to date. You could also have changes committed to the new repository flow back to the old repository while it is still in use. Whenever you have migrated all of the processes and people to the new repository, the old repository can be turned off. Everything has switched over without disrupting development.

Repository going down

Unfortunately, VCS servers do go down, more frequently than it seems they should. Usually you just need to restart the server process, but sometimes hardware failures can take the repository down for longer periods. If you are diligent about keeping backups of your repository, maybe you can get back up and running without much delay. The worst case of this I remember was when using ClearCase in a large development team where everyone used virtual views, which was recommended by the ClearCase admins. When the ClearCase server went down, no one could even access their code (since the files are served up from a virtual filesystem by ClearCase), so most of the development team just went home after a couple hours of being down. I’ve heard that ClearCase virtual views aren’t recommended for this reason, but I don’t know enough about the intricacies of ClearCase to say.

If using a decentralized VCS, you can set up one or more mirrors of the main VCS repository, so if one goes down, people can use one of the others without interrupting development. Also, since everyone has a full repository on their workstations, it’s pretty easy to clone one of those repositories and set up a temporary main repository for everyone to push/pull changes to. But for short outages, the development team likely won’t even notice since people mostly work off their local repository and holding off from pushing changes to the main server for a while isn’t a big deal. In short, a decentralized VCS is much more fault tolerant than a centralized VCS.

There are several capable decentralized version control systems available, including Bazaar, Mercurial, SVK, GIT, and more. Some of these are being used on major open source projects such as the open source JDK, OpenSolaris, and the Linux kernel.

Since this post is getting lengthy, I’ll follow up with another post on my experience after having switched to a decentralized VCS.

Posted in Tools | Tagged | Leave a comment