What is an AtomServer ?

April 14th, 2010 No comments

I had the opportunity to work with the ATOM protocol in detail recently. One of the products related to ATOM that I stumbled across is the AtomServer. If you dont already know it, ATOM is accompanied by a publishing protocol. Its called ATOMPub in short. Unlike RSS this protocol allows you to perform CRUD operations on the entries that you define under a feed.

What does that mean ? For example, you could have an entry in a feed which you wish to edit. You can edit / remove this entry using PUT / DELETE HTTP requests to an appropriate URL hosted by a server. So this protocol allows a user to interact with the feed (among other things. The ATOM XML format can be extended).

Categories: java Tags: , ,

Bugs – The most common kind

March 27th, 2010 No comments

I was testing an application today and came across a bug. A screen had some CRUD operations on a resource. The problem was, whatever I did, the system would perform the operation and tell me that the resource already existed. This left me scratching my head for quite a while. I add a resource and it says it already exists and then adds it. Delete and update also do the same.

So the debugging process started and I sat down with eclipse to get to the root of the problem. I verified that indeed the CRUD operations were reflecting in the persistence store. Then I came across these magical lines of code

public static final String S_SOMETHING_EXISTS = "something.already.exists";
public static final String S_SOMETHING_ADD_SUCCESS = "something.already.exists";
public static final String S_SOMETHING_DELETE_FAIL = "something.already.exists";
public static final String S_SOMETHING_DELETE_SUCCESS = "something.already.exists";

This left me smacking my head. It should have been

public static final String S_SOMETHING_EXISTS = "something.already.exists";
public static final String S_SOMETHING_ADD_SUCCESS = "something.add.success";
public static final String S_SOMETHING_DELETE_FAIL = "something.delete.failed";
public static final String S_SOMETHING_DELETE_SUCCESS = "something.delete.success";

Categories: java Tags: , ,

Application support for java developers in linux

March 17th, 2010 No comments

One of the things I hear often from someone wanting to try linux and leave windows is that they are afraid that they will no longer be able perform some of the things they used to do. That is so wrong. Be it from the perspective of a developer or a casual user linux offers a wide range of apps to suit your needs. Here is a table of things I used to do in windows that I can still do in linux

Application Windows Suse Linux – KDE desktop
Chat Gtalk, Skype Kopete / pidgin for gtalk

Skype is supported

Development Eclipse / myeclipse / Netbeans All of them have linux flavours
Screenshot Gadwin printscreen Ksnapshot
Browsing Chrome / Firefox / Opera They are all supported. Chrome support is getting better
SQL Client Squirrel SQL Supported. Java runs anywhere :)
Categories: java Tags: , , ,

How to open multiple SSH tunnels

March 13th, 2010 No comments

I use remote linux services often and exposing them as local services can be performed securely using SSH. For example you can access a tomcat server or email server hosted at IP 1.2.3.4 by opening a secure SSH tunnel between your local machine and the target address – 1.2.3.4.

The OpenSSH tool can be used to perform SSH related activities on your machine. Simply install it with yum, apt-get or Yast, if it is not already available. Once you have it use the following command to open multiple SSH tunnels to your services

Open tunnel and execute commands:

ssh 1.2.3.4 -lmyUser -L 3098:1.2.3.4:21 -L 3099:1.2.3.4:80 -L 3100:1.2.3.4:443

The command is explained below

1.2.3.4 – Your target IP

l – The user to login as

L – A local tunnel to a remote port

3098 – The local port to use when establishing this tunnel

Categories: General Tags: , ,

Linux for java development

March 7th, 2010 2 comments

I have been wanting to move to a linux based environment for java development for quite a while now. Many PROD servers I deploy to run on a linux distro. So testing configuration / code changes becomes easier when you have multiple DEV environments. I deploy to CentOS among other linux flavors. I have settled on the OpenĀ  Suse 11.2 desktop. Here are some things I liked

  1. Open Suse managed to detect my Nvidia driver with Yast. I guess they teamed up with Nvidia to host a repository for linux drivers. I didnt have to download kernel sources or devels to enable dual monitor support (Which is otherwise required). Nice !
  2. PPP over internet setup was pretty easy. Kinternet and the Yast configuration settings together let me connect to the net with ease.
  3. Community support seems good. The Suse forums are alive and kicking.

Categories: java Tags: , , ,