This is a rant.
When I decided to leave behind all my years as a Microsoft developer and embrace open source, I wasn’t exactly thinking about this. But hey, that’s how it goes. At my job I’m working on a Java project; and… yes, exactly, you can imagine my face while writing this. And yes, this is my first Java project. Ever.
To summarize, this is just plain horrible; sensible hearts please don’t continue.
To start locally this (fairly complex) application you have to click on IntelliJ IDEA’s green arrow button, which is really straightforward after all. Then… you must wait for 4 minutes of compilation of changed files, then for the creation of JARs, the packaging of the WARs, their deployment, then there’s Log4J starting, and also Tomcat starting (where’s Jerrymouse???), than wait to start some Catalina thing (it’s funny, that’s the name of a flower plant I had at Buenos Aires - and yes, I give names to my plants) and then, somehow, when you see no more activity on the messages window, you have to guess that you can open a browser and see your app in http://localhost/whatever. Thanks for telling me, I waited for 2 minutes staring on the message pane without understanding.
(Of course, I will skip the complete IntelliJ IDEA configuration; it took a colleague about half an hour to click around 10 different configuration screens in order to get my local copy working. If you think that’s OK, well probably you value your time much less than I value mine, and you should stop reading.)
Needless to say, I said to myself; cool, now that everything’s running, I’ll add a JSP file and start playing with it. I created a folder, added a “helloworld.jsp” file to it, and pointed my browser to it.
404, not found.
OK, well, maybe I misplaced the file. Moved it to a place where a pre-existing html file is located. Retry in the browser. Nada. Rename to “helloworld.html”. Neither. Verified the only line of Java code to see if that was the problem.
And then the coin dropped. I restarted Tomcat, and (5 minutes later) I could execute the file.
Naturally, I tried to modify the file; file/save and go to the browser. The same output as before. Hmmm… of course, if I restart Tomcat… my modifications appear.
I cannot believe that in 2007, having used a couple of web application frameworks (to name a few: ASP, ASP.NET, PHP, Ruby on Rails, WebObjects) I happen to come accross the path of the stupidiest, clumsiest and most unnecessary complex way to run a web application, which by the way seems to be the standard way of doing stuff in this application stack. I am sorry, this is a rant and I told you. I’m outraged! Who the hell came up with this, and convinced developers around the world that it was worth it?
I can hear Java developers typing furiously in their keyboards while calling me names, because I am not able to configure Tomcat properly, after reading the gazillion pages of documentation available on the website. Well let me tell you: I DO NOT CARE. A technology that does not offer a coherent learning + approach path, just because of some sort of religious feeling of superiority or portability or security or I do not know which s**t, well, I know that I can press delete on that kind of technology fairly fast.
And yes, even using ASP.NET is easier, much easier. The OS detects that the file changed, recompiles it as soon as the first request arrives and serves the new content on the fly. I am not saying that ASP.NET is the way to go (far from that!) but there’s at least one aspect that ASP.NET does better than this Java thing: shorter development cycles and deployment. I can see this now, very clearly. But even in the Java world, even playing with WebObjects was a much, much, much more pleasing experience, with shorter development cycles.
Is it that difficult to offer such a developer experience on the first place? Is it that complicated to learn that things should be easier? Is it that complicated to do things right from the beginning?
I really do not understand. I just wonder how long it will take for me to calm down.
UPDATE (May 3rd, 2007): I finally decided to let go the JSP way, and use PHP instead; for that, just use an Apache web server on port 8080, nicely configured with the PHP module, and using the proxy modules I can just redirect my requests to the Tomcat server running locally on port 8088; my httpd.conf file looks like this:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
PHPIniDir "C:\\Program Files\\PHP\\"
LoadModule php5_module "C:\\Program Files\\PHP\\php5apache2_2.dll"
Deny from all
Allow from localhost
ProxyPass /app http://localhost:8088/app
ProxyPassReverse /app http://localhost:8088/app
Et voilà! It worked from the beginning, and it only took 5 minutes to set up. Now I can use PHP files instead of JSP files, and I avoid restarting Tomcat every so often.
UPDATE (May 4th, 2007): Of course I forgot to add that the only means I’ve found so far to STOP this application is to kill the java.exe process using Task Manager. No comments.