Re: Tomcat and Static Variables
The servlet container may (and tomcat does last I checked) create one instance of a (non-SingleThreadModel) servlet for every servlet tag in web.xml. So just have two servlet tags with different servlet-name but same servlet-class in your web.xml. You don't need two contexts for this. You nailed it right on the head. Thanks! I wonder aloud how Tomcat knows which class to use in any particular context (the server doesn't map to the Context), but maybe I'll just try it and see. So, to summarize...because I could find nothing on the topic anywhere and maybe this gets indexed somewhere...aliases and contexts do not map to different instances, server's do. The question is how I can replicate the above behavior so static variables are spanned across more than one instance? Can anyone point me at a Tomcat scoping document? The tomcat scoping document is the Servlet Specification more or less ;) For things that are left up to the container implementation, you'll need to ask or better yet, read the code. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- - John Blanco - Code Guru @ Rapture In Venice - http://members.bbnow.net/jblanco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat and Static Variables
I've got a book (extra credit to who can name it) which uses a Counter servlet as an example of how servlet containers handle static variables. It claims that aliases (I may be wrong on this, it's hard to decipher the difference between JWS and Tomcat lingo) will create different instances to the target Servlet, but static variables are recognized. So access to one servlet instance might result in: My Counter = 5, Global Counter = 8 While access to the other counter might have given you: My Counter = 4, Global Counter = 8 The global counter would be a count for the two instances combined (via the *static* field) and the my counter would be for the instance via a stanard fiield. I've tried pointing to the same WebApp via two different Context's, but the two apps are treated as completely separate, and the static variable doesn't hold. This is correct...two contexts should never interfere. The question is how I can replicate the above behavior so static variables are spanned across more than one instance? Can anyone point me at a Tomcat scoping document? -- - John Blanco - Code Guru @ Rapture In Venice - http://members.bbnow.net/jblanco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Servlets from public_html?
I'm having trouble finding information on this...so here's a last stab. I've got everything set up to host files out of my ~jblanco/public_html. However, when I put a Web application in my public_html/ I can't access the Servlet. I can access HTML just fine but I can't access my servlets. The same structure in Tomncat's webapps works just fine, so I know the structure is right. Can anyone help? Let me know what info you might be looking for...this is terribly frusterating. -- - John Blanco - Code Guru @ Rapture In Venice - http://members.bbnow.net/jblanco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reloadable Servlet?
Ahhh, I just ignored that file. Cool. :) Thanks! The newbie learned something. On Wednesday 13 August 2003 07:57, Shapira, Yoav wrote: Howdy, I see what you mean -- thanks ;) The actual URL for the hotfix is http://www.apache.org/dist/jakarta/tomcat-4/binaries / Yoav Shapira Millennium ChemInformatics -Original Message- From: Johnson, David [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 9:53 AM To: Tomcat Users List Subject: RE: Reloadable Servlet? Doh. 4.1.27. :-) The hotfix is available here: http://jakarta.apache.org/site/binindex.cgi Click on the Tomcat 4.1.27 link. It's hotfix 22096 apparently. Not sure what the bug number is, and I haven't worked out how to use the bugzilla search form properly yet. There was a discussion about it on this list a couple of weeks ago. Dave -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 2:42 PM To: Tomcat Users List Subject: RE: Reloadable Servlet? Howdy, If you're using tomcat 1.4.27 you might have more than just this problem ;) Also, if you're using Tomcat 1.4.27 then there's a bug which stops the reload from working properly. A hotfix is available from the jakarta website. What bug and fix are you referring to? Yoav Shapira Millennium ChemInformatics This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- - John Blanco - Code Guru @ Rapture In Venice - http://members.bbnow.net/jblanco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Reloadable Servlet?
This is one heck of a crach course. :) OK, I found my way through the public_html problem...but now I have a question. I want my Servlet to be reloadable. But, when I recompile and make a minor change (changing the printed string), I get the dumb that follows below in my logs and a 503 return error. If I go to TomCat Manager and Stop and then Start (not Reload) my Servlet, everything works again until I recompile and change. My question is...does my Servlet need to explicitly support a reload? 2003-08-12 23:23:27 StandardContext[/HelloWorld]: Reloading this Context has started 2003-08-12 23:23:27 WebappLoader[/HelloWorld]: Reloading checks are enabled for this Context 2003-08-12 23:23:27 StandardWrapper[/HelloWorld:org.apache.catalina.INVOKER.HelloWorld]: Marking servlet org.apache.catalina.INVOKER.HelloWorld as unavailable 2003-08-12 23:23:27 StandardContext[/HelloWorld]: Servlet /HelloWorld threw load() exception javax.servlet.ServletException: Wrapper cannot find servlet class HelloWorld or a class it depends on at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:891) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:823) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3421) at org.apache.catalina.core.StandardContext.reload(StandardContext.java:2568) at org.apache.catalina.loader.WebappLoader$WebappContextNotifier.run(WebappLoader.java:1369) at java.lang.Thread.run(Thread.java:534) - Root Cause - java.lang.ClassNotFoundException: HelloWorld at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1444) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1289) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:885) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:823) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3421) at org.apache.catalina.core.StandardContext.reload(StandardContext.java:2568) at org.apache.catalina.loader.WebappLoader$WebappContextNotifier.run(WebappLoader.java:1369) at java.lang.Thread.run(Thread.java:534) -- - John Blanco - Code Guru @ Rapture In Venice - http://members.bbnow.net/jblanco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: A good book about Tomcat
Wrox sucked anyway. I hated the red, glaring cover with the geeks in the pictures. :) If I wanted to see a geek, I'd go through my own photo album, thank you very much. The TomCat book from O'Reilly is OK, but it left be scrambling to find the real way to do things so I can't recommend it as a perfect guide. I'm sure a lot of stuff is out of date with 4.1, but it's one of the few O'Reilly books I can't recommend. I look forward to an updated edition in the future. On Thursday 14 August 2003 13:29, Mubaraka Arif wrote: Professional Apache Tomcat - Vivek Chopra, Ben Galbraith, Sing Li, Romin Irani... [Wrox Publication] is good one for TOmcat Administration and Configuration. ~ Mubaraka Arif Software Developer Administrative Technology Information Services St Mary's University San Antonio, TX -78228 On 2003.08.14 14:22 Alexander Vavilin wrote: Hi all, can anybody advice me a good book about Tomcat ???. -- Best regards, Alexander mailto:[EMAIL PROTECTED] -- --- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- - John Blanco - Code Guru @ Rapture In Venice - http://members.bbnow.net/jblanco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SERVLET?
Sometimes I get the feeling that nothing works for me and I am at the mercy of this mailing list. :) Out of the box...4.1.27 with applied, latest hotfix...I uncomment the two ssi entries in conf/web.xml...I've renamed the jarfile as instructed to server/lib/servlets-ssi.jar. I've created a file called hello-world.shtml and it's contents are: ... SERVLET CODE=HelloWorld CODEBASE=http://localhost:8080/my_app; Sorry, not for you. /SERVLET ... I've tried half a billion combos for how to do the CODEBASE/CODE...I see no other errors. And, SSI is running because in my logs I get: 2003-08-14 22:25:57 ssi: SSIServlet.doGet() 2003-08-14 22:25:57 ssi: SSIServlet.requestHandler() Serving buffered resource '/hello-world.shtml' I've restarted Tomcat several times. Can anyone think of anything I'm missing? -- - John Blanco - Code Guru @ Rapture In Venice - http://members.bbnow.net/jblanco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]