Tools involved

  • JDK 1.6/1.7
  • Eclipse Kepler
  • Maven 3.1.1
  • m2e – Maven Integration for Eclipse plugin
  • Jetty 9
  • Windows 7 / 64 bit
Continue Reading ...

I have just posted my first tweet from Java

and I still can’t believe how easy and fast it was. The actual coding took like 2 minutes, whereby the remaining 8 minutes were needed to setup a Twitter application to be able to post in the first place. Not only that, but it worked from the first try, therefore I had to stop coding and start blogging about it. This was made possible by Twitter4j (thank you very much Yusuke):

“Twitter4J is an unofficial Java library for the Twitter API. With Twitter4J, you can easily integrate your Java application with the Twitter service. Twitter4J is an unofficial library”

Octocat Source code for this post is available on Github - is an open source project.

Continue Reading ...

The challenge – Server returned HTTP response code: 403 for URL

Remember my post Reading/Parsing RSS and Atom feeds in Java with Rome, remember how I build SyndFeed objects out of a feed’s URL:

public SyndFeed getSyndFeedForUrl(String url) throws MalformedURLException, IOException, IllegalArgumentException, FeedException {

	SyndFeed feed = null;
	InputStream is = null;

	try {

		URLConnection openConnection = new URL(url).openConnection();
		is = new URL(url).openConnection().getInputStream();
			is = new GZIPInputStream(is);
		InputSource source = new InputSource(is);
		SyndFeedInput input = new SyndFeedInput();
		feed =;

	} catch (Exception e){
		LOG.error("Exception occured when building the feed object out of the url", e);
	} finally {
		if( is != null)	is.close();

	return feed;
Continue Reading ...

&lt;title&gt;Hoisting example&lt;/title&gt;
    &lt;h1>Hoisting in action&lt;/h1&gt;
    &lt;script type="application/javascript"&gt;
        var hoisting = "global variable";
            confirm("\"" + hoisting + "\"" + " click OK" );
            var hoisting = "local variable";
        })(); //self-executing function

     //Best practice - declare local variables at the beginning of the function

The challenge

I have been getting complaints from people who were trying to suggest a podcast to, and that for a good reason. They were getting a page with the following message:

"Unknown error. Please inform us about it with the Error indication form."

This is the default page rendered when an unknown exception occurs. Although this is prettier than displaying the error stacktrace, it should be avoided – it didn’t tell the visitors much and me neither.

Octocat Source code for this post is available on Github - is an open source project.

Continue Reading ...