Sunday, September 7, 2008

Not having aggregator is a real struggle !

I am pushing for a planet like aggregator for us quite a some time. But still not happening. But sooner than later it will come. I even forgot to update this blog as it is a real headache posting the same stuff from my one and here.

Planned to make this blog as a set of feed reader gadgets. But it isn't fair for everybody as first blog will always be displayed first.

And since my last post from here, I had blogged number of posts in mine. Please do visit here :)

http://jk-blogging.blogspot.com/

Friday, May 30, 2008

0 How To Run Ant FTP / Telnet / Rexec Task

Included in Ant are optional tasks like FTP & Telnet. For example the FTP Task allows you to communicate with FTP servers (get / put / list etc.).

Unfortunately they don’t work out of box and not well documented. In this article we will explain the whole procedure in six simple steps.


To use them follow the steps below:

  1. Download jakarta-oro and commons-net library.
    Note: The links above allow you to download the version I tested them with.
  2. Create a lib directory for your project if you have not already done so.
  3. Extract the jar file jakarta-oro*.jar from jakarta-oro library you have downloaded and copy it to the lib directory you created.
    Note:
    • If you have downloaded from the links in step 1 then the exact file name is jakarta-oro-2.0.8.jar
    • Ensure that the file is copied to the lib directory and not to any of its sub-directories
  4. Extract the jar file commons-net*.jar file from commons-net library you have downloaded and copy it to the lib directory.
    Note:
    • If you have downloaded from the links in step 1 then the exact file name is commons-net-1.4.0.jar
    • Ensure that the file is copied to the lib directory and not to any of its sub-directories
  5. Add the ftp taskdef at the top:
  6. Add the appropriate task to your build.xml file. An example task to upload a directory is as follows:
       description="Upload the files to WordPress Installation" >
    remotedir="/test" server="taragana.com"
    userid="ftp_login" password="ftp_password">



  7. Run Ant by including the lib directory in classpath. An example would be:
    ant -lib lib upload

    Note: I just had to include the lib directory to ensure all its jar files are automatically included.

Note:

  • The same procedure can be used to run Ant Telnet and RExec Tasks. Only the task name and parameters in build.xml file will change. Check the corresponding manuals for details.
  • I have promoted the use of lib directory (within project) to keep your jar files. This makes your jar files available only to your project. There are two other alternatives. First you can keep them in %ANT_HOME%\lib directory. This makes them available to all projects for all users in that machine.
    You can also keep them in ${user.home}/.ant/lib.



Tuesday, March 4, 2008

Feb 29, A bad day for apache ftpclient users

The below post was written on February 29 and I forgot to post this after writing it ! hence posting little late.

I am writing this blog after being severely hit by apache ftpclient bug on February 29.
Unsurprisingly the bug has hit the whole world of apache ftpclient users and there were number blogs immediately started popping up.

By abstract this is the bug all about. When the ftpclient parses the files one by one, it validates the file timestamp. In Unix system it gets the file properties and the date will have the MMM HH:mm if the file is less than 6 months old. Since there is no year in the time stamp string, ftpclient parses it with year 1970 (Well done !) which of course is not a leap year. So Feb 29 is not a valid date in 1970 hence this code segment in class UnixFTPEntryParser returns null.

try{
file.setTimestamp(super.parseTimestamp(datestr));
}catch (ParseException e){
return null; // this is a parsing failure too.
}

There are many temporary ugly fixes based on your requirements ;) For me , I just needed the files to be downloaded, so I catch the exception and if the date string has "Feb 29" and the current year is leap, I just set a Feb 29 time and return the File instead of NULL.

But people who needs correct time stamp will have to a bit of extra work. This link discusses about possible fixes and implications.

The good thing is we have another four year time to fix this problem !!!

Friday, February 29, 2008

More on spring integration


Like I mentioned in my previous post, I in fact had a shot at spring integration. And I asked my buddy Lahiru to have a work on it. And unsurprisingly he found no time to get familiar with the model.

This is a one major reason why I favor spring integration even though it is far away from being matured.
I don't find any other proper open source EIP solutions alive. Two possible solutions which come across are ActiveMQ and Apache Camel. The former is nothing more than a messaging solution(Wonder how many use its EIP ) and later is something we can make use of (Its again from activemq!). But I don't need a reseller when you are selling directly to me !



So why I prefer spring integration over these solutions ? Here are my points.
1) The AOP support.
Just imagine the beauty of designing the AOP based integration solution. It will be a treat to do and follow.
2) What most of us are doing with Mule (or other opensource ESB) now ? We just use spring every where in it. 9 out of 10 times this is spring on Mule. So being persisted with one framework (which is of course spring! ) will be much more easier for the developers.
3) Spring documentation.
Many times I have mentioned this in my blog. Spring documentation and examples give us no time to understand the solutions easily. I haven't see any other documentations which can get closer to this. Spring addresses its documentation is a user's point of view where most of other open source documentations are done on the developer's(I mean the developers involved in the particular open source product) point of view.

4) The IOC model.
The same I mention again. It will be easy to plug in the third party adapters with less fuss. I think it is pretty obvious advantage.

So what I am looking for in the near future on this.

1) WS support
Desperately need this. I think they will have it before the 1.0 release. SOA is becoming a marketing term these days and it is vital for the designers to have the WS support. So it is so important that spring integration must be released with WS support. But even now it will not be difficult to have a such adapter anyway.

2) Facility to make hot configuration.
When it comes to production environment, application providers will see easy way of plugging their applications. So a kind of JMX based admin console would be handy. Then again exposing a bean MBean is very easy in spring and you can still self cook.

Now few hiccups on using Mule which is a tested ESB solution and you can still use it for EIP. To be honest, I had a bit of confused wrong view on ESB against EIP and tried Mule for the purpose of EIP. Surely you can do. But its like using hammer to smash a mosquito. Mule is intended to be used for ESB. Though it pretty tough call to use it for typical SDP solutions, you can still use it. But I differ for using it solely for EIP. Because you will put unnecessary efforts to make it working (Actually I did) and its documentation will never be helping that much.

But I am pretty confident that a good EIP framework can turn out be a good ESB solution. When you do that, you will have your own flavor and you will have nothing more than what you need. Spring integration has its potential. I wish they have a spring integration (EIP framework) and separate ESB framework so people will be able to make use of them according to their needs.

So the morale of the post having two points.
1) Like Americal Idol judge Rendy says "Spring integration, Check it out baby, check it out ! "
2) If you have any butterflies regarding to EIP, ESB and SOA, work on it. Read hell lot of documents and get the clear picture of them. I still am working on !!!

Monday, January 28, 2008

Hang on ! Spring integration is due

One on the most expecting even happened on 25th January. Spring integration 1.0 M1 is released. This is something I have been looking for our integration framework design. People will have their options for these in different varieties. ActiveMQ is a well known option for EIP (Enterprise Integration Pattern). But it is used as MQ server more often than a platform for EIP. Then we have Mule which is an ESB solution, but Mule has its own flavor for EIP and it really works.

But spring integration framework must be much better option with time. Not just because it is spring, but it is because of its IOC. Even before you dig in to this Reference Manual you can think of how easy the applications could be wired using spring. And with spring web services and Spring integration , you can model a good SOA architecture in your applications.

I am going to have a try on this. Will update you with progress.

Monday, January 21, 2008

IVY 2.0 is released as apache project


Delighted to see Apache IVY released its 2.0 version under apache. IVY is a long time sitter under incubator and I surprised about it in this post. Good to see IVY is under apache label now. Even better I see it under ant which will definitely help promoting IVY. I always feel that ivy + ant will always a better option over maven for small and medium proprietary projects. We at hsenid use ivy heavily and it is our major dependency management setup.

Click here to see the release notes.

Congratulations IVY.

Monday, January 14, 2008

Is Your HTML Good Enough?

I found an article that have few links for browser testing services. Here are copy paste part of that article. You can access the original one from here.

IE NetRenderer will show your page in IE 5.5, 6, or 7, to give Mac and Linux-based designers a quick sanity check. It’s free and quick.

BrowsrCamp is designed to show off how your page looks under the various Mac browser out there. You can view Safari screenshots for free, or take VNC control of a live Mac loaded with 11 different browser for prices starting at $3 for 2 days.

Browsershots is the most comprehensive of the free services, offering screen captures of your site under dozens of different Linux, Mac, and Windows browsers. It’s also popular, and it can take quite a while for requests to work to the head of the queue to be rendered. They’ve recently introduced a $15 per month priority processing program to jump requests to the head of the queue.

BrowserCam offers an online interface for managing screenshots across a variety of recent browsers and operating systems including Linux, Mac, and Windows; their coverage is excellent. You can get a 24-hour free trial; after that, plans range from $19.95 for one-day access to $399.95 for a full year. Their separate Device Capture service is the only one I know that will do screenshots of your site on Blackberry and Windows Mobile devices.

Litmus covers a variety of Windows browser, from IE 5.0 up to the alpha of Firefox 3, and say they’re adding Mac browsers soon. Results are returned via screenshots. They also integrate bug tracking, version management, and private URLs you can use to share compatibility results with clients. These features come at a price after the initial 30-day trial: 39 euros monthly for an individual account, or 129 euros monthly for a team account.

Browser Photo comes from Keynote NetMechanic. They promise screenshots from Windows, Mac and Linux systems for a $15 one-time fee or $150 per year, but don’t offer any details on which browsers or versions they cover in advance of sign-up, or any trial program.

BrowserPool takes the VNC approach to provide access to Mac, Windows, and Linux systems. Their pricing starts at 29.99 euros for one month, but unfortunately their software versions are a bit out of date.