Jar file containing a Class made easy

Often you encounter ClassNotFoundException. Most of the times, just looking at the stack trace will give you idea about which jar file you have to add to your build path. What if you can’t find?, check All you need to do it subscribe to their service though your Google account. They also provide other Java related links on top of your Google search. But I think finding jar files is the most interesting feature and it came to my rescue couple of times. Check more about it here.(If you like these kind of tools, also check GotAPI).

Top Ten Obscure but Useful Java Open Source Projects

I came across this article on top ten obscure but useful Java Open Source projects. Along with the project listing, they article also describes why it is useful. Read the article here.

It is good to find Queplix there. It is open source, customer care application, which leverages GWT for UI. They did a fantastic job although I feel that the UI transition is not really smooth.Check their demo here. The user name and password for the demo is ‘demo’.

GWT is cool, but not complete

These observations are based upon my past 3 month’s experience with GWT. If you are new to GWT check the site here. The very idea of building your AJAX applications in Java is very enticing and GWT team has done good job of providing a way to do it using GWT. Let’s dive into things that matters to you if you want to go for GWT.

Precautions: It looks like Java and feels like Java. This picture may lure you to think that you can do everything in GWT that you can do in Java. It is not true. You need to keep in mind that you can only do things in GWT that you can do with JavaScript and HTML. You build your UI using GWT widgets. You feel at home with the API, if you are familiar with Swings. For each widget GWT generates equivalent HTML element and Java Script for processing.You should make sources of all the Java classes, you use in GWT, available to compiler. Your processing code should be Java 1.4 compatible and you have to forget about multi threads and other features that are not supported in Java Script. If you have already gone through GWT documentation, you would have known GWT provides a way to embed Java Script inside the Java code using JSNI. As I said, although you write code in Java you have to keep Java Script supported features in mind. If you are a starter, you better look into examples provided in GWT site. The documentation is adequate.

There is a huge advantage when it comes to debugging. Because it is (like) Java, you can use any of your existing Java tools for development.

Widgets: This is the area where I was really disappointed. The widgets that come with GWT are really minimum. This caused my initial resistance going towards GWT. All you get is raw widgets and they look a bit ugly (You can change the look of the widgets by injecting CSS styles). No built in data binding and validation for widgets, viewers, drag and drop etc. You need to build everything on your own. There are third party libraries available for features like drag and drop, effects, viewers etc. By default, GWT should have provided lot of UI components that any RIA framework or tool set provides. For example, like Flex,Echo 2, Ext etc. There are efforts to make situation better. Check the resource section for GWT libraries and examples.

Server communication: GWT provides two options for you client side code to communicate with server. One is using pure JSON over HTTP and, second one is using RPC. The RPC mechanism abstracts you from the nonsense of dealing with marshaling and unmarshaling of JSON. You can deal with pure Java objects. There is a caveat here, which I will discuss in next paragraph. Here again, if you want to communicate with server using SOAP XML messages or some other form of communication, you are left on your own. This is not a show stopper or something of that sort. But when you look at Flex or Open Laszlo, you desire for that in GWT.

With GWT-RPC, your code should be Java 1.4 compatible(I heard GWT team is working towards brining Java 5 compatibility to GWT). If your domain objects uses Java 5 features like generics, annotations, you can not reuse the same domain objects as value objects. Then, you need to introduce some conversion mechanism here.

Even if your code domain objects are Java 1.4 compatible, you need GWT specific XML file in your domain objects source package.

And GWT-RPC have some problems with Hibernate. If you return PersistentSet when RPC expects Set, the RPC mechanism throw error. Also there are obvious problems with Hibernate proxies, java.sql.Timestamp. There is a library called hibernate4gwt which aims to alleviate these problems.

Alternatives : If you like the approach of building your AJAX apps in Java and let the tool take care of converting it to Java Script and HTML, you may like to look at projects similar to GWT. They are

· Echo 2– Similar to GWT. The number of widgets available is more when compared to GWT. Check the demo in their site.

· WebCream– Converts Swing applications to AJAX applications. They claim, if your Swing applications do not use many custom components, they can convert it into AJAX application without any changes.

· J2S– JavaScript equivalent of SWT. They are trying to build Eclipse RCP to web.

GWT is a good way of building AJAX applications for Java developers. It is not complete framework, keep T(tool) in GWT in mind. It provides you bricks. You need to build your wire frames and house, sometimes third party libraries may help you. Nevertheless, I feel it is far better way than building your UI using Java Script(Java Script really scares me). If GWT team comes up with more rich UI components and a framework on top of them(Imagine something like JFace ported to GWT), GWT is the way to go. It is over a year since GWT is around. With Google behind we may safely expect more good things happen for GWT.


1. GWT– Official home for GWT.

2. GWT Incubator – Ideas and Widgets that may go to GWT library.

3. MyGWT – Widget library. The best I have found and they borrow some of the concepts from JFace for viewers. The default look itself is great.

4.– Tracks news on GWT and very informative. You can also find about various libraries here.

5. Roberts Hanson’s blog – Blog from the author of the book, ‘GWT in Action’. He is creator of gwt-wl(widget library) and gwt-sl(server library, which provides controllers for integrating with Spring and other server side utilities).

6. Gwanted – Helps you to use GWT in any web page, Error management etc

7. hibernate4gwt – Helps you to solve problems with GWT-RPC and Hibernate.

8. gwt-ext library – The creator of the library is Sanjiv Jivan. He ported Java Script EXT library to GWT.

9. gwt-tk library– Provides widgets like drop down panels, glass panels, various types of dialogs.

10. GWM library– GWT windows manager provides window effects for GWT applications.

11.Other– GWT related projects from Google code.

12.rocket-gwt– Widget library.

What traits do top notch Java/J2EE developers have?

These kind of questions come again and again. Experts never tired of answering these questions. One of the users of Javalobby forum posted the answers for this question. And, TSS is running a thread on this topic. I believe, if you are Java or any other programmer, you should have following traits,

1 . Passion to learn new things and passionate about industry you are working in.

2. Passion to produce quality code.

3. Ability to evaluate pros and cons of using different technologies for a solution.

4. Avoiding I know it all attitude. This is the most important trait.

In addition to this, if you are Java developer and if you want good exposure on design patterns, try to learn Eclipse plug-in development technologies. Most of the time it forces you to use patterns, so it will become practice after some time. Also try to look into source code of the framework you are using whenever possible. In Java land, most of the technologies are open sourced, it is easy to get hold of the source.

Two years back I came across a a thread,’How to become a sr Java & J2EE engineer‘ in TSS. One of the users, Brian Greene, replied to this thread. This is best answer that I came across for this question. Although the list is long, they are excellent suggestions. These suggestions helped my career a lot. Some of the suggestions may not be relevant for the current state of Java and J2EE technology. Here is Brian Greene’s reply for that thread,

first, there’s no need to be mean because people didn’t tell you how to be an overnight expert.
it sounds like a get rich quick goal. that said, I’ve been in the field for about 2 years and am far beyond that as a senior developer where I work. how’d I do it? simple – work.
1. read. download e-books from manning and read them. thoroughtly. work the examples.
2. get familiar with at least 2 app servers – tomcat, jboss, weblogic (they let you dl a free one for dev), oracle 10g (same dl as wl).
3. learn to make love with Ant. 🙂
4. learn at least one persistence framework in addition to ejb cmp
5. read. subscribe to TSS forums and read the threads where people have problems and pay attention to the solutions.
6. learn at least 2 versioning tools. cvs and subversion come to mind.
7. learn to use junit and its extensions and theories (cactus, strutstestcase, mock object testing…)
8. get REALLY familiar with one IDE. actually read the help files.
9. understand classloaders, the object contract, reflection, Collections
10. implement at least one large project in your free time – use it to play with the stuff you’re learning. Do the WHOLE THING – I rented a server, set up the versioning system, fronted a clustered jboss instance with apache and a load balanced modjk connector – the works. then get people to play with your project.
11. try to work around people smarter than you – and work to learn everything theoretical they know.
12. read – the GOF design patterns book or “holub on patterns”
13. Read – the entire series of books by the pragmatic programmers.
14. be friends with the command line.
15. learn at least one web framework in addition to struts.
16. learn at least one java <-> XML binding tool
17. understand that web frameworks are servlets – if you don’t get servlets you’re lost.
18. write a ton of code.
19 read – JDJ, SD times, etc. take with a grain of salt.
20. download and build several large open source projects, and then several small ones with lousy build files.
21. download and play with a bunch of projects. read the docs and learn how to configure them. it’s not the configs that are important, its the process of learning how things work.
22. get at least comfy with at least 2 RDMS, with at least one of them being oracle, MSSQLServer or DB2
23. get an rss feed reader and read blogs of the thought leaders in the industry and large project heads. ask questions. also read at least one blog by a fellow developer you don’t know.
24. get on Sun’s forums once a week and try to answer questions. not the crap where people want you to do their homework, but real problems they’re having. You’ll find out what you don’t know, clarify what you do, get better at communicating technical things in written form, and derive a sense of satisfaction.
25. get really good at a few tools
26. look at the other side of things – if you LOVE hibernate, learn to understand the benifits of jdo.
27. READ THE SPEC. servlet, jsp, ejb, etc.
28. learn to write design documents for the code you’re writing.
29. learn at least the basics of another language or a scripting language – if your only tool is a hammer – all problems look like nails
30. for lord’s sake, note that J2EE is not a thing, but a collection of things.
31. learn at least the basics of LDAP.
32. work REALLY hard and love what you do. I still put in 60+ hours a week. 45-55 for the job and the rest on personal code.
that’s my 2 cents. email me if I wasn’t clear on anything brian at

Tie that binds Sun, NetBeans and Java criticized

The issue is all about Sun trying to make NetBeans and Java, a Siamese twin. Bill Roth from BEA and others was not happy about the announcement of NetBeans 6.0 in JavaOne opening keynote. Their argument is justified after all it is JavaOne, not SunOne. These days, if you have experienced any Java related session on X technology, from Sun, you would have felt that ‘How to instantly cook X on Netbeans’ would be apt name for the session. It is almost like one of those weight loss equipment advertisements. They should seriously consider separating Netbeans from X sessions. Read the news.

Modular, Lightweight JRE

One of the best news that came out of the JavaOne 2007, is consumer JRE. Some users are not comfortable with downloading the big size JRE. This is one of the reason why there is not much of Java at rich clients side. With Sun coming up with small JRE(2-4MB), I believe, things will change. Check the news here.

XHTML support in the Eclipse Welcome Framework

If you are developing a product using Eclipse framework, there will be more chances of having your own welcome page. I did not find any articles on this when I searched. But I found this link, which can help as tutorial for building custom welcome pages.
Follow the examples carefully. Note that all the pages should be strict XHTML 1.0 complaint. Absorb the steps specified in the examples. Violating it may sometimes work but sometimes leads to abnormal behavior . For example,one of the cases I came across, the ‘page’ element specified in introContent.xml(the file you specify in org.eclipse.ui.intro.config extension), like this,

<?xml version=”1.0″ encoding=”utf-8″ ?>
<page id=”root” url=”content/root.xhtml”></page>
This works in some systems. But sometimes it will prompt the user to download or save ‘root.xhtml’ file. In my case the user got this problem as soon as he installed Firefox browser but I am not sure this is the actual cause. To fix this problem, you should use ‘content’ attribute instead of ‘url’ attribute while specifying ‘page’ element,

<?xml version=”1.0″ encoding=”utf-8″ ?>
<page id=”root” content=”content/root.xhtml”></page>