Going loco 8-}

November 21, 2006

This is one of the problems that have been bothering me for a few days now.

Let me give you some background:

I just started to maintain some legacy code in our company. Development and deployment is difficult, as it is not the conventional way of doing things in Tomcat.

One of the problems I’m encountering is that if I drop a class file to the classes directory, Tomcat does not recognize that I dropped a new class.

You see, we do not put the servlets and classes on the WEB-INF\classes, common\classes or even the server\classes directory. Instead, we have a folder outside of Tomcat that holds all the class files needed for our web-app. This folder is then included in the CLASSPATH.

Yes, I have turned on servlet reloading on Tomcat, but this does not work. This is because the primordial classloader loads the classes from the CLASSPATH when they are needed. However, the primordial classloader cannot be overridden; and anything it loads cannot be unloaded or reloaded. (Hello! It’s the primordial classloader!) So, when it loads say, class Ozzie (from the CLASSPATH), it will stay loaded. Even if I drop a new Ozzie file, it won’t care. I have to restart Tomcat so I can load the new Ozzie.

This would be different if the Ozzie class were on WEB-INF\classes. If I have servlet reloading turned on, Tomcat would automatically see that I have a new class file. Same thing with the Manager.

But we have a wierd architecture, so I have to live with that. (When I’m doing code reviews, it’s always funny because sometimes I giggle at their [previous] code [The latest funny thing? SQL code on a JSP!]. Yeah, they know it’s funny. One of my officemates calls it ’sad’. But they’re smarter now. [I hope])

Does anyone know of a way to work around this (except for changing the architecture)? I can’t think of anything, really.

I just can’t stand having to restart Tomcat everytime I drop a class file, since we have a very big web application, and it takes 10-15 minutes for our server to fully start.

Entry Filed under: Daily Geekiness. .

2 Comments Add your own

  • 1. Carla  |  November 22, 2006 at 9:44 pm

    Sorry hunny… not replying because I know the answer hehehe :) Just wanted to say… Hindi ko akailaing mas geeky pa kay Oso! Bwahaha :D

  • 2. ozzie  |  November 24, 2006 at 1:16 pm

    Mas malaking geek si potpot!

    She’s THE Geek Goddess.

    Wuv yeaw hunnypot. Don’t worry I know how you feel(di ba carla?)

    The application we used to maintain would take 40 mins to restart if done locally. If we do it on the dev server, it takes 10 mins to “release” the code to the server, and another 15 to start it back up(something with a data caching thingamajig)

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


 

November 2006
S M T W T F S
« Oct   Dec »
 1234
567891011
12131415161718
19202122232425
2627282930  

a

Blogroll

Ozzie

Feeds

Recent Posts

Archives