I am having a problem with a daemon I want to create at startup. I have a singleton daemon that I used to load on startup in the init(ServletConfig) method of a servlet. The problem is that this ends up creating two versions that then run concurrently and duplicate everything they each are doing. So, I had to quite doing that and instead kickstart the daemon by putting it in doPost(HttpServletRequest, HttpServletResponse) instead. I am really not quite sure what the classloader issues are here.

I would like to kickstart the daemon on startup, because then I can avoid having to have clients get it going on their server with a call to http://localhost/kickstart where /kickstart is the mapping that calls the servlet with the daemon in doPost(HttpServletRequest, HttpServletResponse). Does someone have an idea. I am sure there are a lot of good ideas (there must be) but they are not coming to me immediately. I don't know that much about classloaders. I am not sure how the second version of the daemon is getting loaded, i.e. what other classloader is doing that. I know that each servlet has its own classloader. How that translates into the difference between init and doPost and the difference between startup of Tomcat and startup by call via doPost is dark to me.

I would just go read more intensively on classloaders, if I could know that was the way to solve this dilemma of my own making.

Thanks for any assistance on this.

Micael


LEGAL NOTICE


This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly prohibited. If you have received this transmission in error, please delete the message. Thank you



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to