Bruised, but not defeated by Java

by Michael F. Collins, III April 08, 2009 06:01

I used to be a 100% Java programmer back in the late 90’s and 2000-2001. Well, that’s not true. I was about 80% Java, 20% MFC/C++/Windows. But then .NET came into my world and I decided that I really wanted to be back developing true Windows applications (I didn’t need the run anywhere promise of Java), and I haven’t really looked back. But then, in 2009, I hit a problem that I could only solve in Java, and I realize how much of that former knowledge that I have lost.

At my current client, I am responsible for building up a FitNesse wiki and acceptance test suite. I’m the only one with past experience with FitNesse, so I jumped in with both feet to get it going. The old FitNesse wiki that they had when I joined the project was in a state of neglect, so I wanted to correct some of those wrongs with a flashy new FitNesse wiki with all of the bells and whistles.

One of the main features that I wanted to implement with the latest release of FitNesse was version control. FitNesse now has support for integrating with version control systems and adding pages to or removing pages from a version control repository. The out-of-the-box functionality includes integration with Git, a new version control system that I’ve been looking at and am becoming somewhat fond of. The only problem with the implementation of Git for FitNesse is that it assumes that FitNesse is running on Linux or Unix and the paths are hard-coded. This is obviously a problem for those of us that are running on Windows.

Fortunately, the version control API for FitNesse is relatively straightforward and easy to implement. I downloaded Eclipse and created my new Java project. I created the Java class that I was going to need to implement the version control integration. I created my JAR file and deployed the JAR file to the FitNesse directory. I then went into my command script that runs FitNesse and added my JAR file to the class path. Finally, I went into my FitNesse repository, edited the root file, and added the directives to support integration with FitNesse.

Then I switched back to the command prompt where FitNesse was running. By adding the version control directive to the root file, FitNesse should have tried to update the page in version control, because it was under version control to begin with. Instead, I received a ClassNotFoundException. I spent several hours over two days struggling with this exception. My class was there. It was in the JAR file. I had the JAR file on the class path. Why was I getting the exception?

Finally, I found a post that refreshed my memory. FitNesse itself is deployed in a JAR file, so when you run FitNesse, you run the JAR file. The JAR file contains a manifest that specifies its own class path that overrides the specified class path. If you’re going to adjust the class path and add more modules in, like I was doing, you can’t run the FitNesse JAR file. Instead, you need to tell Java to run the main FitNesse class, and specify the fitnesse.jar file on the class path.

Problem solved. My version control integration works. I can now forget about Java development for a little while longer.



Tags: , ,

Version Control | FitNesse | Java

Comments

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen | Modified by Mooglegiant

Calendar

<<  March 2010  >>
MoTuWeThFrSaSu
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar

What I'm reading now


Add to Technorati Favorites

Disclaimer

The views expressed on this website/blog are the opinions of Michael F. Collins, III, and do not necessarily reflect the views of my employer.