RE: Asking Again: 5.5.12 Broke my 5.5.9 Config
Hi I'm also running TC 5.5.9 and planning on installing 5.5.12. Twice I have read through the complete Changelog, from 5.5.10 to 5.5.12. I find nothing saying this attribute is now ignored. (Remy has appended his comments at the bottom of this email). Is there other things that may have an impact at my current applications - how do I know? Q: Have I just overlooked it twice or am I looking for this kind of information at the wrong place? Thanks Trond -Original Message- From: Remy Maucherat [mailto:[EMAIL PROTECTED] Sent: Friday, September 30, 2005 10:58 To: Tomcat Users List Subject: Re: Asking Again: 5.5.12 Broke my 5.5.9 Config On 9/30/05, Bob Bronson [EMAIL PROTECTED] wrote: Hi all, I asked this question a couple days ago but received no helpful responses. I thought I'd try one more time. If anyone has had experience with this, please let me know. Thanks... I've just tried to upgrade from TC v5.5.9 to v5.5.12 and it seems my (very simple) configuration is now broken. The following configuration works beautifully under 5.5.9 -- no exceptions, no warnings, just utter perfection. Here's a description of my configuration (BTW, CATALINA_HOME and JAvA_HOME are fine, I'm sure they're not causing the problem). I have CATALINA_BASE set like this: C:\Projects\Configs\ Within this Configs directory I have two sub-directories: conf and Engine_01 like this: C:\Projects\Configs\ | +-conf\ | | | +-server.xml | +-web.xml | +-Engine01\ | | | +-localhost\ | | | | | +-ROOT.xml Within the conf directory I have my server.xml and the default web.xml files. Here is the server.xml contents: Server port=10035 shutdown=SHUTDOWN debug=0 Service name=Catalina Connector port=80 / Engine name=ENGINE_01 defaultHost=localhost Host name=localhost appBase=..\Sites\Test 1/ /Engine /Service /Server Notice I have named the engine, Engine_01. As you can see, in the Engine_01 directory I have a subdirectory, localhost, which contains a context fragment file named, ROOT.xml. Here is the contents of ROOT.xml: Context path= docBase=/ In my server.xml you'll notice I have my appBase property set to ..\Sites\Test 1. Here is the Sites directory structure: C:\Projects\Sites\ | +-Test 1\ | +-index.html +-WEB-INF\ | +-web.xml +-classes\ +-root\ It's all quite simple, I think. When I run under v5.5.9, this configuration works perfectly, as I said. Using the EXACT SAME configuration, running under v5.5.12, I see this WARNING and EXCEPTION when I start TC: WARNING: A docBase C:\Projects\Sites\Test 1\. inside the host appBase has been specified, and will be ignored Sep 26, 2005 8:37:22 PM org.apache.catalina.core.StandardContext resourcesStart SEVERE: Error starting static Resources java.lang.IllegalArgumentException: Document base C:\Projects\Configs\..\Sites\Test 1\ROOT does not exist or is not a readable directory at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:140) at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:3777) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3948) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:603) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:535) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1118) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1020) at org.apache.catalina.core.StandardHost.start(StandardHost.java:718) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442) at org.apache.catalina.core.StandardService.start(StandardService.java:450) at org.apache.catalina.core.StandardServer.start(StandardServer.java:680) at org.apache.catalina.startup.Catalina.start(Catalina.java:536) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at
RE: Asking Again: 5.5.12 Broke my 5.5.9 Config
Thanks, but you are missing my point here. Basically what your saying is, before upgrading to a newer version of Tomcat, scan through the mailing list and reread the whole Tomcat config documentation! Isn't that what changelogs are for? Pointing out the changes so you don't have to search for the needle in the heystack? \trond PS: By all means, please excuse me if it realy is in the changelog, but I don't find it and that was also my original question. -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Friday, September 30, 2005 17:29 To: Tomcat Users List Subject: RE: Asking Again: 5.5.12 Broke my 5.5.9 Config From: Trond Hersløv [mailto:[EMAIL PROTECTED] Subject: RE: Asking Again: 5.5.12 Broke my 5.5.9 Config I find nothing saying this attribute is now ignored. RTFM: The value of this field must not be set except when statically defining a Context in server.xml, as it will be infered [sic] from the filenames used for either the .xml context file or the docBase. http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html Look at the description of the path attribute. This has also been discussed numerous times on the mailing list, so a brief search through the archives would have gotten you the same information. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** This email message has been swept by MIMEsweeper for the presence of computer viruses. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Asking Again: 5.5.12 Broke my 5.5.9 Config
Thanks for clarifying that! \trond -Original Message- From: Remy Maucherat [mailto:[EMAIL PROTECTED] Sent: Friday, September 30, 2005 18:05 To: Tomcat Users List Subject: Re: Asking Again: 5.5.12 Broke my 5.5.9 Config On 9/30/05, Trond Hersløv [EMAIL PROTECTED] wrote: Hi I'm also running TC 5.5.9 and planning on installing 5.5.12. Twice I have read through the complete Changelog, from 5.5.10 to 5.5.12. I find nothing saying this attribute is now ignored. (Remy has appended his comments at the bottom of this email). Is there other things that may have an impact at my current applications - how do I know? Q: Have I just overlooked it twice or am I looking for this kind of information at the wrong place? The path attribute was already ignored in 5.5.9. docBase is now also ignored if inside the Host's appBase. -- x Rémy Maucherat Developer Consultant JBoss Group (Europe) SàRL x - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** This email message has been swept by MIMEsweeper for the presence of computer viruses. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
error in the servlet spec v2.4?, not the Session issue!
Hi, How precise is the servlet spec v2.4? I guess the spec has been worked over many, many times before it is released so probably it is me that has got it wrong. The introduction of srv.5 The Response: .this information is transmitted from the server to the client either by HTTP headers or the message body of the request. My question: shouldn't it be ...body of the response? \trond ** This email message has been swept by MIMEsweeper for the presence of computer viruses. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: db-connectin is working fine, but is it pooling?
Hi Thanks Pete. That seems to be the case. \trond -Original Message- From: Lucuk, Pete [mailto:[EMAIL PROTECTED] Sent: 23. september 2005 17:43 To: Tomcat Users List Subject: RE: db-connectin is working fine, but is it pooling? I had a similar question while doing connection pooling with Oracle 8i of. OK, if I set my connection pool to 10, why do I only see a 1 connection in Oracle Well, the answer was that when you create a pool of 10, it only starts out with 1 connection, NOT 10 If the connection pool starts needing more than 1 connection, it will create and *keep* new connections. Oracle's connection pooling jar was smart enough to do it. I opened up 4 web browsers and hit my web based app like crazy and saw the acutal physical connections in Oracle jump up to like 5 and stayed at 5 connections. I assume it is the same in MySQL -Original Message- From: KEREM ERKAN [mailto:[EMAIL PROTECTED] Sent: Friday, September 23, 2005 2:50 AM To: 'Tomcat Users List' Subject: RE: db-connectin is working fine, but is it pooling? Write a test connection page and stress test it with a lot of virtual clients. That way, you will have more than 1 connection opened to ypur pool. -Original Message- From: Trond Hersløv [mailto:[EMAIL PROTECTED] Sent: Friday, September 23, 2005 3:24 AM To: Tomcat Users List Subject: RE: db-connectin is working fine, but is it pooling? Thanks, I'll do that, but still - how can I be sure that my pool have more than just this one connection. Writing two servlets with endless loops, avoiding checking the connections back would give me the answer I guess. But why is there only one connection established to my DB server?? Is there a way to configure the pool to pre generate eg. 10 connections? \trond -Original Message- From: Kyle [mailto:[EMAIL PROTECTED] Sent: 23. september 2005 02:14 To: Tomcat Users List Subject: Re: db-connectin is working fine, but is it pooling? Print out your Connection Object .toString() to stdout or on a page and you should see that it is a Pool(ed|able) Connection object. K Trond Hersløv wrote: Everything works just fine, but I'm a little bit concerned that maybe I am generating a singel connection to the DB and not a pool of connections. As I run netstat -a on the machine hosting the DB, I expected to find a lot of connections to port 3306, which my MySQL server listens to, but there is only one single connection. Even when I press F5 for a long time to refresh my IE window like a 100 times or with more windows open at the same time there is just this one connection to be found. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** This email message has been swept by MIMEsweeper for the presence of computer viruses. ** - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
db-connectin is working fine, but is it pooling?
Hi! I'm running TC5.5 and MySQL-4.0.20 on two separate Linux boxes. Trying setting up a DB connection pool, I followed the example found on: jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-datasource-examples-howto.html Everything works just fine, but I'm a little bit concerned that maybe I am generating a singel connection to the DB and not a pool of connections. As I run netstat -a on the machine hosting the DB, I expected to find a lot of connections to port 3306, which my MySQL server listens to, but there is only one single connection. Even when I press F5 for a long time to refresh my IE window like a 100 times or with more windows open at the same time there is just this one connection to be found. Resource name=jdbc/mysql auth=Container type=javax.sql.DataSource maxActive=100 maxIdle=30 maxWait=1 minIdle=10 username=pool password=pool driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://172.20.201.92:3306/test/ Have I misunderstood the concept of connection pooling? Where does the magic happened. Nothing hier like a factory or pooling class? Regards Trond ** This email message has been swept by MIMEsweeper for the presence of computer viruses. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: db-connectin is working fine, but is it pooling?
Thanks, I'll do that, but still - how can I be sure that my pool have more than just this one connection. Writing two servlets with endless loops, avoiding checking the connections back would give me the answer I guess. But why is there only one connection established to my DB server?? Is there a way to configure the pool to pre generate eg. 10 connections? \trond -Original Message- From: Kyle [mailto:[EMAIL PROTECTED] Sent: 23. september 2005 02:14 To: Tomcat Users List Subject: Re: db-connectin is working fine, but is it pooling? Print out your Connection Object .toString() to stdout or on a page and you should see that it is a Pool(ed|able) Connection object. K Trond Hersløv wrote: Everything works just fine, but I'm a little bit concerned that maybe I am generating a singel connection to the DB and not a pool of connections. As I run netstat -a on the machine hosting the DB, I expected to find a lot of connections to port 3306, which my MySQL server listens to, but there is only one single connection. Even when I press F5 for a long time to refresh my IE window like a 100 times or with more windows open at the same time there is just this one connection to be found. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** This email message has been swept by MIMEsweeper for the presence of computer viruses. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Custom tags and scope
Hi, I do not have a lot of experience in programming custom tags. Now, having programmed a couple of tags, I think it is kind of strage that I cannot narrow the scope of variables defined in the taghandler down to the body of the custom tag. It would for me clearly gain the purpose of code usability if so was the case. I hope I have missed something and that there may is a way to configure the tld file so that the scope of variables is restricted to the body. Here is the code to clarify what i mean: TAGHANDLER (shortened for readability): Public void doTag() extends JpsExtension{ PageContext pc = (PageContext)getJspContext(); JspFragment body = getJspBody(); pc.SetAttribute(testvar, myvalue); body.invoke(null); } JSP (shortend for readability): htmlheadtitletest/title/head my:testtag${testvar}/my:testtag !-- now, this should be out of the scope, but it isnt: -- ${testvar} /html I do not want to specify or declare the variable first in the jsp. I also think that using an attribute to hold the name of the variable used is a bad idea. I absolutely want to use EL. Is there any hope, or do I have to live with it? Would appreciate any tips and workarounds Regards Trond ** This email message has been swept by MIMEsweeper for the presence of computer viruses. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: web.xml, url-pattern
Hi Thanks a lot for clarifying that. At the bottom you say: the servlet spec. Im reading The J2EE 1.4 Tutorial, for Sun Java System Application Server Platform. Isnt Tomcat the referential project for this technologi? Can you please be so kind and explain what the servlet spec. has to do with configuring the deployment descriptor. Could you give me a link to the servlet spec? Thanks again, Trond -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: 12. september 2005 20:17 To: Tomcat Users List Subject: Re: web.xml, url-pattern Trond Hersløv wrote: But, if I try using wildcards, eg. url-pattern/*foxer/url-pattern it doesent work anymore. Correct. Wildcards are not supported for mapping paths. Read the servlet spec for more details. If I try to map the servlet so that it seems like a jsp-page url-pattern/foxer.jsp/url-pattern, it doesn't work at all. Also correct. There is a server-wide mapping for *.jsp (wild cards are supported for extension mapping) in $TOMCAT_HOME/conf/web.xml In the book I also read that I should be able to access the servlet even if it's not mapped up in web.xml. http://www.mymachine.no/servlet/foxer Ofcourse this does also not work. This is using the invoker servlet, which is disabled by default. Who can explain how to use the url-pattern and maybe tell me where I can find some documentation on how to configure web.xml The servlet spec. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** This email message has been swept by MIMEsweeper for the presence of computer viruses. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
web.xml, url-pattern
Hi! I'm running Tomcat 5.5.9 and I'm struggeling getting the grip of how to work with the deployment descriptor. If I do the following (the web.xml below) I can access the TestServlet with: http://www.mymachine.no/foxer and I get the correct output. But, if I try using wildcards, eg. url-pattern/*foxer/url-pattern it doesent work anymore. In fact it seems like the astrisk is not interpreted as a wildcard but a normal character. I can accsses the servlet with http://www.mymachine.no/*foxser. If I try to map the servlet so that it seems like a jsp-page url-pattern/foxer.jsp/url-pattern, it doesn't work at all. In the Java Servlet JSP Cookbook by Bruce W. Perry from O`Reilly I have read what I know about web.xml, but maybe it has been som changes in how version 5.5.9 works. In the book I also read that I should be able to access the servlet even if it's not mapped up in web.xml. http://www.mymachine.no/servlet/foxer Ofcourse this does also not work. Who can explain how to use the url-pattern and maybe tell me where I can find some documentation on how to configure web.xml Thanks in advance Trond ?xml version=1.0 encoding=ISO-8859-1? web-app servlet servlet-namefoobar/servlet-name servlet-classcom.tdev.test.TestServlet/servlet-class /servlet servlet-mapping servlet-namefoobar/servlet-name url-pattern/foxer/url-pattern /servlet-mapping /web-app ** This email message has been swept by MIMEsweeper for the presence of computer viruses. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Context in separate file doesn't work
Hi tomcat fellas! http://venus:8080 gives me the index.html in the folder /home/trond/GTG/inside, but only when I use the server.xml below. When I take the Context. / and put it in a separate file, ${CATALINA_HOME}/conf/Catalina/venus/test.xml it doesnt work anymore. Does anybody know why? Do I have to set any attributes like autoDeploy=false in the Host tag or what am I missing here? Thanks in advance. \trond * server.xml Server port=8005 shutdown=SHUTDOWN GlobalNamingResources !-- Used by Manager webapp -- Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved factory=org.apache.catalina.users.MemoryUserDatabaseFactory pathname=conf/tomcat-users.xml / /GlobalNamingResources Service name=Catalina Connector port=8080 / !-- This is here for compatibility only, not required -- Connector port=8009 protocol=AJP/1.3 / Engine name=Catalina defaultHost=localhost Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase / Host name=localhost appBase=/home/trond/GTG/outside / Host name=venus appBase=/home/trond/GTG/inside Context docBase=/home/trond/GTG/inside path=/ / /Host /Engine /Service /Server ** ** This email message has been swept by MIMEsweeper for the presence of computer viruses. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Context in separate file doesn't work
Hi George, Thank you very much, you made my day!! I thought I could name the .xml files whatever I like to, but that was a huge mistake that costed me 2 days. Naming the file ROOT.xml solved the problem. Can't remember having read that anywhere in the doc's. Don't know if it's just a bad style, but path= and path=/ seems both to work well. But I'll listen to you and use an empty string. Once again, thank you very much and have a nice weekend -Original Message- From: George Sexton [mailto:[EMAIL PROTECTED] Sent: Friday, September 02, 2005 18:13 To: 'Tomcat Users List' Subject: RE: Context in separate file doesn't work One other thing, for a ROOT context, the file should be named ROOT.xml George Sexton MH Software, Inc. http://www.mhsoftware.com/ Voice: 303 438 9585 -Original Message- From: Trond Hersløv [mailto:[EMAIL PROTECTED] Sent: Friday, September 02, 2005 4:50 AM To: Tomcat Users List Subject: Context in separate file doesn't work Hi tomcat fellas! http://venus:8080 gives me the index.html in the folder /home/trond/GTG/inside, but only when I use the server.xml below. When I take the Context. / and put it in a separate file, ${CATALINA_HOME}/conf/Catalina/venus/test.xml it doesnt work anymore. Does anybody know why? Do I have to set any attributes like autoDeploy=false in the Host tag or what am I missing here? Thanks in advance. \trond * server.xml Server port=8005 shutdown=SHUTDOWN GlobalNamingResources !-- Used by Manager webapp -- Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved factory=org.apache.catalina.users.MemoryUserDatabaseFactory pathname=conf/tomcat-users.xml / /GlobalNamingResources Service name=Catalina Connector port=8080 / !-- This is here for compatibility only, not required -- Connector port=8009 protocol=AJP/1.3 / Engine name=Catalina defaultHost=localhost Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase / Host name=localhost appBase=/home/trond/GTG/outside / Host name=venus appBase=/home/trond/GTG/inside Context docBase=/home/trond/GTG/inside path=/ / /Host /Engine /Service /Server ** ** This email message has been swept by MIMEsweeper for the presence of computer viruses. ** - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat5.5 and Logging
Hi, what happend with the Logging component form TC5.0? I used to include a Logger className=org.apache.catalina.logger.FileLogger.. inside Host to get my logging going. How do I do this under TC5.5 Regards Trond ** This email message has been swept by MIMEsweeper for the presence of computer viruses. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat5.5 and Logging
Ouch, sorry! Should have done my homework better. Thanks Trond -Original Message- From: GB Developer [mailto:[EMAIL PROTECTED] Sent: Friday, September 02, 2005 21:24 To: 'Tomcat Users List' Subject: RE: Tomcat5.5 and Logging http://jakarta.apache.org/tomcat/tomcat-5.5-doc/logging.html -Original Message- From: Trond Hersløv [mailto:[EMAIL PROTECTED] Sent: Friday, September 02, 2005 2:06 PM To: Tomcat Users List Subject: Tomcat5.5 and Logging Hi, what happend with the Logging component form TC5.0? I used to include a Logger className=org.apache.catalina.logger.FileLogger.. inside Host to get my logging going. How do I do this under TC5.5 Regards Trond - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** This email message has been swept by MIMEsweeper for the presence of computer viruses. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
HttpSession
Hi! What do I have to do if want to use a modified HttpSession class? Can I do one of the following: Hope I don't have to do it this way: 1) extract $CATALINA_HOME/common/lib/servlet-api.jar 2) decompile HttpSession.class -- HttpSession.java 3) make my modifications on HttpSession.java and compile -- HttpSession.class 4) build a new servlet-api.jar containing the modified HttpSession.class instead of the original one. It would be nice if this was possible. 1) create a new class MyHttpSession which extends HttpSession 2) add my extra funcionality to MyHttpSession. 3) compile MyHttpSession -- MyHttpSession.class and putt it into $CATALINA_HOME/common/classes 4)The big QUESTION: How do I config tomcat to use MyHttpSession.class instead of HttpSession. Thanks in advance \trond ** This email message has been swept by MIMEsweeper for the presence of computer viruses. **
Re: HttpSession
Thanks alot Mike, I will try this out during the day and let you if I was successfull or not. \trond -Opprinnelig melding- Fra: Mike Fowler [mailto:[EMAIL PROTECTED] Sendt: Friday, July 02, 2004 11:04 Til: Tomcat Users List Emne: Re: HttpSession Trond- HttpSession.class in servlet-api.jar is an interface as is implemented in several places in the Tomcat source. To add new functionality I would make changes to the following classes and recompile Tomcat: -javax.servlet.http.HttpSession.java add your new methods: public void myHelperMethod(); -org.apache.catalina.session.StandardSession.java implement your new method: public void myHelperMethod() { //useful code } -org.apache.catalina.session.StandardSessionFacade.java add the lines: public void myHelperMethod() { this.session.myHelperMethod(); } -org.apache.catalina.cluster.session.DeltaSession.java implement your new method: public void myHelperMethod() { //useful code } -org.apache.catalina.cluster.session.DeltaSessionFacade.java add the lines: public void myHelperMethod() { this.session.myHelperMethod(); } Hope this helps! -Mike Fowler I could be a genius if I just put my mind to it, and I, I could do anything, if only I could get 'round to it Trond Hersløv wrote: Hi! What do I have to do if want to use a modified HttpSession class? Can I do one of the following: Hope I don't have to do it this way: 1) extract $CATALINA_HOME/common/lib/servlet-api.jar 2) decompile HttpSession.class -- HttpSession.java 3) make my modifications on HttpSession.java and compile -- HttpSession.class 4) build a new servlet-api.jar containing the modified HttpSession.class instead of the original one. It would be nice if this was possible. 1) create a new class MyHttpSession which extends HttpSession 2) add my extra funcionality to MyHttpSession. 3) compile MyHttpSession -- MyHttpSession.class and putt it into $CATALINA_HOME/common/classes 4)The big QUESTION: How do I config tomcat to use MyHttpSession.class instead of HttpSession. Thanks in advance \trond ** This email message has been swept by MIMEsweeper for the presence of computer viruses. ** - 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]
RE: Log rotation HOWTO
Oh, noSYNTAX ERROR..sorry WRONG: 0 1 * * * /path/to/script/rotate_log /path/to/script/rotate_log 21 I forgot to name the log file (otherwise you overwrite your rotate_log script, and it will only work once): RIGHT: 0 1 * * * /path/to/script/rotate_log /path/to/script/logfile 21 Anyway...a good example of how you not should name your files.. \trond Hi, maybe you would try the following: Create a bash-script (or on windows a .bat, with modifications) create a file called e.g. /path/to/script/rotate_log #!/bin/sh file_to_zip=`date +'%m%d' cp /your_path_to/catalina.out /your_rot_dir/$file_to_zip echo -n catalina.out cd /your_rot_dir gzip $file_to_zip cd /your_path_to $ crontab -e (as a user with reading permission for catalina.log and add the following line to rotate the log 1 am every day) 0 1 * * * /path/to/script/rotate_log /path/to/script/rotate_log 21 If you are very unlucky, you might loose log entrys between the cp statement and the echo statement. At least this doesn't change the i-node of the catalina.out file, hence the logging should continue. I have not tried this myself, and there is NO WARRENTY that it is working. I SUGGEST you await some comments from other users here before you trie it out. Be aware of possible misspellings of file names. It is ment to give you an idea of how to rotate the logs. \trond -Opprinnelig melding- Fra: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sendt: Tuesday, June 29, 2004 21:09 Til: Tomcat Users List Emne: [GFI-SPAM-BA] - RE: Log rotation HOWTO - Bayesian Filter detected spam Hi, Or rather, you can't rotate catalina.out using functionality built into tomcat. You can use an external tool such as Apache's logrotate (no space in the name, google for it). And as the original poster mentioned this has been discussed numerous times ;) Yoav -Original Message- From: Dale, Matt [mailto:[EMAIL PROTECTED] Sent: Tue 6/29/2004 3:05 PM To: Tomcat Users List Cc: Subject: RE: Log rotation HOWTO You can't rotate catalina.out. You shouldnt have much in there anyway if your webapps are coded correctly. If you have an webapp that outputs a lot to it you can add a customer logger to the context and it is rotated automatically every day. Ta Matt -Original Message- From: Emerson Cargnin [mailto:[EMAIL PROTECTED] Sent: 29 June 2004 18:30 To: Tomcat Users List Subject: Re: Log rotation HOWTO I didn't find how to make the catalina.log file split each day. !-- Logger shared by all Contexts related to this virtual host. By default (when using FileLogger), log files are created in the logs directory relative to $CATALINA_HOME. If you wish, you can specify a different directory with the directory attribute. Specify either a relative (to $CATALINA_HOME) or absolute path to the desired directory.-- Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=localhost_log. suffix=.txt timestamp=true/ what should I change in the following tag to get it done...? thanks Emerson I©q´me Duval wrote: Search the mailing list! This question was asked recently... These messages might be useful... -Original Message- From: Frank Zammetti [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 29, 2004 10:04 AM To: [EMAIL PROTECTED] Subject: Log rotation HOWTO I haven't been able to find a clear answer to this anywhere online, hopefully you fine folks can help... I need a way to rotate my stdout log in Tomcat 5.0.18. It could be dalily or weekly (monthly might be OK too). Is thre any way to do this? I assume so, so how? Thanks in advance all! _ Get fast, reliable Internet access with MSN 9 Dial-up? now 3 months FREE! http://join.msn.click-url.com/go/onm00200361ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Subject: AW: Managing Tomcat logs From: Gunnar Oörschke [EMAIL PROTECTED] Date: Tue, 22 Jun 2004 09:24:09 -0400 To: 'Tomcat Users List' [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Could you please use tomcats web admin to change logging settings... By default you can access http://localhost:8080/admin You can activate a separate log for several contents. -Urspr¼ngliche Nachricht- Von: Veera Sivakumar [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 22. Juni 2004 11:47 An: Tomcat Users List Betreff: Managing Tomcat logs Hi, I am using Tomcat as web server for my application. I start Tomcat using windows service. All the logs generated by the Application are written in to a file called stdout.log which is under tomca/logs folder. I have noticed that with continuous use of
request process flow and user profiling
Hi, I need to mainten a profile database with login, password, telephone numbers and so on. I think I need to know how tomcat is handeling the request flow. My goal is to achive the following (if there are better ways to it, please let me know). Profile profile = request.getSessio().getProfile(); if( ! profile.loggedIn){ the user is not logged in... else telephoneNumber=profile.getNumber(); } I suppose there is a kind of pipeline of servlets that one after another is processing the request object untill it finally is handeled by the end servlet (e.g test.jsp) If it doesn't allready exists, I would like to extend the session object with to members: short: public class mySession extends Session{ Boolean loggedIn; Profileprofile; } and put a class into the pipeline which, dependend on wether or not the user is logged in, sets loggedIn=true and profile=som object containg profile information; Does this allready exist as a functionallity in tomcat? I know other servlet-containers (Dynamo from ATG) has this kind of profile handeling. Where can I find documentation on how tomcat is processing the request flow? Thanks in advance trond ** This email message has been swept by MIMEsweeper for the presence of computer viruses. **
SV: request process flow and user profiling
Thanks, but I still don't know where to look for documentation. Can you give me a link to pages describing Tomcat's pipeline and how to use valves? \trond -Opprinnelig melding- Fra: Filip Hanik - Dev [mailto:[EMAIL PROTECTED] Sendt: Tuesday, June 22, 2004 00:05 Til: Tomcat Users List Emne: Re: request process flow and user profiling you have tons of options, Servlet filters (standard servlet API) lets you process requests. Using a MVC framework, such as struts, you can build your own controllers, hence do a bunch of stuff there Use Tomcat's pipeline by building valves Filip - Original Message - From: Trond Hersløv [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 21, 2004 4:46 PM Subject: request process flow and user profiling Hi, I need to mainten a profile database with login, password, telephone numbers and so on. I think I need to know how tomcat is handeling the request flow. My goal is to achive the following (if there are better ways to it, please let me know). Profile profile = request.getSessio().getProfile(); if( ! profile.loggedIn){ the user is not logged in... else telephoneNumber=profile.getNumber(); } I suppose there is a kind of pipeline of servlets that one after another is processing the request object untill it finally is handeled by the end servlet (e.g test.jsp) If it doesn't allready exists, I would like to extend the session object with to members: short: public class mySession extends Session{ Boolean loggedIn; Profileprofile; } and put a class into the pipeline which, dependend on wether or not the user is logged in, sets loggedIn=true and profile=som object containg profile information; Does this allready exist as a functionallity in tomcat? I know other servlet-containers (Dynamo from ATG) has this kind of profile handeling. Where can I find documentation on how tomcat is processing the request flow? Thanks in advance trond ** This email message has been swept by MIMEsweeper for the presence of computer viruses. ** - 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]
RE: Tomcat 5 Database Connections
Hi! I had the same problem. I was confused by all the different ways there are to configure tomcat. After five days I simply tried the simplest and most straight forward way. Forget GlobalNamingResources, web.xml, resource-ref, res-ref-name. Do it like this (based on the turorials MyFirst, and I know you know what to subsitute so it sutes your app: Put the following either inside your Host/Host in the server.xml or in the work-dir (in my case: tomcat_home/conf/Catalina/localhost/MyFirst.xml). It worked both ways. Try this first as is. Do not put anything database related into your WEB-INF/web.xml This is my test, so I don't mind exposing login and password. Maybe this isn't the correct way to do it, but it got me started and I can change it later as I get more experienced. Please give me comments if this would leed me into any kind of problems later. Context docBase=MyFirst path=/MyFirst workDir=work/Catalina/localhost/MyFirst Resource name=jdbc/mysql type=javax.sql.DataSource auth=Container/ ResourceParams name=jdbc/mysql parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value200/value /parameter parameter namepassword/name value.tomcat./value /parameter parameter nameurl/name valuejdbc:mysql://localhost/demo/value /parameter parameter namedriverClassName/name valuecom.mysql.jdbc.Driver/value /parameter parameter namemaxIdle/name value200/value /parameter parameter nameusername/name valuetomcat/value /parameter /ResourceParams /Context -Opprinnelig melding- Fra: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sendt: Friday, June 18, 2004 19:32 Til: Tomcat Users List; [EMAIL PROTECTED] Emne: [GFI-SPAM-BA] - RE: Tomcat 5 Database Connections - Bayesian Filter detected spam Hi, A few notes: First, I see on your other thread that you now have this working and suspect something else was the cause, like a tag error. I'm glad it's working, and as you noted in the same message it's rock solid. Second, I just did a clean tomcat install and followed the JDBC DataSource how-to *to the letter* to set up a connection pool for an existing Oracle database. I didn't run into any problems, including the cannot locate driver 'null' for url 'null' type of problem. It works exactly as expected. This is obviously not my first time doing this, but it's the first time I've done it manually from scratch in more than a year, and I'm pleased to discover the document is complete and accurate. Third, and this is a bit superfluous but I'll mention it anyway: you can't conclude that most users are finding it difficult from the archives of this list. The reason is that you don't hear from people who succeed, because they have nothing to brag about, they just followed the documentation. All you hear from are those who are having problems, which even if we heard about this once a day would still be a small minority of tomcat users judging from the tomcat download counts. Of course this is an analysis that's hard to do precisely because we don't know what percentage of downloaders use the connection pooling, but the bottom line is still that you only hear problems and not good experienced. Finally, as to your point that this should be simpler: most of these elements, specifically the Resource/ResourceParams declaration in a server configuration file and matching resource link in web.xml, as well as the JNDI environment namespace, are mandated by the J2EE Specification. It's not our choice to declare and configure things this way. The specific parameters, such as maxActive/maxIdle/maxWait/username are mandated by the connection pool implementation: even though we bundle DBCP and offer documentation for it, we by no means require the user to use it. It's trivial to swap another DataSource pool provider and use that with tomcat instead. So most of this is out of our hands, and if you have a good idea for a simpler mechanism the place to bring it up is the J2EE expert groups. Yoav Shapira Yoav Shapira Millennium Research Informatics -Original Message- From: Jeff Sexton [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 16, 2004 2:21 PM To: [EMAIL PROTECTED] Subject: Tomcat 5 Database Connections This is part question and part observation regarding database connectivity under Tomcat (5.0.24). My application normally runs in production at my company on a Tomcat 4.0.4 server. The applications includes Cocoon and access to several databases (Sybase) via both Tomcat connections from servlets and from Cocoon XSP pages. I've been at this for awhile now and I'm a huge fan of Tomcat (and Cocoon). On a new test server I setup Tomcat 5.0.24 and installed my applications. For sometime I thought all was well because most of my stuff is Cocoon driven, and it's fine, including database connectivity. This week I realized that my servlets are getting: org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null', cause:
MySQL-connection pool
Hi ! I have installed MySQL and is able to access it in a servlet like this: Class.forName(com.mysql.jdbc.Driver).newInstance(); Connection conn = DriverManager.getConnection(jdbc:mysql://localhost/demo?user=tomcatpasswor d=.tomcat.); This creates a new connection to the DB every time, and I therefore want to use a connection pool. I tried to set up a connection pool in the tomcat-admin interface, but it seems like I can't get it right. I'm also not quit sure how to get a connection from the pool even if it is set up right. I assume something like this would be correct: Connection conn = DriverManager.getConnection(mysql), where mysql is the jndi name of my pool. The Tomcat documentation referrs to a non existing link ( http://jakarta.apache.org/commons/dbcp/api/index.html http://jakarta.apache.org/commons/dbcp/api/index.html ). Do I have to install any extra classes to make the connection pool work correctly? Here is my current system config Linux 2.4.20 Apache webserver: 2.0.49 jk2: 2.0.4 Tomcat: 5.0.24 MySql: 4.0.20 MySQL-connector: 3.0.12 J2SDK 1.4.2_04 Who can give me an example of how to set up and get a connection from a pool with connections to a MySQL database? Thanks, Trond ** This email message has been swept by MIMEsweeper for the presence of computer viruses. **
SV: Tomcat virtualhost bug?
Sorry about that. I'm a freshman and just tried to keep it short and simple (as I thought I was supposed to). Anyway - my server.xml: Have no idea what those listeners and Global naming resourses are doing, but I'll deal with it later ( I hope) Turning autodeploy off didn't help :-( Thanks for helping me out. Server port=8005 shutdown=SHUTDOWN debug=0 Listener className=org.apache.catalina.mbeans.ServerLifecycleListener debug=0/ Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener debug=0/ GlobalNamingResources Environment name=simpleValue type=java.lang.Integer value=30/ Resource name=UserDatabase auth=Container type=org.apache.catalina.UserDatabase description=User database that can be updated and saved /Resource ResourceParams name=UserDatabase parameter namefactory/name valueorg.apache.catalina.users.MemoryUserDatabaseFactory/value /parameter parameter namepathname/name valueconf/tomcat-users.xml/value /parameter /ResourceParams /GlobalNamingResources Service name=Catalina Connector port=8009 enableLookups=false redirectPort=8443 debug=0 protocol=AJP/1.3 / Engine name=Catalina defaultHost=uuu.platin.no debug=0 Logger className=org.apache.catalina.logger.FileLogger prefix=catalina_log. suffix=.txt timestamp=true/ Realm className=org.apache.catalina.realm.UserDatabaseRealm debug=0 resourceName=UserDatabase/ Host name=uuu.platin.no debug=0 appBase=webapps unpackWARs=true autoDeploy=false xmlValidation=false xmlNamespaceAware=false Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=uuu suffix=.txt timestamp=true/ Context path= docBase=en debug=1 override=true/ /Host Host name=www.platin.no debug=0 appBase=webapps unpackWARs=true autoDeploy=false xmlValidation=false xmlNamespaceAware=false Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=www suffix=.txt timestamp=true/ Context path= docBase=tre debug=1 override=true/ /Host Host name=vvv.platin.no debug=0 appBase=webapps unpackWARs=true autoDeploy=false xmlValidation=false xmlNamespaceAware=false Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=vvv suffix=.txt timestamp=true/ Context path= docBase=to debug=1 override=true/ /Host /Engine /Service /Server Trond -Opprinnelig melding- Fra: QM [mailto:[EMAIL PROTECTED] Sendt: Tuesday, May 25, 2004 15:12 Til: Tomcat Users List Emne: Re: Tomcat virtualhost bug? On Tue, May 25, 2004 at 07:16:29AM +0200, Trond Hersl?v wrote: : I thought everything was fine, BUT then I realized that I could access app2 : like this: http://test1.athome.no/test2 http://test1.athome.no/test2 . : What am I doing wrong? Perhaps autodeploy is enabled? If not, read on: : Host name=test1.athome.no . appBasewebapps. : . : . : Context path= docBase=test1 . : /Host -but what, specifically, is the .? That's the best part! =) Seriously, please post the entire server.xml when possible. That makes it easier for people to help you, should you have a server.xml problem. -QM -- software -- http://www.brandxdev.net tech news -- http://www.RoarNetworX.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** This email message has been swept by MIMEsweeper for the presence of computer viruses. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SV: SV: Tomcat virtualhost bug?
Getting closer. I removed all logs, and all the servlets from (cd work/Catalina/;rm -rf *). Startet up tomcat, and as you said, all the web applications were generated under all three hosts (is that deploying?). But I dont understand why that happens. I have the Host attribute autoDeploy=false. You say disable deployOnStartup. Did you mean autoDeploy? What else can causee those apps to be precompiled as tomcat is starting up? What is the point of setting Host:webapps, Context:docBase and Context:path when all three virtualHost always take every application it finds under webapps? I do really appreciate the way you are helping me out here. Trond ( -Opprinnelig melding- Fra: QM [mailto:[EMAIL PROTECTED] Sendt: Tuesday, May 25, 2004 18:42 Til: Tomcat Users List Emne: Re: SV: Tomcat virtualhost bug? On Tue, May 25, 2004 at 05:48:52PM +0200, Trond Hersl?v wrote: : Sorry about that. I'm a freshman and just tried to keep it short and simple : (as I thought I was supposed to). It helps to follow the list for a day or two before posting. =) The first thing that strikes me: disable deployOnStartup in the Host element, otherwise each virtual host will deploy any webapp under the appBase dir. Check the Tomcat logs to see whether each of your webapps is being deployed 3 times (1 for each vhost). If that doesn't help, I'll look at your server.xml again... but nothing leaped out at me the first time. : Anyway - my server.xml: : Have no idea what those listeners and Global naming resourses are doing, but : I'll deal with it later ( I hope) All of that is described in the Tomcat docs. Please review those. -QM -- software -- http://www.brandxdev.net tech news -- http://www.RoarNetworX.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** This email message has been swept by MIMEsweeper for the presence of computer viruses. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SV: Tomcat virtualhost bug?
Thanks QM, funny as it sounds, but nothing works and I'm happy. No I must just deploy my apps manually. GREAT! I'll drink a cold norwegian beer now. - haven't slept since saturday. Thanks again. -Opprinnelig melding- Fra: QM [mailto:[EMAIL PROTECTED] Sendt: Tuesday, May 25, 2004 19:37 Til: Tomcat Users List Emne: Re: SV: SV: Tomcat virtualhost bug? On Tue, May 25, 2004 at 07:25:14PM +0200, Trond Hersl?v wrote: : You say disable deployOnStartup. Did you mean autoDeploy? Not at all -- I most certainly meant deployOnStartup. Please search the online Tomcat docs for this term, it is explained in detail. : What is the point of setting Host:webapps, Context:docBase and Context:path : when all three virtualHost : always take every application it finds under webapps? See above ref to deployOnStartup. =) -QM -- software -- http://www.brandxdev.net tech news -- http://www.RoarNetworX.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** This email message has been swept by MIMEsweeper for the presence of computer viruses. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat virtualhost bug?
Hi, I need some help here. Running: Apache 2.0.49, Tomcat 5.0.24 and jk2 2.0.4. Tomcat and the webserver running on separate machines. The webserver is set up with to virtualhosts. test1.athome.no test2.athome.no workers2.properties is set up so all *.jsp request are sent to Tomcat. [channel.socket:172.20.201.92:8009] [uri:/*] On Tomcat I have to webapps: app1 and app2. app1 should be for test1.athome.no app2 for test2.athome.no I thought everything was fine, BUT then I realized that I could access app2 like this: http://test1.athome.no/test2 http://test1.athome.no/test2 . What am I doing wrong? Host name=test1.athome.no . appBasewebapps. . . Context path= docBase=test1 . /Host The virtual host for test2 is set up in the same way. How can I prevent a virtual host from having access to all the other webapplications? I appreciate any help I can get. Trond ___ it's 25.may and Norway is getting warmer ** This email message has been swept by MIMEsweeper for the presence of computer viruses. **