Friday, January 25, 2008

Off-topic: Admitted at the MS in Computer Science - SFSU

Well, this is not an agile post, but the happiest post ever: I was admitted to the M.S. in Computer Science program at San Francisco State University... This is something I dreamed since high-school and I believe God makes everything at His own time.... I will create a new blog about the life of a student-professional-student with life back to the academic world...

This will be fun... The ideas about a different Web 2.0 approach to my studies will be discussed on this new blog I'm thinking about just to address information about "flattening the world of academic research"... Will discuss much more there...

Monday, January 21, 2008

Never trust an IDE (shame on Eclipse's auto-completion feature)

Being agile sometimes brings us headaches that can make one lose hours of going through debugging log files, and sometimes without clues to the newly created puzzle. J2EE applications can make you feel that headache when we have to deal with applications and frameworks written without "proper" error-handling/logging.

My frustration started while finishing a personal application using the widely-used MVC framework Struts. I already had lots of "controlled" Actions and I was just adding a new Action to the play, but I was trying to be Agile :D I had downloaded the newest version of Eclipse 3.3 and imported my project accordingly. Then, I promptly just fired the "Create New Class" and extended the Action. That's it!!! (I thought), but my headache had just started after I trusted my loved IDE's auto-completion capabilities.

Before I describe what I had implemented on my execute method (the one we must override in order to have our application to "dance"), I found descriptions of which mistakes one can make in order to get the so-called blank/white page result after executing a strusts action. My application was also suffering from this well-known and poorly documented problem. According to a post at JMatrix, 2 are the possibilities of getting this blank page side-effect: If the Default Action is called instead of your Action class or if the input class on the action mapping is invalid. However, I'm writing this post just to add my 2 cents to the scope of this problem. Everything started when I trusted Eclipse to override the method signature below:
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
This is the correct signature of the method execute, the one that will be executed by the Action Executor. However, after using the code-completion feature, I got the following signature:
/* (non-Javadoc)
* @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.ServletRequest, javax.servlet.ServletResponse)
*/
public ActionForward execute(ActionMapping mapping, ActionForm form, ServletRequest request, ServletResponse response)
throws Exception {
Being agile is all about trusting the tools that help you be productive, and this was just a moment of sadness. For me, the code was totally correct, but it was completed with a different signature. Although the action is loaded, nothing will be executed with this scenario. I spent a few hours with the clue of just having, among others, the following lines of the debugger output that proved that my Action class was being created and used by the Action executor class ActionCommandBase to execute the default "execute method".

00:48:11,658 DEBUG CreateForumPosterAction:27 - Starting the create forum poster action...
00:48:11,659 DEBUG AbstractCreateAction:93 - setting action to net.jsurfer.cryptonline.client.web.CreateForumPosterAction@192563a
00:48:11,660 DEBUG ActionCommandBase:49 - Executing org.apache.struts.chain.commands.servlet.ExecuteAction
Any clues? The reason is that the method added was not overriding, but overloading the method execute from the class AbstractAction, which is just an empty method. Therefore, another reason to get the blank page from the execution of an Action struts class is when you trust an IDE such as Eclipse and hope that it will auto-complete the overridden method when you need. In other words, my 2 cents for JMatrix list is:

3. If you have NOT overridden the method execute, but overloaded it by having a different method signature. Be careful!!! It is HttpServletRequest and HttpServletResponse instead of ServletRequest and Servlet Response on the signature of the execute method. Never trust your loved IDE.

Wednesday, January 16, 2008

Installing SourceForge Enterprise Edition VMWare-based on Ubuntu 7.10 Gutsy

What about managing your team with the first-class distributed software development tool? SourceForge Enterprise Edition allows project managers to better follow his/her teams of projects in a very convenient way. This post is just a hint on how to install SourceForge Enterprise Edition vmware player instance on Ubuntu 7.10...

First of all, I'm assuming that you have Ubuntu 7.10 installed as your own desktop, remote server, etc... For remote servers, I recommend one using NXServers and in order to access your server just use the NoMachine clients.

At this start point, you can download SourceForge Enterprise Edition 15 users from http://downloads.open.collab.net/sfee15.html. I had downloaded the file SourceForge-4_4-DL6.zip and unzipped its contents to my home directory by running
unzip SourceForge-4_4-DL6.zip
With the access to the GUI, you can proceed with the installation of the VMPlayer... Just follow the instructions on how to do so at Ubuntu Forum. It's mandatory the installation of the build-essential package!!! If the package update bugs you complaining about the Ubuntu CD from where you installed Ubuntu and you don't have access to one, just comment the first line at the /etc/apt/source.list file about the cdrom access... Finally, just complete the installation answering to all the questions by default, HAVING ONLY THE BRIDGED configuration. If asked, verify which interface has your IP address by running "ifconfig" and use it on the configuration (mine was eth1)... Once configured, it will display a welcome message from the VMware team...

With VMWare up and running, go to Applications -> System Tools -> VMware Player. Then, click on "Open an existing Virtual Machine" and go to the directory where you unzipped the download of SourceForge-4_4-DL6.zip and select the only file for the SourceForge virtual machine... the VA software centOS server will begin to be loaded... We are almost there... :D

A lot of users (including me) are just reading the documentation available online, but for this installation the package includes the file "install_guide.pdf" with information about pre-installation instructions. I just needed to see which username and password allows me to make the first login to the SFEE server. When prompted, just use the following:
username: root
password: sourceforge
At this step, since it's the first time you're running the installation, you will need to change the root password. Follow the instructions and go to the IP/Network configuration. I chose to have a static ip address in order to be able to have other http servers on my network... After following the installation procedures, the SFEE server will be restarted and the configuration script will show the ip address and host name on how to access your SFEE installation from your local network. After that, you are all set and you just need to hit the virtual host address on the browser and follow the welcome instructions... The following is the username and password for the admin account
username: admin
password: admin
For management of projects using SFEE, a good starting point is the following documentation:
http://sfee.open.collab.net/sf-help/en/doc/User_Guide.pdf

Thursday, January 3, 2008

Axis2, Take 1... Developing POJO based Services

I spent most of the last year developing using AXIS 1.3 ... Today I'm really happy with AXIS2 because of the Plug-and-play capabilities when it comes to publishing services. I'm rewriting a J2EE application I wrote 6 years ago using the latest technologies, and of course publishing the Interfaces using AXIS2.

First of all, install Axis2 service on your application service of choice (Tomcat, in my case). Then, start with the development of the aar POJO service: specifying the methods of the Interface, then describing the type of the messages (in-out, in only, out only) on the services descriptor file. After running the WSDL generator, one can customize the design or integrate with your own schema catalog (in case one exists). The next step is just to publish the service on the Upload tool from the Axis2 application.

The POJO implementation might be really slow, since there are other possibilities on how to implement the services using different techniques such as the use of an XML Pullparser, thus, giving direct implementation performance improvements to the developer. I have the idea to measure the execution of different implementations of services, analyzing development and deployment strategies. Everything would just differ on the deployment automation scripts and patch generation.

StartupCTO - Helping Small Teams Develop Great Software