After reading some messages in the archives, I think I have an idea of what is going
on and why I am getting a ClassCastException. What I am looking for is how others
handle this problem in there organizations.
A quick overview of my situation. I am attempting to code a MVC web application. I
have a class called MenuItem which has two properties, a menu title and an action to
call when that menu item is selected. In my servlet init method I create an array of
MenuItem objects and put that array in a HashMap object, which contains multiple
menus. I then have one JSP file that is included in other JSP pages that takes 2
parameters, menu you want and current page. The JSP then generates the menu. All my
java classes are put in a JAR file and placed in the <web-context>/WEB-INF/lib
directory. the JSP files are in the <web-context> directory. If I recreate my JAR
file and overwrite the existing file, I get a ClassCastException when trying to cast
the return from the HashMap get command to my MenuItem array. I understand that the
problem has to do with a classloader and I can solve the problem by restarting Tomcat.
This is fairly easy with WinNT and the remote Server Manager. !
NOTE: All development is on NT workstations and servers. Production is on a RS/6000.
This is not a problem when there is one developer working on a web server, but in the
near future our organization will have multiple developers working on various systems.
(One to three developers per system.) I could see potential problems with restarting
Tomcat time after time and from the archive that seemed to be the easiest solution.
So . . .
1) Is there something I can do different in my webapp code to avoid the
ClassCastException?
2) In organizations where there are multiple developers, how do you organize your
code? Do you have a central repository where code is checked out and brought down to
each developers machine?
3) In organizations where there are multiple developers, how do you organize your
webserver? Does everyone test on one web server or does everyone have a web server on
their individual machine.
4) In organizations where there are multiple developers, do you have any other advice?
TIA,
Gerry Scheetz
Web Application Development
Global Information Technology Division
TRW - S&ITG
Helena, Montana, USA
[EMAIL PROTECTED]
(406) 594-1878
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html