Hmph! It seems that Junit is once again broken in netBeans 4.1 RC1. I downloaded and installed RC1 and opened my nice little project without too much incident. However, now when I try and run a Junit test, I keep getting a class not found error.
Null Test: Caused an ERROR
com.fuzzylizard.util.HibernateUtilTest
java.lang.ClassNotFoundException:
com.fuzzylizard.util.HibernateUtilTest
at java.net.URLClassLoader$1
.run(URLClassLoader.java:199)
at java.security.AccessController
.doPrivileged(Native Method)
at java.net.URLClassLoader
.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader
.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader
.loadClass(Launcher.java:274)
at java.lang.ClassLoader
.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader
.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
This test ran perfectly in netBeans 4.1 Beta. So why should it not run in RC1. Hopefully they will have this fixed for the final version. If anyone knows what is going on here, please let me know.
Update: I solved it. As I looked at this problem more I realized that JUnit wasn’t finding the compiled classes. This means that a directory entry was missing somewhere in Ant. There is a file called project.properties inside of the nbproject directory that contains the following:
build.test.classes.dir=com
build.test.results.dir=
I am not sure what the second entry is for, but the first apparently tells JUnit where to find the compiled test classes. For me, the value was blank. As soon as I entered the value “com”, the directory holding the compiled classes, the tests ran fine.
Update: I just found this bug and a workaround that seems to be related to this problem. According to the bug report it has been fixed.
One thing that I have been working on lately is trying to put together a proposal for the developer environment at work. This involves the various programs that the developers would use. This includes things like Java IDEs, database access tools, UML modeling tools, and others. One of the cooler tools that I have been playing with is Checkstyle 4.0.
Checkstyle is a Java library that checks your Java code against a set of rules. These rules can encompass everything from variable naming rules to method lengths to the use of whitespace to declaring all method arguments as final and everything in between. The coolest thing about checkstyle is that it works as an Ant target. This means that everytime you do a build it checks your code for problems.
Along with Checkstyle I have also been playing with a plug-in that integrates Checkstyle directly into Eclipse called Eclipse Checkstyle Plug-in (catchy name). The nice thing about the plug-in is that each time you do a save it checks the file that you are working on a displays the errors in the editor for you. This allows for instant feedback. The only problem that I have found so far is that the base set of checks that are included with Eclipse Checkstyle do not match the source code formatting rules setup in Eclipse. This means that if you want to use the plug-in you are going to have to spend sometime synching the two together. Otherwise, evertime you format your code you will introduce a ton of style errors.
I installed NetBeans 4.1 RC1 onto my computer a few days ago and this is what I saw when I launched it for the first time.

Is that pretty or what? The NetBeans.org crew have definitely been hard at working giving my new found favorite IDE a well deserved makeover. However, the question remains as to whether the changes are just skin deep.
I have not used this new release much, however, I do have a few first impressions of it. The first thing that caught me a bit by surprise is that if you open a project that you were working on in the Beta release of netBeans 4.1 the RC1 version has to do this little import thing. This prevents the project from being used in the Beta version again. For an IDE that uses Ant as its project management I find this a little odd. However, when it was doing the import it did do one really cool trick. The project that I am working on uses Java 2 SDK 1.4.2. When I installed netBeans it installed with Java 5 SDK 1.5. This meant that 1.4.2 was not setup. However, during the import process, netBeans detected the missing SDK and asked me to set it up by opening the Java Platform Manager.
One thing I have always found strange about netBeans is the default indent and tab size. Do people really use indenting of 8 spaces? I certainly don’t. I tend to use 4 for Java classes and 2 for JSP and HMTL. This is usually one of the first things that I end up changing. Also, why is anti-aliasing of fonts not set on by default?
Anyway, I will post more thoughts as they come to me.
There is something that I would like to know: How do you go about building a framework like Spring or Ruby on Rails? How is it that these things get created? Did someone just sit down one day and decide that the world needed something called Spring and design an IOC container? Or are these things that have evolved from simple applications into something much bigger?
According to David Heinemeier Hansson “good frameworks are extracted, not invented. . . a successful web-application framework emerge[s] from a equally successful real-world application.” But is this always the case? How was it that Spring came about?
The J2EE specification, as far as I understand it, is a framework that Sun designed on its own without the help of any former applications. The inefficiencies present in the original J2EE Petstore blueprint are a testiment to how unsuccessful this framework has been. I also think that the existance of Spring is another proof of how wrong Sun got this initial design. However, with EJB3, Sun now has the ability to base the new design on several very successfull applications—Hibernate, TopLink, and JDO—and people are excited about what EJB3 will be like. To me, this proves David claim, but then I don’t have the experience necessary to accurately judge these things.
I think because at work people are trying to figure out how to build and design a framework, I find myself contemplating how things like Hibernate, Tapestry, Struts and Spring were created along with how one goes about creating a framework in the first place. However, I do find a certain amount of logic in David’s statement.
Adaptive Path’s it’s a whole new internet article seems to be causing quite a stir on the internet these days. In it Janice Fraser states that we are at a turning point in the evolution of the internet and comes very close to saying, nay outright states, that the internet as we know it is coming to an end. She acredits this amazing transformation to AJAX, a new way of delivering web content. I am not totally sure I agree with her.
Yes, I agree that the web is most likely about to change. Google has shown us what is possible through apps like gmail and google maps, but to say that AJAX is the sole reason for this change is a little much. What about RIAs and technologies like Flash Remoting and Flex? What about web aware desktop applications and the entire world of mobile computing?
I think the web is going to change in dramatic ways over the next few years, but to give all the credit to AJX is a little presumptuous in my opinion.
Netbeans.org released the first Release Candidate for Netbeans 4.1 today. I have downloaded it, but I have been to busy to install it or to try it out. I have been really pleased with the beta release of 4.1 so I am looking forward to test driving the RC version. I can’t wait for them to release the final version. I think the Netbeans team have finally gotten it right with this version. Netbeans 4.0 was an improvement, but it still had things missing and a few bugs. With Netbeans 4.1 it looks like they got it right and they are offering up a solid competitor to challenge the perseived supremecy of Eclipse.
TheServerSide.com is running a tutorial on Hivemind.
HiveMind, one of the newer Jakarta subprojects at The Apache Software Foundation, is described as “a framework for creating applications, not an application, or even an application server, itself.”