Yesterday I woke up with a fresh mind to start my day by learning something useful. I had the aim to learn Spring Framework. So with this in mind I sat before my machine and decided to plan what to do for getting started in spring. I had downloaded Eclipse Europa a couple of days before so I thought the best way to get knowledge for Spring would be to get working quickly with an IDE.

I had NetBeans 5.5 with Sun Application Server prior to downloading Eclipse Europa. NetBeans was very amazing from the very beginning when I started with it. But since the enterprises here, use Eclipse as their de facto Java IDE my mind was made up, to work in their way i.e in Eclipse. Eclipse Europa which released a couple of days ago had the long forgotten feature of Web Application development called WTP built into the IDE along with 20 other sub projects. So this prompted me that, getting started with a new framework and a new IDE would be refreshing.

I had already configured Eclipse Europa to work with the Sun Application server earlier and I had the spring framework api’s with me so it was only a few moments from getting a head start. I created a dynamic web project in Europa making it compatible for running in Sun App Server and made a simple Controller and a view page in JSP, the minimal requirement from a Spring MVC tutorial. The configuration files were made and then I thought of running the project.

As I ran the project the error I got was,

java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

I started to debug my application to see if any of my code or configuration had this Logger class included. But my code included only a single controller class and its mapping file in which no Logger was used. I thought maybe the Spring.jar wasn’t getting added in the classpath, even though I had added it as a external jar. I decided to manually add the file to WebContent/lib.

But still the error would not budge. I even added the jar file to build directory by making a lib folder in it. This also did not seem to make the error go away. It was insane. I had tried searching for the error on the web but the answer for that was the Logger was missing even though I had not added it anywhere in my code. The solution was to add the appropriate jar but I did not have those like Log4j.

Half of the day was gone in trying to solve an error which shouldn’t have come in the first place. Furious with the error I stopped with my spring campaign and thought of learning JAX-WS. I had the knowledge to use JAX-WS so wanted to give it a try in the new Eclipse IDE which everyone was making a hue and cry about. First of all there was no provision for making a web service project in the IDE. Netbeans 5.5 which I had earlier used way back last year to make web services already had the web service project in built.

I learn’t that for making a web service I had to download STP which meant SOA Tools Platform which had the capabilities to make a web service using JAX-WS in Eclipse. I downloaded STP and wasted about half an hour on it owing to my slow connection. After getting STP I read a tutorial on how to go about making a web service in it. A tutorial on the web stated that before making a web service with STP it should be configured with Apache Celtix Fire (CXF). What the f***?

I already have JDK 1.6 which comes shipped with JAX WS. So what was the need of having another one? Apart from this I also had installed JWSDP 2.0 web services developer pack from SUN. With some hope in mind I thought maybe it could be used instead of CXF. When I tried to configure it, Eclipse it gave out a lame error stating,

You must specify a valid installation location for your selected runtime provider in JAX WS References.

which in other words meant CXF installation.

Growing more and more frustrated at this utter nonsense I decided to download Apache CXF. It was even bigger than I had expected with a size of 21 MB. I kept it for downloading and took a break to start with a fresh mind later in the evening. I hoped to get at least something from that day, But more frustrations were in store for me.

Later in the evening when the download had completed I configured it in Eclipse and made way to the rest of the tutorial. The further steps were to make an interface and implementation and add annotations. I did that and was about to see how the WSDL and proxies would automatically get generated. The tutorial mentioned that when the interface with the annotations is saved the proxies and WSDL immediately get created without required the user to do do anything. But to my bewilderment I already saved the interface quite a lot of times but there was no sign of WSDL nor the proxies. This was even more frustrating than I had imagined.

Searching an answer to this irregular behavior of the IDE I came to know that I wasn’t the only one who faced this. There was another one which I read here. Unfortunately no solution was there. It was in the night that I was still trying to learn something and due to this nonsensical IDE I had gained nothing but frustration. I forgot to mention the regular hang ups which I suffered in between the activities. I was left clueless as to why Eclipse was chosen by enterprises and not NetBeans. One more thing which left me in disappointment was that Eclipse did not allow me to switch between the servers i.e Sun Application Server and Tomcat for running the same application! It said something like this,

Tomcat is not a Java EE 5 complaint server.

Thanks for the info but my project does not have EJB’s for God’s sake!

I gave up on using Eclipse and closed it. It was in the middle of the dark night that I opened NetBeans and heaved a sigh of relief. It looked more lovely than before thanks to the disgusting UI of Eclipse. I thought of making up for lost time by just implementing the things in spring which I wasn’t able to in Eclipse.

I made a new web application and added the spring.jar file, made a controller and view, added the mapping. And lo and behold as I ran the application with Tomcat as the server it flashed me the output in matter of seconds which I had wished way back in the morning. I switched the server to Sun App server and it ran smoothly as on Tomcat. This mere moments that I spent on NetBeans were the best ones in that entire unproductive day. These moments gave me the confidence to learn more the next day, the confidence which I thought I had lost. It was like a breath of fresh air.

I thank God for giving me NetBeans. I don’t know if anyone elsewhere thinks in the same way. But the fact is that it took me just one day to dump Eclipse, and go back to NetBeans. Long live the developers of NetBeans!


Stumble Digg Technorati Subscribe Delicious