Web apps vs. Logging vs. Tomcat
I have been trying to get really serious about log4j in web apps. I note that Tomcat (thanks to commons-logging) uses java.util.logging *except* for loggers created while my web app's classloader is the current contextual classloader -- at which point it suddenly uses log4j (since my web app does) without giving my web app a chance to initialize it in any way as best I can tell. My web app has a ServletContextListener which initializes log4j by setting up its own LoggerRepository, configuration file and watcher (since log4j's won't shutdown), etc. Of course, every Tomcat logger created within my web app up until this point is now using log4j from my web app (!) and using the basic log4j.properties [if present] from my web app -- for loggers that apply to all web apps! How is one supposed to work this? I am currently using a static LoggerRepository reference within my web app so that a log4j loaded higher in the classloader tree won't cause LoggerRepository sharing. I was using a JNDI-based LoggerRepositorySelector as per log4j author recommendations, but this goes a step further than above -- it puts all the Tomcat loggers that are errantly using my log4j into my LoggerRepository -- which would be fine if these loggers were not shared with other web apps. What's the solution here? Do I have to put log4j into Tomcat's lib directories to force it to use its own centralized log4j? Is that the best solution? -- Jess Holle - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Context sharing between 2 web apps
Hi, I am using Tomcat 5.5.7. In a regular servlet, I am trying to do something like this: doGet(.) { ServletContext app2 = getServletContext().getContext(/anotherApp); variable app2 is null after this statement. I think, context sharing is turned off in Tomcat, but I am not sure how to turn it back on. I haven't touched server.xml except to switch to port 80. Could some help me out here? How do I enable this behavior? Thanks, NG - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Context sharing between 2 web apps
take a look at the crossContext attribute in your Context element in the server configuration xml file. set it to true -Original Message- From: N G [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 16, 2005 5:10 PM To: tomcat-user@jakarta.apache.org Subject: Context sharing between 2 web apps Hi, I am using Tomcat 5.5.7. In a regular servlet, I am trying to do something like this: doGet(.) { ServletContext app2 = getServletContext().getContext(/anotherApp); variable app2 is null after this statement. I think, context sharing is turned off in Tomcat, but I am not sure how to turn it back on. I haven't touched server.xml except to switch to port 80. Could some help me out here? How do I enable this behavior? Thanks, NG - 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]
pluggable protocols in web apps
We use pluggable protocols to access resources. These don't seem to work with the class loading scheme Tomcat is using. Having a class no.mycomp.protocols.myprot.Handler I do the following: 1. prepend no.mycomp.protocols| to the system property java.protocol.handler.pkgs 2. create a URL with URL u = new URL(myprot://whatever); I get a MalformedUrlException: unknown protocol myprot When I debug the code I see that the call Class.forName() in URL.getURLStreamHandler() fails (The one in the try block). After that the System class loader cannot load my protocol handler either. Is ther a way to get this working. perferably without moving archives to Tomcat's common\ or Java's endorsed path? Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: pluggable protocols in web apps
No useful info at the moment but this looks a lot like bug 10982 (http://issues.apache.org/bugzilla/show_bug.cgi?id=10982) that I am just starting to look at. Keep an eye on this bug report. If I make any progress I will update it. Mark Martin Goldhahn wrote: We use pluggable protocols to access resources. These don't seem to work with the class loading scheme Tomcat is using. Having a class no.mycomp.protocols.myprot.Handler I do the following: 1. prepend no.mycomp.protocols| to the system property java.protocol.handler.pkgs 2. create a URL with URL u = new URL(myprot://whatever); I get a MalformedUrlException: unknown protocol myprot When I debug the code I see that the call Class.forName() in URL.getURLStreamHandler() fails (The one in the try block). After that the System class loader cannot load my protocol handler either. Is ther a way to get this working. perferably without moving archives to Tomcat's common\ or Java's endorsed path? Martin - 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]
5.0.28 errors on startup of web apps
Hello, I'm using Tomcat 5.0.28, Java 1.4.2_02 and Red Hat linux 9. I was able to start Tomcat ok but when deployed a web application and added the following to the conf/server.xml Connector className=org.globus.tomcat.coyote.net.HTTPSConnector port=8443 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false disableUploadTimeout=true acceptCount=100 debug=0 scheme=https/ and Valve className=org.globus.tomcat.coyote.valves.HTTPSValve/ I started to get ClassNotFoundException about classes in the catalina.jar. So I modified the CLASSPATH in the bin/catalina.sh file as follows: CLASSPATH=$CLASSPATH:$CATALINA_HOME/bin/bootstrap.jar:$CATALINA_HOME/bin/commons-logging-api.jar:$CATALINA_HOME/common/lib/commons-digester.jar:$CATALINA_HOME/common/lib/commons-collections-3.0.jar:$CATALINA_HOME/common/lib/naming-common.jar:$CATALINA_HOME/common/lib/commons-beanutils.jar:$CATALINA_HOME/common/lib/commons-modeler.jar:$CATALINA_HOME/common/lib/servlet.jar:$CATALINA_HOME/common/lib/cog-jglobus.jar:$CATALINA_HOME/common/lib/naming-resources.jar:$CATALINA_HOME/common/lib/puretls.jar:$CATALINA_HOME/common/lib/cryptix32.jar:$CATALINA_HOME/common/lib/cryptix-asn1.jar:$CATALINA_HOME/server/lib/catalina.jar:$CATALINA_HOME/server/lib/tomcat-util.jar:$CATALINA_HOME/server/lib/tomcat-coyote.jar:$CATALINA_HOME/server/lib/cog-tomcat.jar:$CATALINA_HOME/server/lib/tomcat-http11.jar:$CATALINA_HOME/server/lib/tomcat-jk2.jar I then started to get the following error: [main] ERROR digester.Digester - End event threw exception java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:252) .. ... [main] ERROR startup.HostConfig - Error deploying configuration descriptor admin.xml java.io.IOException: java.lang.NullPointerException at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:494) at org.apache.catalina.core.StandardHost.install(StandardHost.java:863) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:483) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427) I have seen similar error message on the web regarding deploying web applications but I cant find a concrete answer on its cause. I get the error message for every web application deployed. Any ideas greatly apprecipated. Many thanks, Julie. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: 5.0.28 errors on startup of web apps
Hi, Before I even start dissecting this, where did you get the documentation that led you down this path? I don't see any mention of HTTPSValve on the Tomcat (or FWIW, the entire apache.org) site. A general Google search shows only one place with this mention: the Globus site. I see that you're using their connector, so I assume they must be supplying the valve as well. If that's the case, why are you asking here and not bugging them instead? ;) I started to get ClassNotFoundException about classes in the catalina.jar. So I modified the CLASSPATH in the bin/catalina.sh file as follows: That CLASSPATH is not very relevant. Please consult the Tomcat Classloader How-To document (http://jakarta.apache.org/tomcat/tomcat-5.0-doc/class-loader-howto.html ) to see what classloading repositories are applicable to you. You would probably need to place the Globus jars in common/lib, and NOT modify the bootstrap classpath. [main] ERROR startup.HostConfig - Error deploying configuration descriptor admin.xml java.io.IOException: java.lang.NullPointerException Did you modify admin.xml or the server/webapps/admin directory? Any ideas greatly apprecipated. Go yell at someone at Globus, it's their fault. Yoav Shapira http://www.yoavshapira.com 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]
Re: 5.0.28 errors on startup of web apps
On Thursday 09 December 2004 17:38, Shapira, Yoav wrote: Hi, Before I even start dissecting this, where did you get the documentation that led you down this path? I don't see any mention of HTTPSValve on the Tomcat (or FWIW, the entire apache.org) site. A general Google search shows only one place with this mention: the Globus site. I see that you're using their connector, so I assume they must be supplying the valve as well. If that's the case, why are you asking here and not bugging them instead? ;) That is all correct and I am bugging them also - I saw a common problem on different web apps on various mailing lists and was wondering was there s'thing specific to Tomcat which I was not configuring properly. I started to get ClassNotFoundException about classes in the catalina.jar. So I modified the CLASSPATH in the bin/catalina.sh file as follows: That CLASSPATH is not very relevant. Please consult the Tomcat Classloader How-To document (http://jakarta.apache.org/tomcat/tomcat-5.0-doc/class-loader-howto.html ) to see what classloading repositories are applicable to you. You would probably need to place the Globus jars in common/lib, and NOT modify the bootstrap classpath. [main] ERROR startup.HostConfig - Error deploying configuration descriptor admin.xml java.io.IOException: java.lang.NullPointerException Did you modify admin.xml or the server/webapps/admin directory? No I didnt make any modifications to the installed Tomcat. Any ideas greatly apprecipated. Go yell at someone at Globus, it's their fault. Yoav Shapira http://www.yoavshapira.com 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]
RE: deploying and undeploying web apps at run time (Tomcat 4.1 version)
It can be done. All of the manager commands seem to work well, except for remove in my case, which doesn't remove the deployed directroy because Tomcat maintains a reference to struts.jar in in my deployed image. I wrote an uninstall and had to manually stop Tomcat and remove the deployed directory. If, like me, you've already qualified your app on Tomcat 4.1 (4.1.29, in my case) you want to check out the docs for running the manager in the 4.1.29 version: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/manager-howto.html I wrote my own java client that runs the Tomcat manager application in my installer. It was pretty easy. David Harvey, eXegesys, Inc. www.exegesys.com -Original Message- From: news [mailto:[EMAIL PROTECTED] Behalf Of SMaric Sent: Monday, February 16, 2004 3:52 PM To: [EMAIL PROTECTED] Subject: Re: deploying and undeploying web apps at run time Pretty sure it can be done I remember reading up on this in relation to ANT I think there is some integration with ANT examples in the Tomcat documentation - try http://jakarta.apache.org/tomcat/tomcat-5.0-doc/deployer-howto.html And http://jakarta.apache.org/tomcat/tomcat-5.0-doc/manager-howto.html#Executing%20Manager%20Commands%20With%20Ant Hope this helps Abhijat Thakur [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] hi, I want to deploy and undeploy web applications at run time. Aim is that once the tomcat is up we should be able to deploy and undeploy web apps programatically. Is there a way this can be achieved or if i can look up some docs/respurce somewhere. thanks abhijat - 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]
deploying and undeploying web apps at run time
hi, I want to deploy and undeploy web applications at run time. Aim is that once the tomcat is up we should be able to deploy and undeploy web apps programatically. Is there a way this can be achieved or if i can look up some docs/respurce somewhere. thanks abhijat - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: deploying and undeploying web apps at run time
Pretty sure it can be done I remember reading up on this in relation to ANT I think there is some integration with ANT examples in the Tomcat documentation - try http://jakarta.apache.org/tomcat/tomcat-5.0-doc/deployer-howto.html And http://jakarta.apache.org/tomcat/tomcat-5.0-doc/manager-howto.html#Executing%20Manager%20Commands%20With%20Ant Hope this helps Abhijat Thakur [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] hi, I want to deploy and undeploy web applications at run time. Aim is that once the tomcat is up we should be able to deploy and undeploy web apps programatically. Is there a way this can be achieved or if i can look up some docs/respurce somewhere. thanks abhijat - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Dual Web Apps (IIS), Dual Tomcat instances, How-to?
Hi, Tomcat: 4.1 IIS: 5.0 OS: Windows2000 I currently have a web app. configured in IIS to talk to a Tomcat instance, fine, no problem. But, now, I want to setup a development web app (instance) and a separate QA/Testing web app (instance). The ISAPI_Redirector2.dll has registry settings. In the registry, one of the entries needs to point to the location of the installed Tomcat. So, when I configure IIS with two different web apps, I would need two different installed Tomcat instances, correct? When I installed a new Tomcat (using the .exe), it configured the services to the same name as my original Tomcat instance. So, in the services window, I had a Tomcat 4.1 service. Now, I still have that same service, but it's still pointing to my original Tomcat instance. I was expecting a 2nd service for my 2nd Tomcat instance. Are there instructions for manually installing a specific service? SORRY, more than one question here: Also, when I manually started my 2nd Tomcat instance (while my 1st instance was running), I got a JVM Bind to port message. It said that port 8009 was already in use. I changed all port numbers in the server.xml (I just added one to each number). Those new ports are open on the box. Any ideas? Thanks, Kevin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How can I configure multiple tomcat instances in workers2.properties file (separate web apps)
Hi all, I need to configure multiple tomcat instances in workers2.properties file running completely separate web apps. No matter what I do it doesn't work. Can I even do this? I specify multiple channel sockets but all requests go to the first one only. I appreciate the response. Here is my simple workers2.properties file (APP_SERVER_IP is an entry in /etc/hosts file). # In production uncomment it out [logger.apache2] level=DEBUG [shm] file=${serverRoot}/logs/shm.file size=1048576 ### # # jk status # ### [status:status] info=Status group, displays runtime information [uri:/jkstatus/*] group=status:status ### # # Setup volts # ### [channel.socket:APP_SERVER_IP:8109] [channel.socket:APP_SERVER_IP:8009] _ This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system.
How can I configure multiple tomcat instances in workers2.properties file (separate web apps) (to developers of mod_jk2: please respond)
Hi all, It seems like mod_jk2 is a buggy connector. There is no way to set up more than one instance of tomcat. It can connect on any port other than 8009 but it is a first-come first-served basis (whichever port comes first). I need a response from mod_jk2 developers themselves. Should I go back to mod_jk or there is a way of doing this simple thing??? Thanks, Misak _ This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How can I configure multiple tomcat instances in workers2.properties file (separate web apps) (to developers of mod_jk2: please respond)
Boulatian, Misak wrote: Hi all, It seems like mod_jk2 is a buggy connector. There is no way to set up more than one instance of tomcat. It can connect on any port other than 8009 but it is a first-come first-served basis (whichever port comes first). I need a response from mod_jk2 developers themselves. Should I go back to mod_jk or there is a way of doing this simple thing??? take it easy man :) small question : what about using different virtual hosts in your apache config, then from these contexts , using different config files for mod_jk which will be very simple (you have already validated one of your tomcat instances) my 2 cents Jerome - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How can I configure multiple tomcat instances in workers2.properties file (separate web apps) (to developers of mod_jk2: please respond)
take it easy man :) small question : what about using different virtual hosts in your apache config, then from these contexts , using different config files for mod_jk which will be very simple (you have already validated one of your tomcat instances) my 2 cents Jerome Hi Jerome, Thanks for trying to help me. I have been working on this for several days and I was too upset. Can you please tell me how can I specify different workers2.properties file for each instance since workers2.properties file must be in apache/conf? In the site http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/ there is nothing about this. Thanks, Misak _ This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Multiple Web Apps... Am I missing anything?
Howdy, You need separate shutdown ports if you want to be able to shutdown/restart individual instances. Yoav Shapira Millennium ChemInformatics -Original Message- From: Eriksen, Kjell [mailto:[EMAIL PROTECTED] Sent: Monday, September 22, 2003 8:07 PM To: '[EMAIL PROTECTED]' Subject: Multiple Web Apps... Am I missing anything? We are testing out Tomcat to host multiple app instances - any feedback would be greatly appreciated. To install multiple web apps on W2K - each with its own service/instance: 1) Copy/rename server.xml (webapp1.xml) a. config non-SSL Coyote HTTP/1.1 Connector on open port, say 8081 i. not really necessary since we external web server - but good for troubleshooting b. config a Coyote/JK2 AJP 1.3 Connector on open port , say 8581 c. Add our context i. changing DocBase (c:\app1) + Path (/app1) 2) Config worker.properties a. add a worker to the list (myapp1) b. copy/modify the worker definition (worker + port) i. worker.MYAPP1.port=8581 ii. worker.MYAPP1.host=localhost iii. worker.MYAPP1.type=ajp13 3) Config uriworkermap.properties a. add mappings to point to the appropriate worker i. /app1/*.jsp=MYAPP 4) Use Jakarta ISAPI in IIS - redirects jsp's to tomcat 5) Create Virtual Directory in IIS for each app instance 6) Use Config utility to create windows services - and point service to appropriate (copy of) server.xml. End result: * Multiple server.xml files (renamed: app1, app2, app3...etc) * Multiple workers in the list * Multiple definitions in the worker.properties file (all type AJP13) * Multiple URI path listings * 1 ISAPI filter * Multiple VD's in IIS * Multiple services - each to its own instance Sites run fine Questions: 1) Is this the best way to config? 2) Is anything missing? Any settings? Timeouts? 3) Does each server.xml file need a unique Server Port? a. Server port=8005 shutdown=SHUTDOWN debug=0 4) Any suggestions to increase performance in such a config? Thank you, Kjell Eriksen -- The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination, distribution, forwarding, or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited without the express permission of the sender. If you received this communication in error, please contact the sender and delete the material from any computer. 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]
Multiple Web Apps... Am I missing anything?
We are testing out Tomcat to host multiple app instances - any feedback would be greatly appreciated. To install multiple web apps on W2K - each with its own service/instance: 1) Copy/rename server.xml (webapp1.xml) a. config non-SSL Coyote HTTP/1.1 Connector on open port, say 8081 i. not really necessary since we external web server - but good for troubleshooting b. config a Coyote/JK2 AJP 1.3 Connector on open port , say 8581 c. Add our context i. changing DocBase (c:\app1) + Path (/app1) 2) Config worker.properties a. add a worker to the list (myapp1) b. copy/modify the worker definition (worker + port) i. worker.MYAPP1.port=8581 ii. worker.MYAPP1.host=localhost iii. worker.MYAPP1.type=ajp13 3) Config uriworkermap.properties a. add mappings to point to the appropriate worker i. /app1/*.jsp=MYAPP 4) Use Jakarta ISAPI in IIS - redirects jsp's to tomcat 5) Create Virtual Directory in IIS for each app instance 6) Use Config utility to create windows services - and point service to appropriate (copy of) server.xml. End result: * Multiple server.xml files (renamed: app1, app2, app3...etc) * Multiple workers in the list * Multiple definitions in the worker.properties file (all type AJP13) * Multiple URI path listings * 1 ISAPI filter * Multiple VD's in IIS * Multiple services - each to its own instance Sites run fine Questions: 1) Is this the best way to config? 2) Is anything missing? Any settings? Timeouts? 3) Does each server.xml file need a unique Server Port? a. Server port=8005 shutdown=SHUTDOWN debug=0 4) Any suggestions to increase performance in such a config? Thank you, Kjell Eriksen -- The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination, distribution, forwarding, or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited without the express permission of the sender. If you received this communication in error, please contact the sender and delete the material from any computer.
Multiple Web Apps... Am I missing anything?
*** I apologize for sending the previous in RICH text format *** *** Plain text follows *** We are testing out Tomcat to host multiple app instances - any feedback would be greatly appreciated. To install multiple web apps on W2K - each with its own service/instance: 1) Copy/rename server.xml (webapp1.xml) a. config non-SSL Coyote HTTP/1.1 Connector on open port, say 8081 b. config a Coyote/JK2 AJP 1.3 Connector on open port , say 8581 c. Add our context-changing DocBase (c:\app1) + Path (/app1) 2) Config worker.properties a. add a worker to the list (myapp1) b. copy/modify the worker definition (worker + port) i. worker.MYAPP1.port=8581 ii. worker.MYAPP1.host=localhost iii. worker.MYAPP1.type=ajp13 3) Config uriworkermap.properties a. add mappings to point to the appropriate worker (/app1/*.jsp=MYAPP) 4) Use Jakarta ISAPI in IIS - redirects jsp's to tomcat 5) Create Virtual Directory in IIS for each instance 6) Use Cfg utility to create windows services - point service to appropriate (copy of) server.xml. End result: - Multiple server.xml files (renamed: app1, app2, app3...etc) - Multiple workers in the list - Multiple definitions in the worker.properties file (all type AJP13) - Multiple URI path listings - 1 ISAPI filter - Multiple VD's in IIS - Multiple services - each to its own instance Sites run fine Questions: 1) Is this the best way to config? 2) Is anything missing? Any settings? Timeouts? 3) Does each server.xml file need a unique Server Port? Server port=8005 shutdown=SHUTDOWN debug=0 4) Any suggestions to increase performance in such a config? Thank you, Kjell Eriksen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Sharing of JSP pages across multiple web apps
Why? Thats one to complain to the spec people about. You can use Bill's idea of symlinks. My preference is to use the build process to make copies of the pages from a central repository. Another alternative is to precompile those common jsps and place them into a JAR and alter web.xml with the jsp declarations as appropriate. -Tim Ashutosh Satyam wrote: Is it possible to share JSP page across multiple web-application within tomcat servlet container? Something like the libraries, which we want to share across multiple web application can be placed under the shared directory of tomcat. If it's not possible, why it has been not designed like that? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Sharing of JSP pages across multiple web apps
Is it possible to share JSP page across multiple web-application within tomcat servlet container? Something like the libraries, which we want to share across multiple web application can be placed under the shared directory of tomcat. If it's not possible, why it has been not designed like that? Thanks and Regards, Ashutosh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Sharing of JSP pages across multiple web apps
I think that is what the crossContext attribute of the Context tag is for (in server.xml or a context configuration file). I've never bothered using it so don't just take my word for it. Go ahead and read Tomcat's docs on the subject. Jake At 09:50 AM 9/5/2003 +0530, you wrote: Is it possible to share JSP page across multiple web-application within tomcat servlet container? Something like the libraries, which we want to share across multiple web application can be placed under the shared directory of tomcat. If it's not possible, why it has been not designed like that? Thanks and Regards, Ashutosh - 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: Sharing of JSP pages across multiple web apps
It depends what you want to accomplish basically. Personally, I prefer symlinking the pages (of course, after enabling the symlink option :). This results in seperate class files for each context that uses the page, but is easy to maintain. Alternatively, you can pre-compile the JSP to $CATALINA_HOME/shared/classes, and adjust your servlet-mappings accordingly. Ashutosh Satyam [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Is it possible to share JSP page across multiple web-application within tomcat servlet container? Something like the libraries, which we want to share across multiple web application can be placed under the shared directory of tomcat. If it's not possible, why it has been not designed like that? Thanks and Regards, Ashutosh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Re[2]: [Q] Is it safe to create threads in Tomcat web-apps?
Howdy, Don't use commons-pool for a thread pool. Use Doug Lea's concurrency library instead. I should add this do the commons-pool javadoc somewhere. Commons-pool is excellent for all types of pooling, but not threads, as the concurrency issues are difficult at best to overcome. Yoav Shapira Millennium ChemInformatics -Original Message- From: Anton Tagunov [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 30, 2003 1:37 AM To: Tomcat Users List Subject: Re[2]: [Q] Is it safe to create threads in Tomcat web-apps? Hello Srevilak! sgn However, if the three steps are IO-bound, using multiple threads to sgn run them concurrently can lead to a big improvement. One might also consider using some kind of thread pooler in this setting. Perhaps one could be crafted on top of jakarta-commons-pool -Anton - 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]
Re: [Q] Is it safe to create threads in Tomcat web-apps?
jcrontab works ok, it is modeled after the unix crontab entries. Best bet is to try it and see if it meets ones needs :) Anton Tagunov wrote: So, what John is speaking about - spending less effort on thread coding and using an existing solution (native Unix crontab) may also be pushing you to using it Java analog - jcrontab. That being said I have not even read a page on the jcrontab site, so I do not know if it's workable or buggy. -Anton - 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[2]: [Q] Is it safe to create threads in Tomcat web-apps?
Hello Riaan! RO (I have no idea what cron +wegt is???) As John has explained JT cron = scheduler Unix world I would add to this :-) And on the files (or directories involved is named crontab, see bellow) JT wget = command line HTTP/HTTPS client both Unix and Windows I just wanted to say that Kwok Peng Tuck [EMAIL PROTECTED] has mentioned http://jcrontab.sourceforge.net As the name of the project suggests it is an effort to provide cron (aka crontab) functionality in Java. So, what John is speaking about - spending less effort on thread coding and using an existing solution (native Unix crontab) may also be pushing you to using it Java analog - jcrontab. That being said I have not even read a page on the jcrontab site, so I do not know if it's workable or buggy. -Anton - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re[2]: [Q] Is it safe to create threads in Tomcat web-apps?
Hello Srevilak! sgn However, if the three steps are IO-bound, using multiple threads to sgn run them concurrently can lead to a big improvement. One might also consider using some kind of thread pooler in this setting. Perhaps one could be crafted on top of jakarta-commons-pool -Anton - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Q] Is it safe to create threads in Tomcat web-apps?
I've mainly worked in BEA WebLogic before and from colleagues and other sources I have heard it is not recommended (and sometimes not allowed, some even said) to create threads in your application. Indeed, when the application went live in a multi-server clustered environment, we got very inconsistent results because of the threads, so we had to remove them. Question is, how safe is it to create threads in a Tomcat web-app? I would assume worker threads are ok, i.e. threads you create to do a specific task and then it terminates. When you are guaranteed the thread will terminate either because of an error or because the assigned task has been completed. But what about monitor threads, i.e. threads that does a Thread.sleep(x) for an hour, check some condition and goes back to sleep... some mechanism you implement to e.g. do a task on a hourly/daily/weekly base. You'd create the thread (and keep a handle to it) in either an InitServlet.init() and then Thread.interrupt() in the InitServlet.destroy(), or you can do it in an ApplicationListener (something like that) class which I think you can define in the web.xml. How else can you implement that (monitoring) in Tomcat? __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Q] Is it safe to create threads in Tomcat web-apps?
You can create threads all day in tomcat, but here are the importnatn things to consider: - WHY! Are threads really the correct solution? - If you create threads - what are their scope? Daemon, non-daemon? - If you create non-daemon threads - be prepared for the consequences such as the JVM not going away on tomcat shutdown unless you have taken the needed precautions. - If you create dameon only threads, be prepared for when tomcat shuts down and your daemon still has work to do because the JVM could exit before your thread is ready to complete its unit of work - WHY! Are threads really the correct solution? - And last but not least: WHY! Are threads really the correct solution? -Tim Riaan Oberholzer wrote: I've mainly worked in BEA WebLogic before and from colleagues and other sources I have heard it is not recommended (and sometimes not allowed, some even said) to create threads in your application. Indeed, when the application went live in a multi-server clustered environment, we got very inconsistent results because of the threads, so we had to remove them. Question is, how safe is it to create threads in a Tomcat web-app? I would assume worker threads are ok, i.e. threads you create to do a specific task and then it terminates. When you are guaranteed the thread will terminate either because of an error or because the assigned task has been completed. But what about monitor threads, i.e. threads that does a Thread.sleep(x) for an hour, check some condition and goes back to sleep... some mechanism you implement to e.g. do a task on a hourly/daily/weekly base. You'd create the thread (and keep a handle to it) in either an InitServlet.init() and then Thread.interrupt() in the InitServlet.destroy(), or you can do it in an ApplicationListener (something like that) class which I think you can define in the web.xml. How else can you implement that (monitoring) in Tomcat? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Q] Is it safe to create threads in Tomcat web-apps?
Well, that was part of my question if I cannot/don't implement daemon threads to do e.g. automatic daily tasks, what else? E.g, at the end of the day send an e-mail to a (real life) manager with a summary of the day's transactions something like that. Does Tomcat provide some sort of ActionEvent which you can configure to be fired every x milliseconds? --- Tim Funk [EMAIL PROTECTED] wrote: You can create threads all day in tomcat, but here are the importnatn things to consider: - WHY! Are threads really the correct solution? - If you create threads - what are their scope? Daemon, non-daemon? - If you create non-daemon threads - be prepared for the consequences such as the JVM not going away on tomcat shutdown unless you have taken the needed precautions. - If you create dameon only threads, be prepared for when tomcat shuts down and your daemon still has work to do because the JVM could exit before your thread is ready to complete its unit of work - WHY! Are threads really the correct solution? - And last but not least: WHY! Are threads really the correct solution? -Tim Riaan Oberholzer wrote: I've mainly worked in BEA WebLogic before and from colleagues and other sources I have heard it is not recommended (and sometimes not allowed, some even said) to create threads in your application. Indeed, when the application went live in a multi-server clustered environment, we got very inconsistent results because of the threads, so we had to remove them. Question is, how safe is it to create threads in a Tomcat web-app? I would assume worker threads are ok, i.e. threads you create to do a specific task and then it terminates. When you are guaranteed the thread will terminate either because of an error or because the assigned task has been completed. But what about monitor threads, i.e. threads that does a Thread.sleep(x) for an hour, check some condition and goes back to sleep... some mechanism you implement to e.g. do a task on a hourly/daily/weekly base. You'd create the thread (and keep a handle to it) in either an InitServlet.init() and then Thread.interrupt() in the InitServlet.destroy(), or you can do it in an ApplicationListener (something like that) class which I think you can define in the web.xml. How else can you implement that (monitoring) in Tomcat? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Q] Is it safe to create threads in Tomcat web-apps?
Hello Riaan, you might want to check out jcrontab. http://jcrontab.sourceforge.net Riaan Oberholzer wrote: Well, that was part of my question if I cannot/don't implement daemon threads to do e.g. automatic daily tasks, what else? E.g, at the end of the day send an e-mail to a (real life) manager with a summary of the day's transactions something like that. Does Tomcat provide some sort of ActionEvent which you can configure to be fired every x milliseconds? --- Tim Funk [EMAIL PROTECTED] wrote: You can create threads all day in tomcat, but here are the importnatn things to consider: - WHY! Are threads really the correct solution? - If you create threads - what are their scope? Daemon, non-daemon? - If you create non-daemon threads - be prepared for the consequences such as the JVM not going away on tomcat shutdown unless you have taken the needed precautions. - If you create dameon only threads, be prepared for when tomcat shuts down and your daemon still has work to do because the JVM could exit before your thread is ready to complete its unit of work - WHY! Are threads really the correct solution? - And last but not least: WHY! Are threads really the correct solution? -Tim Riaan Oberholzer wrote: I've mainly worked in BEA WebLogic before and from colleagues and other sources I have heard it is not recommended (and sometimes not allowed, some even said) to create threads in your application. Indeed, when the application went live in a multi-server clustered environment, we got very inconsistent results because of the threads, so we had to remove them. Question is, how safe is it to create threads in a Tomcat web-app? I would assume worker threads are ok, i.e. threads you create to do a specific task and then it terminates. When you are guaranteed the thread will terminate either because of an error or because the assigned task has been completed. But what about monitor threads, i.e. threads that does a Thread.sleep(x) for an hour, check some condition and goes back to sleep... some mechanism you implement to e.g. do a task on a hourly/daily/weekly base. You'd create the thread (and keep a handle to it) in either an InitServlet.init() and then Thread.interrupt() in the InitServlet.destroy(), or you can do it in an ApplicationListener (something like that) class which I think you can define in the web.xml. How else can you implement that (monitoring) in Tomcat? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - 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: [Q] Is it safe to create threads in Tomcat web-apps? (JCrontab)
This looks promising, but what do they do differently than just starting a deamon thread and doing some background work? Why bother with this if you can start your own custom thread, or do they do something else? --- Kwok Peng Tuck [EMAIL PROTECTED] wrote: Hello Riaan, you might want to check out jcrontab. http://jcrontab.sourceforge.net Riaan Oberholzer wrote: Well, that was part of my question if I cannot/don't implement daemon threads to do e.g. automatic daily tasks, what else? E.g, at the end of the day send an e-mail to a (real life) manager with a summary of the day's transactions something like that. Does Tomcat provide some sort of ActionEvent which you can configure to be fired every x milliseconds? --- Tim Funk [EMAIL PROTECTED] wrote: You can create threads all day in tomcat, but here are the importnatn things to consider: - WHY! Are threads really the correct solution? - If you create threads - what are their scope? Daemon, non-daemon? - If you create non-daemon threads - be prepared for the consequences such as the JVM not going away on tomcat shutdown unless you have taken the needed precautions. - If you create dameon only threads, be prepared for when tomcat shuts down and your daemon still has work to do because the JVM could exit before your thread is ready to complete its unit of work - WHY! Are threads really the correct solution? - And last but not least: WHY! Are threads really the correct solution? -Tim Riaan Oberholzer wrote: I've mainly worked in BEA WebLogic before and from colleagues and other sources I have heard it is not recommended (and sometimes not allowed, some even said) to create threads in your application. Indeed, when the application went live in a multi-server clustered environment, we got very inconsistent results because of the threads, so we had to remove them. Question is, how safe is it to create threads in a Tomcat web-app? I would assume worker threads are ok, i.e. threads you create to do a specific task and then it terminates. When you are guaranteed the thread will terminate either because of an error or because the assigned task has been completed. But what about monitor threads, i.e. threads that does a Thread.sleep(x) for an hour, check some condition and goes back to sleep... some mechanism you implement to e.g. do a task on a hourly/daily/weekly base. You'd create the thread (and keep a handle to it) in either an InitServlet.init() and then Thread.interrupt() in the InitServlet.destroy(), or you can do it in an ApplicationListener (something like that) class which I think you can define in the web.xml. How else can you implement that (monitoring) in Tomcat? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - 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] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Q] Is it safe to create threads in Tomcat web-apps?
Tomcat doesn't provide this but other simple solutions exist such as exposing a URL and using cron + wget. (Some may also say kludge too) As for aggregating statistics - I would recommend using a log file to record the essential measurements then running your stats program on the logs. This way - tomcat can crash (or other strange occurences may occur) and you lose no data. If the data is already logged, then the first solution (cron + wget) will work well too. -Tim Riaan Oberholzer wrote: Well, that was part of my question if I cannot/don't implement daemon threads to do e.g. automatic daily tasks, what else? E.g, at the end of the day send an e-mail to a (real life) manager with a summary of the day's transactions something like that. Does Tomcat provide some sort of ActionEvent which you can configure to be fired every x milliseconds? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Q] Is it safe to create threads in Tomcat web-apps?
... nice suggestion, but I am delivering an application as a .war file to a 3rd party and they just want the .war (+ context.xml) with everything in it hence, no other applications checking the logs or database. All functionality must come from the .war running in Tomcat. It is very important: all functionality must be encapsulated in the .war file. (I have no idea what cron +wegt is???) I guess a daemon thread will be my choice solution for now... what the thread does, is check a database daily for a certain false condition and send an e-mail to all users in question warning them about the current status. E.g. if you have to submit your timesheet by Friday 17:00, then you'll get a warning on Friday at 12:00 if it is not done yet something like that. --- Tim Funk [EMAIL PROTECTED] wrote: Tomcat doesn't provide this but other simple solutions exist such as exposing a URL and using cron + wget. (Some may also say kludge too) As for aggregating statistics - I would recommend using a log file to record the essential measurements then running your stats program on the logs. This way - tomcat can crash (or other strange occurences may occur) and you lose no data. If the data is already logged, then the first solution (cron + wget) will work well too. -Tim Riaan Oberholzer wrote: Well, that was part of my question if I cannot/don't implement daemon threads to do e.g. automatic daily tasks, what else? E.g, at the end of the day send an e-mail to a (real life) manager with a summary of the day's transactions something like that. Does Tomcat provide some sort of ActionEvent which you can configure to be fired every x milliseconds? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Q] Is it safe to create threads in Tomcat web-apps?
cron = scheduler wget = command line HTTP/HTTPS client The requirement for delivering everything in a WAR file is all nice and dandy, but if you think about it, the requirement automatically breaks the other requirement: scheduling. If you cannot have a log file, and you cannot access a database, how will you ever be able to determine elapsed time, which is the primary requirement for a scheduler? How can you determine status like when was the last time it was run, etc? How can you reset your clock if the app is shutdown? How do you know the app has been shutdown due to an external event? John Riaan Oberholzer wrote: ... nice suggestion, but I am delivering an application as a .war file to a 3rd party and they just want the .war (+ context.xml) with everything in it hence, no other applications checking the logs or database. All functionality must come from the .war running in Tomcat. It is very important: all functionality must be encapsulated in the .war file. (I have no idea what cron +wegt is???) I guess a daemon thread will be my choice solution for now... what the thread does, is check a database daily for a certain false condition and send an e-mail to all users in question warning them about the current status. E.g. if you have to submit your timesheet by Friday 17:00, then you'll get a warning on Friday at 12:00 if it is not done yet something like that. --- Tim Funk [EMAIL PROTECTED] wrote: Tomcat doesn't provide this but other simple solutions exist such as exposing a URL and using cron + wget. (Some may also say kludge too) As for aggregating statistics - I would recommend using a log file to record the essential measurements then running your stats program on the logs. This way - tomcat can crash (or other strange occurences may occur) and you lose no data. If the data is already logged, then the first solution (cron + wget) will work well too. -Tim Riaan Oberholzer wrote: Well, that was part of my question if I cannot/don't implement daemon threads to do e.g. automatic daily tasks, what else? E.g, at the end of the day send an e-mail to a (real life) manager with a summary of the day's transactions something like that. Does Tomcat provide some sort of ActionEvent which you can configure to be fired every x milliseconds? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - 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: [Q] Is it safe to create threads in Tomcat web-apps?
Perhaps I should give a better explanation of how the application works: I deliver a .war file. I do have access to an underlying database. The scheduled tasks perform more on a is time reached than has time elapsed principle... eg, it triggers when is it past midnight? instead of has 24 hours elapsed?. I cannot see why creating a daemon thread cannot cater for this. You just start the thread in the init method of the InitServlet (or any servlet you create with start-when-app-starts). What am I missing here? Why can't I use this method? If Tomcat crashes and the app gets restarted, my thread will be restarted as well, so no problem there. The thread should also only be running while the web-app is (LONG story why that is so, so I won't give details... in short, if the web-app is down, it is seen as critical and all else must be halted). --- John Turner [EMAIL PROTECTED] wrote: cron = scheduler wget = command line HTTP/HTTPS client The requirement for delivering everything in a WAR file is all nice and dandy, but if you think about it, the requirement automatically breaks the other requirement: scheduling. If you cannot have a log file, and you cannot access a database, how will you ever be able to determine elapsed time, which is the primary requirement for a scheduler? How can you determine status like when was the last time it was run, etc? How can you reset your clock if the app is shutdown? How do you know the app has been shutdown due to an external event? John Riaan Oberholzer wrote: ... nice suggestion, but I am delivering an application as a .war file to a 3rd party and they just want the .war (+ context.xml) with everything in it hence, no other applications checking the logs or database. All functionality must come from the .war running in Tomcat. It is very important: all functionality must be encapsulated in the .war file. (I have no idea what cron +wegt is???) I guess a daemon thread will be my choice solution for now... what the thread does, is check a database daily for a certain false condition and send an e-mail to all users in question warning them about the current status. E.g. if you have to submit your timesheet by Friday 17:00, then you'll get a warning on Friday at 12:00 if it is not done yet something like that. --- Tim Funk [EMAIL PROTECTED] wrote: Tomcat doesn't provide this but other simple solutions exist such as exposing a URL and using cron + wget. (Some may also say kludge too) As for aggregating statistics - I would recommend using a log file to record the essential measurements then running your stats program on the logs. This way - tomcat can crash (or other strange occurences may occur) and you lose no data. If the data is already logged, then the first solution (cron + wget) will work well too. -Tim Riaan Oberholzer wrote: Well, that was part of my question if I cannot/don't implement daemon threads to do e.g. automatic daily tasks, what else? E.g, at the end of the day send an e-mail to a (real life) manager with a summary of the day's transactions something like that. Does Tomcat provide some sort of ActionEvent which you can configure to be fired every x milliseconds? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - 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] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Q] Is it safe to create threads in Tomcat web-apps?
Nobody, from what I can tell, is saying can't. You did ask, though. If you're willing to be diligent about coding your threads, go for it. I think the point of previous posts was that in many cases, there is no need for such a thing as your asking. There are always exceptions to the rule, though. For example: the question is it past midnight would never be asked if you were to use the operating system, since with something like cron (built in scheduler), the operating already knows if its past midnight. Thus, the question becomes not a question but a command: its past midnight, go find all of the people who have a status of X and remind them to change their status to Y. The effort, then, is spent on the business logic, not on trying to figure out if its time to spend time on the business logic. The alternative is to spend resources constantly wondering if a specific time is reached. For one or two events, no problem. Start getting busy, start having 10 or 20 events, and it becomes a problem, not just from a resource standpoint, but from an administration and synchronization standpoint. John Riaan Oberholzer wrote: Perhaps I should give a better explanation of how the application works: I deliver a .war file. I do have access to an underlying database. The scheduled tasks perform more on a is time reached than has time elapsed principle... eg, it triggers when is it past midnight? instead of has 24 hours elapsed?. I cannot see why creating a daemon thread cannot cater for this. You just start the thread in the init method of the InitServlet (or any servlet you create with start-when-app-starts). What am I missing here? Why can't I use this method? If Tomcat crashes and the app gets restarted, my thread will be restarted as well, so no problem there. The thread should also only be running while the web-app is (LONG story why that is so, so I won't give details... in short, if the web-app is down, it is seen as critical and all else must be halted). --- John Turner [EMAIL PROTECTED] wrote: cron = scheduler wget = command line HTTP/HTTPS client The requirement for delivering everything in a WAR file is all nice and dandy, but if you think about it, the requirement automatically breaks the other requirement: scheduling. If you cannot have a log file, and you cannot access a database, how will you ever be able to determine elapsed time, which is the primary requirement for a scheduler? How can you determine status like when was the last time it was run, etc? How can you reset your clock if the app is shutdown? How do you know the app has been shutdown due to an external event? John Riaan Oberholzer wrote: ... nice suggestion, but I am delivering an application as a .war file to a 3rd party and they just want the .war (+ context.xml) with everything in it hence, no other applications checking the logs or database. All functionality must come from the .war running in Tomcat. It is very important: all functionality must be encapsulated in the .war file. (I have no idea what cron +wegt is???) I guess a daemon thread will be my choice solution for now... what the thread does, is check a database daily for a certain false condition and send an e-mail to all users in question warning them about the current status. E.g. if you have to submit your timesheet by Friday 17:00, then you'll get a warning on Friday at 12:00 if it is not done yet something like that. --- Tim Funk [EMAIL PROTECTED] wrote: Tomcat doesn't provide this but other simple solutions exist such as exposing a URL and using cron + wget. (Some may also say kludge too) As for aggregating statistics - I would recommend using a log file to record the essential measurements then running your stats program on the logs. This way - tomcat can crash (or other strange occurences may occur) and you lose no data. If the data is already logged, then the first solution (cron + wget) will work well too. -Tim Riaan Oberholzer wrote: Well, that was part of my question if I cannot/don't implement daemon threads to do e.g. automatic daily tasks, what else? E.g, at the end of the day send an e-mail to a (real life) manager with a summary of the day's transactions something like that. Does Tomcat provide some sort of ActionEvent which you can configure to be fired every x milliseconds? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For
Re: [Q] Is it safe to create threads in Tomcat web-apps?
You're right, no-one said I can't. :) I was hoping someone who has actually used it could give some feedback about it. The (obvious) reason why the scheduled task also cannot be active if the web-app is not active, is that the scheduled task requires users to use web-app. Eg, Friday at 15:00 you get an e-mail to fill in your time-sheet if it has not been done. If the web-app is not active, then there is no point in sending the mail. If you do, then the sysop is going to get 1000 mails/phone call from users saying I need to fill out my timesheet, but the app is down!. Purely a user requirement. I think you can see the logic behind this. When the web-app comes alive again, the first thing that will be done, is to send the warnings and people can get back to filling out timesheets. It won't be a heavy burderned task... thread.sleep for 1 hour eg and then do one date/time check I think that wouldn't be too heavy on performance. Thanks for the feedback, though. --- John Turner [EMAIL PROTECTED] wrote: Nobody, from what I can tell, is saying can't. You did ask, though. If you're willing to be diligent about coding your threads, go for it. I think the point of previous posts was that in many cases, there is no need for such a thing as your asking. There are always exceptions to the rule, though. For example: the question is it past midnight would never be asked if you were to use the operating system, since with something like cron (built in scheduler), the operating already knows if its past midnight. Thus, the question becomes not a question but a command: its past midnight, go find all of the people who have a status of X and remind them to change their status to Y. The effort, then, is spent on the business logic, not on trying to figure out if its time to spend time on the business logic. The alternative is to spend resources constantly wondering if a specific time is reached. For one or two events, no problem. Start getting busy, start having 10 or 20 events, and it becomes a problem, not just from a resource standpoint, but from an administration and synchronization standpoint. John Riaan Oberholzer wrote: Perhaps I should give a better explanation of how the application works: I deliver a .war file. I do have access to an underlying database. The scheduled tasks perform more on a is time reached than has time elapsed principle... eg, it triggers when is it past midnight? instead of has 24 hours elapsed?. I cannot see why creating a daemon thread cannot cater for this. You just start the thread in the init method of the InitServlet (or any servlet you create with start-when-app-starts). What am I missing here? Why can't I use this method? If Tomcat crashes and the app gets restarted, my thread will be restarted as well, so no problem there. The thread should also only be running while the web-app is (LONG story why that is so, so I won't give details... in short, if the web-app is down, it is seen as critical and all else must be halted). --- John Turner [EMAIL PROTECTED] wrote: cron = scheduler wget = command line HTTP/HTTPS client The requirement for delivering everything in a WAR file is all nice and dandy, but if you think about it, the requirement automatically breaks the other requirement: scheduling. If you cannot have a log file, and you cannot access a database, how will you ever be able to determine elapsed time, which is the primary requirement for a scheduler? How can you determine status like when was the last time it was run, etc? How can you reset your clock if the app is shutdown? How do you know the app has been shutdown due to an external event? John Riaan Oberholzer wrote: ... nice suggestion, but I am delivering an application as a .war file to a 3rd party and they just want the .war (+ context.xml) with everything in it hence, no other applications checking the logs or database. All functionality must come from the .war running in Tomcat. It is very important: all functionality must be encapsulated in the .war file. (I have no idea what cron +wegt is???) I guess a daemon thread will be my choice solution for now... what the thread does, is check a database daily for a certain false condition and send an e-mail to all users in question warning them about the current status. E.g. if you have to submit your timesheet by Friday 17:00, then you'll get a warning on Friday at 12:00 if it is not done yet something like that. --- Tim Funk [EMAIL PROTECTED] wrote: Tomcat doesn't provide this but other simple solutions exist such as exposing a URL and using cron + wget. (Some may also say kludge too) As for aggregating statistics - I would recommend using a log file to record the essential measurements
RE: [Q] Is it safe to create threads in Tomcat web-apps?
Howdy, I cannot see why creating a daemon thread cannot cater for this. You just start the thread in the init method of the InitServlet (or any servlet you create with start-when-app-starts). I'm actually a fan of the background daemon-thread approach, and think the user-threading limitations in full J2EE containers is unfortunate (although I know where it comes from). Be careful about starting and stopping threads in the init/destroy methods of servlets, however, as the container can create/destroy your servlets (including load-on-startup servlets) almost whenever it wants to. Consider using a context listener instead. 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]
RE: [Q] Is it safe to create threads in Tomcat web-apps?
Yep, thanks... I've heard from other sources as well that the ServletContextListener approach is better. It gives me some comfort knowing other people find the approach safe and without too many pitfalls. :) --- Shapira, Yoav [EMAIL PROTECTED] wrote: Howdy, I cannot see why creating a daemon thread cannot cater for this. You just start the thread in the init method of the InitServlet (or any servlet you create with start-when-app-starts). I'm actually a fan of the background daemon-thread approach, and think the user-threading limitations in full J2EE containers is unfortunate (although I know where it comes from). Be careful about starting and stopping threads in the init/destroy methods of servlets, however, as the container can create/destroy your servlets (including load-on-startup servlets) almost whenever it wants to. Consider using a context listener instead. 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] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Q] Is it safe to create threads in Tomcat web-apps?
From: Tim Funk funkman () joedog ! org Subject: Re: [Q] Is it safe to create threads in Tomcat web-apps? You can create threads all day in tomcat, but here are the importnatn things to consider: - WHY! Are threads really the correct solution? - And last but not least: WHY! Are threads really the correct solution? I'm getting the impression that you think multiple threads are never the right answer. :) That's not necessarily true. Suppose that your response to a request contains three steps which are independant of one another; in order to deliver a faster response time, you'd like to execute them concurrently. If these three steps are CPU-bound, then the amount of benefit really depends on the machine; you need multiple CPUs so that the scheduler can run the different threads on different CPUs. With a single CPU, you're not likely to see much benefit. However, if the three steps are IO-bound, using multiple threads to run them concurrently can lead to a big improvement. Most of the time spent doing IO is spent waiting. (Particularly if the IO is network IO, a sub-request to a remote site, for example). If the idle times occur concurrently instead of serially, you'll certainly do better. -- Steve - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Q] Is it safe to create threads in Tomcat web-apps?
I am in total agreement and I have used user created threads on my site. I view user created threads as a dangerous and usually un-needed thing. Dangerous because of the side effects that aren't accounted for by more junior programmers such as concurrency, shutting down the JVM (or lack of being able to), more threads the system may handle, harder to track from a monitoring point of view the activites occuring in the JVM for trouble shooting. User threads are not always a bad thing. But they can easily be abused because they seem like a cool-fun-novel coding solution. -Tim [EMAIL PROTECTED] wrote: From: Tim Funk funkman () joedog ! org - WHY! Are threads really the correct solution? - And last but not least: WHY! Are threads really the correct solution? I'm getting the impression that you think multiple threads are never the right answer. :) That's not necessarily true. Suppose that your response to a request contains three steps which are independant of one another; in order to deliver a faster response time, you'd like to execute them concurrently. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Q] Is it safe to create threads in Tomcat web-apps?
I hate to speak for someone else, but I believe that Tim may have been referring to the tendency of some people to use threads without understanding their limitations. (I've seen attempts to massively thread CPU-bound applications on single CPU machines.) Threads are not magic that can be spread on a program to make it better. That being said. Tim did not say don't he asked why.grin/ That's much politer than I've normally been to people in a similar circumstance. shrug/ G. Wade [EMAIL PROTECTED] wrote: From: Tim Funk funkman () joedog ! org Subject: Re: [Q] Is it safe to create threads in Tomcat web-apps? You can create threads all day in tomcat, but here are the importnatn things to consider: - WHY! Are threads really the correct solution? - And last but not least: WHY! Are threads really the correct solution? I'm getting the impression that you think multiple threads are never the right answer. :) That's not necessarily true. Suppose that your response to a request contains three steps which are independant of one another; in order to deliver a faster response time, you'd like to execute them concurrently. If these three steps are CPU-bound, then the amount of benefit really depends on the machine; you need multiple CPUs so that the scheduler can run the different threads on different CPUs. With a single CPU, you're not likely to see much benefit. However, if the three steps are IO-bound, using multiple threads to run them concurrently can lead to a big improvement. Most of the time spent doing IO is spent waiting. (Particularly if the IO is network IO, a sub-request to a remote site, for example). If the idle times occur concurrently instead of serially, you'll certainly do better. -- Steve - 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: cookie based session sharing among web apps
No - it breaks the servlet spec. Sessions are scoped to their own webapp. -Tim Harris Cotton wrote: I am keen on having two web applications be able to share sessions. Currently, tomcat creates and maintains a session for each web application for a client. Moving the session id to the url is an option, but one I hope to avoid because of the refactoring it would generate in my applications jsps. In essence, I want tomcat to use / as the url path in the JSESSIONID cookie, and use this session id in all web applications the tomcat server hosts. Can this be accomplished solely with configuration? Thank You - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: cookie based session sharing among web apps
Not as far as I can tell from digging through the session manager code. It looks like each context has their own session manager which stores a list of active sessions in a hashmap. I think you are going to have to get rather creative with this one. I.E. create a patch that allows all tomcat contexts to share the same cookie. --Angus -Original Message- From: Harris Cotton [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 11:07 PM To: [EMAIL PROTECTED] Subject: cookie based session sharing among web apps I am keen on having two web applications be able to share sessions. Currently, tomcat creates and maintains a session for each web application for a client. Moving the session id to the url is an option, but one I hope to avoid because of the refactoring it would generate in my applications jsps. In essence, I want tomcat to use / as the url path in the JSESSIONID cookie, and use this session id in all web applications the tomcat server hosts. Can this be accomplished solely with configuration? Thank You _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - 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: cookie based session sharing among web apps
I guess you could use a filter, and program all the session handling yourself -Original Message- From: Angus Mezick [mailto:[EMAIL PROTECTED] Sent: 8. juli 2003 15:33 To: Tomcat Users List Subject: RE: cookie based session sharing among web apps Not as far as I can tell from digging through the session manager code. It looks like each context has their own session manager which stores a list of active sessions in a hashmap. I think you are going to have to get rather creative with this one. I.E. create a patch that allows all tomcat contexts to share the same cookie. --Angus -Original Message- From: Harris Cotton [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 11:07 PM To: [EMAIL PROTECTED] Subject: cookie based session sharing among web apps I am keen on having two web applications be able to share sessions. Currently, tomcat creates and maintains a session for each web application for a client. Moving the session id to the url is an option, but one I hope to avoid because of the refactoring it would generate in my applications jsps. In essence, I want tomcat to use / as the url path in the JSESSIONID cookie, and use this session id in all web applications the tomcat server hosts. Can this be accomplished solely with configuration? Thank You _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - 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]
Re: cookie based session sharing among web apps
Yes, details: http://www.fwd.at/tomcat/sharing-session-data-howto.html (of course it's a workaround, but it works great with some restrictions regarding session serialization and clustering as I use a Context to store the shared session data; using a global cookie at root you can share one sessionid with other contexts). Johannes Tim Funk [EMAIL PROTECTED] 08.07.2003 13:21 Please respond to Tomcat Users List [EMAIL PROTECTED] To Tomcat Users List [EMAIL PROTECTED] cc Subject Re: cookie based session sharing among web apps No - it breaks the servlet spec. Sessions are scoped to their own webapp. -Tim Harris Cotton wrote: I am keen on having two web applications be able to share sessions. Currently, tomcat creates and maintains a session for each web application for a client. Moving the session id to the url is an option, but one I hope to avoid because of the refactoring it would generate in my applications jsps. In essence, I want tomcat to use / as the url path in the JSESSIONID cookie, and use this session id in all web applications the tomcat server hosts. Can this be accomplished solely with configuration? Thank You - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cookie based session sharing among web apps
Ooops - I over-read the comment regarding solely with configuration - well as Tim already pointed out the servlet spec doesn't permit it. You'll have to throw in some Java code to get things running, but finally it's possible to do it - you find a detailed how-to at the link I enclosed. However, I used the Context to store the shared session data which should be ok for smaller traffic, but might cause troubles if lot's of data have to be pumped into shared sessions. Then I'd encourage you to use a database or other persistence mechanisms :) johannes Johannes Fiala [EMAIL PROTECTED] 08.07.2003 23:01 Please respond to Tomcat Users List [EMAIL PROTECTED] To Tomcat Users List [EMAIL PROTECTED] cc Subject Re: cookie based session sharing among web apps Yes, details: http://www.fwd.at/tomcat/sharing-session-data-howto.html (of course it's a workaround, but it works great with some restrictions regarding session serialization and clustering as I use a Context to store the shared session data; using a global cookie at root you can share one sessionid with other contexts). Johannes Tim Funk [EMAIL PROTECTED] 08.07.2003 13:21 Please respond to Tomcat Users List [EMAIL PROTECTED] To Tomcat Users List [EMAIL PROTECTED] cc Subject Re: cookie based session sharing among web apps No - it breaks the servlet spec. Sessions are scoped to their own webapp. -Tim Harris Cotton wrote: I am keen on having two web applications be able to share sessions. Currently, tomcat creates and maintains a session for each web application for a client. Moving the session id to the url is an option, but one I hope to avoid because of the refactoring it would generate in my applications jsps. In essence, I want tomcat to use / as the url path in the JSESSIONID cookie, and use this session id in all web applications the tomcat server hosts. Can this be accomplished solely with configuration? Thank You - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cookie based session sharing among web apps
Yes, details: http://www.fwd.at/tomcat/sharing-session-data-howto.html (of course it's a workaround, but it works great with some restrictions regarding session serialization and clustering as I use a Context to store the shared session data; using a global cookie at root you can share one sessionid with other contexts). Johannes Tim Funk [EMAIL PROTECTED] 08.07.2003 13:21 Please respond to Tomcat Users List [EMAIL PROTECTED] To Tomcat Users List [EMAIL PROTECTED] cc Subject Re: cookie based session sharing among web apps No - it breaks the servlet spec. Sessions are scoped to their own webapp. -Tim Harris Cotton wrote: I am keen on having two web applications be able to share sessions. Currently, tomcat creates and maintains a session for each web application for a client. Moving the session id to the url is an option, but one I hope to avoid because of the refactoring it would generate in my applications jsps. In essence, I want tomcat to use / as the url path in the JSESSIONID cookie, and use this session id in all web applications the tomcat server hosts. Can this be accomplished solely with configuration? Thank You - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cookie based session sharing among web apps
Ooops - I over-read the comment regarding solely with configuration - well as Tim already pointed out the servlet spec doesn't permit it. You'll have to throw in some Java code to get things running, but finally it's possible to do it - you find a detailed how-to at the link I enclosed. However, I used the Context to store the shared session data which should be ok for smaller traffic, but might cause troubles if lot's of data have to be pumped into shared sessions. Then I'd encourage you to use a database or other persistence mechanisms :) johannes Johannes Fiala [EMAIL PROTECTED] 08.07.2003 23:01 Please respond to Tomcat Users List [EMAIL PROTECTED] To Tomcat Users List [EMAIL PROTECTED] cc Subject Re: cookie based session sharing among web apps Yes, details: http://www.fwd.at/tomcat/sharing-session-data-howto.html (of course it's a workaround, but it works great with some restrictions regarding session serialization and clustering as I use a Context to store the shared session data; using a global cookie at root you can share one sessionid with other contexts). Johannes Tim Funk [EMAIL PROTECTED] 08.07.2003 13:21 Please respond to Tomcat Users List [EMAIL PROTECTED] To Tomcat Users List [EMAIL PROTECTED] cc Subject Re: cookie based session sharing among web apps No - it breaks the servlet spec. Sessions are scoped to their own webapp. -Tim Harris Cotton wrote: I am keen on having two web applications be able to share sessions. Currently, tomcat creates and maintains a session for each web application for a client. Moving the session id to the url is an option, but one I hope to avoid because of the refactoring it would generate in my applications jsps. In essence, I want tomcat to use / as the url path in the JSESSIONID cookie, and use this session id in all web applications the tomcat server hosts. Can this be accomplished solely with configuration? Thank You - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Deploying web apps - Help
hi all, I am running multiple tomcat, one for each of the test environments we have defined in the company. In the each of the there Catalina_log files I have the following four lines for each and every request to the web server. 2003-07-07 09:21:06 HostConfig[dev]: Deploying discovered web applications 2003-07-07 09:21:21 HostConfig[dev]: Deploying discovered web applications 2003-07-07 09:21:37 HostConfig[dev]: Deploying discovered web applications 2003-07-07 09:21:52 HostConfig[dev]: Deploying discovered web applications I don't know what web application tomcat is trying to deploy, all of the web apps running are already deployed. Is does not seem like common functionality. Please Help, any information would be appreciated. Thanks Kal - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cookie based session sharing among web apps
I am keen on having two web applications be able to share sessions. Currently, tomcat creates and maintains a session for each web application for a client. Moving the session id to the url is an option, but one I hope to avoid because of the refactoring it would generate in my applications jsps. In essence, I want tomcat to use / as the url path in the JSESSIONID cookie, and use this session id in all web applications the tomcat server hosts. Can this be accomplished solely with configuration? Thank You _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RE: one web.xml for many web apps
What I use on my systems is to define xml-Entities for the components that I want common to my webapps. BOULAY Arnaud [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Ok, thanks ! but what about commons tips (like timeout) : one web.xml for many web apps implies the same session timeout for all of them: its a technical limit. Regards, Arnaud Messages d´origine De: Shapira, Yoav [EMAIL PROTECTED] Date: Vendredi 6 Juin 2003 14:13 Objet: RE: one web.xml for many web apps Howdy, There is one deployment descriptor per web application. This deploymentdescriptor is web.xml. Struts lets you define many sub applications or application flows (which translate into struts controller servlets) in every web application. The question is whether these application flows are big enough / complexenough / loosely coupled enough (this last one is often the key) to be webapps by themselves. Yoav Shapira Millennium ChemInformatics -Original Message- From: BOULAY Arnaud [EMAIL PROTECTED] Sent: Friday, June 06, 2003 8:05 AM To: [EMAIL PROTECTED] Subject: one web.xml for many web apps Hello ! It is said in Struts doc that only one controler servlet garantees that all will work fine but I must specify many web app in one descriptor (so many Action Servlet in 1 web.xml ) so what is the real risk ? and the limitations ? I think that it's not a good idea but I must proove it to my customer.Thanks in advance. Arnaud -- --- 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
one web.xml for many web apps
Hello ! It is said in Struts doc that only one controler servlet garantees that all will work fine but I must specify many web app in one descriptor (so many Action Servlet in 1 web.xml ) so what is the real risk ? and the limitations ? I think that it's not a good idea but I must proove it to my customer. Thanks in advance. Arnaud - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: one web.xml for many web apps
Howdy, There is one deployment descriptor per web application. This deployment descriptor is web.xml. Struts lets you define many sub applications or application flows (which translate into struts controller servlets) in every web application. The question is whether these application flows are big enough / complex enough / loosely coupled enough (this last one is often the key) to be webapps by themselves. Yoav Shapira Millennium ChemInformatics -Original Message- From: BOULAY Arnaud [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2003 8:05 AM To: [EMAIL PROTECTED] Subject: one web.xml for many web apps Hello ! It is said in Struts doc that only one controler servlet garantees that all will work fine but I must specify many web app in one descriptor (so many Action Servlet in 1 web.xml ) so what is the real risk ? and the limitations ? I think that it's not a good idea but I must proove it to my customer. Thanks in advance. Arnaud - 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]
Re: RE: one web.xml for many web apps
Ok, thanks ! but what about commons tips (like timeout) : one web.xml for many web apps implies the same session timeout for all of them: its a technical limit. Regards, Arnaud Messages d´origine De: Shapira, Yoav [EMAIL PROTECTED] Date: Vendredi 6 Juin 2003 14:13 Objet: RE: one web.xml for many web apps Howdy, There is one deployment descriptor per web application. This deploymentdescriptor is web.xml. Struts lets you define many sub applications or application flows (which translate into struts controller servlets) in every web application. The question is whether these application flows are big enough / complexenough / loosely coupled enough (this last one is often the key) to be webapps by themselves. Yoav Shapira Millennium ChemInformatics -Original Message- From: BOULAY Arnaud [EMAIL PROTECTED] Sent: Friday, June 06, 2003 8:05 AM To: [EMAIL PROTECTED] Subject: one web.xml for many web apps Hello ! It is said in Struts doc that only one controler servlet garantees that all will work fine but I must specify many web app in one descriptor (so many Action Servlet in 1 web.xml ) so what is the real risk ? and the limitations ? I think that it's not a good idea but I must proove it to my customer.Thanks in advance. Arnaud -- --- 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RE: one web.xml for many web apps
Howdy, If you need different sub-applications to have different session timeouts, I'd say the sub-applications are different enough to be their own web applications, each one with their own web.xml. Yoav Shapira Millennium ChemInformatics -Original Message- From: BOULAY Arnaud [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2003 11:25 AM To: Tomcat Users List Subject: Re: RE: one web.xml for many web apps Ok, thanks ! but what about commons tips (like timeout) : one web.xml for many web apps implies the same session timeout for all of them: its a technical limit. Regards, Arnaud Messages d´origine De: Shapira, Yoav [EMAIL PROTECTED] Date: Vendredi 6 Juin 2003 14:13 Objet: RE: one web.xml for many web apps Howdy, There is one deployment descriptor per web application. This deploymentdescriptor is web.xml. Struts lets you define many sub applications or application flows (which translate into struts controller servlets) in every web application. The question is whether these application flows are big enough / complexenough / loosely coupled enough (this last one is often the key) to be webapps by themselves. Yoav Shapira Millennium ChemInformatics -Original Message- From: BOULAY Arnaud [EMAIL PROTECTED] Sent: Friday, June 06, 2003 8:05 AM To: [EMAIL PROTECTED] Subject: one web.xml for many web apps Hello ! It is said in Struts doc that only one controler servlet garantees that all will work fine but I must specify many web app in one descriptor (so many Action Servlet in 1 web.xml ) so what is the real risk ? and the limitations ? I think that it's not a good idea but I must proove it to my customer.Thanks in advance. Arnaud -- --- 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] - 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]
Merging Multiple Web Apps
I have two webapps running under different contexts. They are both fairly large and reference their context within the coding. Is there any way I can setup an alias for each of the old apps and point them both at a new context? Hopefully this is something simple that I have just over looked. -Mike Medwith _ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Merging Multiple Web Apps
virtual folders? or sym links? - Original Message - From: Mike Medwith To: [EMAIL PROTECTED] Sent: Monday, June 02, 2003 9:32 PM Subject: Merging Multiple Web Apps I have two webapps running under different contexts. They are both fairly large and reference their context within the coding. Is there any way I can setup an alias for each of the old apps and point them both at a new context? Hopefully this is something simple that I have just over looked. -Mike Medwith _ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Merging Multiple Web Apps
I was thinking more of aliasing the context if possible in the server.xml or on the apache level. -Mike From: Dominic Parry [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: Merging Multiple Web Apps Date: Mon, 2 Jun 2003 21:35:18 +0200 MIME-Version: 1.0 Received: from apache.org ([208.185.179.12]) by mc3-f24.law16.hotmail.com with Microsoft SMTPSVC(5.0.2195.5600); Mon, 2 Jun 2003 12:35:59 -0700 Received: (qmail 1567 invoked by uid 500); 2 Jun 2003 19:35:18 - Received: (qmail 1125 invoked from network); 2 Jun 2003 19:35:17 - Received: from elephant.ru.ac.za (146.231.128.21) by daedalus.apache.org with SMTP; 2 Jun 2003 19:35:17 - Received: from leet.dsl.ru.ac.za ([146.231.113.83] helo=leet)by elephant.ru.ac.za with smtp (Exim 4.20)id 19Mv5T-0008SO-Axfor [EMAIL PROTECTED]; Mon, 02 Jun 2003 21:35:19 +0200 X-Message-Info: JGTYoYF78jEHjJx36Oi8+Q1OJDRSDidP Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk List-Unsubscribe: mailto:[EMAIL PROTECTED] List-Subscribe: mailto:[EMAIL PROTECTED] List-Help: mailto:[EMAIL PROTECTED] List-Post: mailto:[EMAIL PROTECTED] List-Id: Tomcat Users List tomcat-user.jakarta.apache.org Delivered-To: mailing list [EMAIL PROTECTED] Message-ID: [EMAIL PROTECTED] References: [EMAIL PROTECTED] X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Spam-Score: -4.7 () X-Scanner: exiscan for exim4 (http://duncanthrax.net/exiscan/) *19Mv5T-0008SO-Ax*CdjaxLpmZhI* X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Return-Path: [EMAIL PROTECTED] X-OriginalArrivalTime: 02 Jun 2003 19:36:00.0156 (UTC) FILETIME=[32169DC0:01C3293E] virtual folders? or sym links? - Original Message - From: Mike Medwith To: [EMAIL PROTECTED] Sent: Monday, June 02, 2003 9:32 PM Subject: Merging Multiple Web Apps I have two webapps running under different contexts. They are both fairly large and reference their context within the coding. Is there any way I can setup an alias for each of the old apps and point them both at a new context? Hopefully this is something simple that I have just over looked. -Mike Medwith _ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Merging Multiple Web Apps
Howdy, I have two webapps running under different contexts. They are both fairly large and reference their context within the coding. Is there any way I can setup an alias for each of the old apps and point them both at a new context? What would the ideal solution be for you? You can always set up a context with a filter mapped to /* that just does a redirect to another context. Hopefully this is something simple that I have just over looked. The core item overlooked here was in the design of the two existing webapps: hard-coding their context name is what leads to exactly this sort of predicament. 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]
Re: Merging Multiple Web Apps
Am I understanding you correctly: You have /context1 and /context2 and you want to access them both from /contextNew ? The problem then, is that you need to point one context at 2 old ones, not 2 old ones at a new one. As far as I know, this is not possible. The other solution is a find and replace scenario with a good editor like UltraEdit. I've had to do this before. Not pretty. I did learn not to hard code _ANYTHING_ though. - Original Message - From: Mike Medwith To: [EMAIL PROTECTED] Sent: Monday, June 02, 2003 9:40 PM Subject: Re: Merging Multiple Web Apps I was thinking more of aliasing the context if possible in the server.xml or on the apache level. -Mike From: Dominic Parry [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: Merging Multiple Web Apps Date: Mon, 2 Jun 2003 21:35:18 +0200 MIME-Version: 1.0 Received: from apache.org ([208.185.179.12]) by mc3-f24.law16.hotmail.com with Microsoft SMTPSVC(5.0.2195.5600); Mon, 2 Jun 2003 12:35:59 -0700 Received: (qmail 1567 invoked by uid 500); 2 Jun 2003 19:35:18 - Received: (qmail 1125 invoked from network); 2 Jun 2003 19:35:17 - Received: from elephant.ru.ac.za (146.231.128.21) by daedalus.apache.org with SMTP; 2 Jun 2003 19:35:17 - Received: from leet.dsl.ru.ac.za ([146.231.113.83] helo=leet)by elephant.ru.ac.za with smtp (Exim 4.20)id 19Mv5T-0008SO-Axfor [EMAIL PROTECTED]; Mon, 02 Jun 2003 21:35:19 +0200 X-Message-Info: JGTYoYF78jEHjJx36Oi8+Q1OJDRSDidP Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm Precedence: bulk List-Unsubscribe: mailto:[EMAIL PROTECTED] List-Subscribe: mailto:[EMAIL PROTECTED] List-Help: mailto:[EMAIL PROTECTED] List-Post: mailto:[EMAIL PROTECTED] List-Id: Tomcat Users List tomcat-user.jakarta.apache.org Delivered-To: mailing list [EMAIL PROTECTED] Message-ID: [EMAIL PROTECTED] References: [EMAIL PROTECTED] X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Spam-Score: -4.7 () X-Scanner: exiscan for exim4 (http://duncanthrax.net/exiscan/) *19Mv5T-0008SO-Ax*CdjaxLpmZhI* X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Return-Path: [EMAIL PROTECTED] X-OriginalArrivalTime: 02 Jun 2003 19:36:00.0156 (UTC) FILETIME=[32169DC0:01C3293E] virtual folders? or sym links? - Original Message - From: Mike Medwith To: [EMAIL PROTECTED] Sent: Monday, June 02, 2003 9:32 PM Subject: Merging Multiple Web Apps I have two webapps running under different contexts. They are both fairly large and reference their context within the coding. Is there any way I can setup an alias for each of the old apps and point them both at a new context? Hopefully this is something simple that I have just over looked. -Mike Medwith _ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: monitoring web apps
Howdy, Is the JVMPI powerful enough to get used in a memory tracker for tomcat (I haven't used it yet)? Wouldn't it make sense to have a monitoring app for memory and database connections for Tomcat (i.e. dbcp/poolman functionality + jvmpi in one admin app)? From your questions I gather you probably haven't worked with the JVMPI too much? ;) Yes, it's powerful enough. No, it wouldn't make sense to have a monitoring app like that, because the server would have to be started with JVMPI hooks which frequently require an order of magnitude increase in heap space and lead to 3x-20x reduction in performance. 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]
monitoring web apps
Hi all, I run a few apps under tomcat 4 and I'm wondering if there are any tools for monitoring what each app is doing - memory usage, cpu utilization etc ? I use the manager for monitoring numbers of users, stopping/starting etc but I'm looking for something that geives me more insight. Cheers - Steve - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: monitoring web apps
Apart from a profiling tool, not really. The manager app will tell you how many sessions exist per webapp. -Tim Steve Harris wrote: Hi all, I run a few apps under tomcat 4 and I'm wondering if there are any tools for monitoring what each app is doing - memory usage, cpu utilization etc ? I use the manager for monitoring numbers of users, stopping/starting etc but I'm looking for something that geives me more insight. Cheers - Steve - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: monitoring web apps
Howdy, The JVM itself (so tomcat as well) can't track memory usage or CPU usage per webapp as webapp is not a unit of execution in the JVM. Using a profiler and some load/stress tests, you can profile one application at a time to discern its resource consumption and behavior under stress. But getting this information at runtime, without a profiler, is difficult at best and basically intractable in common setups. Part of the problem is it all comes down to the basic java data types, e.g. String and int. You can see that there are 1 Strings in the heap, and with a profiler you can tell where those Strings were created, but you can't tell how much total memory they take. Yoav Shapira Millennium ChemInformatics -Original Message- From: Steve Harris [mailto:[EMAIL PROTECTED] Sent: Thursday, April 03, 2003 2:35 PM To: [EMAIL PROTECTED] Subject: monitoring web apps Hi all, I run a few apps under tomcat 4 and I'm wondering if there are any tools for monitoring what each app is doing - memory usage, cpu utilization etc ? I use the manager for monitoring numbers of users, stopping/starting etc but I'm looking for something that geives me more insight. Cheers - Steve - 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]
RE: monitoring web apps
Hi there, I usually track the memory consumption of each request using a debug info which prints the free memory available. Runtime r = Runtime.getRuntime(); long freeMem = r.freeMemory(); System.out.println(free memory: + freeMem); I think packaging this into a memory tracking module for all requests served could be quite informative for a developer. Personally I think it's a fundamental weakness of Java that you don't have a String.getMemoryConsumption() method or something like that. That would make it much easier to track memory consumption. However, the garbage collector seems to run at quite undetermined intervals, because after ten requests in a row the free memory goes up again. Does anybody know how to configure the garbage collector for Tomcat? Cheers, Johannes Shapira, Yoav [EMAIL PROTECTED] 03.04.2003 21:39 Please respond to Tomcat Users List [EMAIL PROTECTED] To Tomcat Users List [EMAIL PROTECTED] cc Subject RE: monitoring web apps Howdy, The JVM itself (so tomcat as well) can't track memory usage or CPU usage per webapp as webapp is not a unit of execution in the JVM. Using a profiler and some load/stress tests, you can profile one application at a time to discern its resource consumption and behavior under stress. But getting this information at runtime, without a profiler, is difficult at best and basically intractable in common setups. Part of the problem is it all comes down to the basic java data types, e.g. String and int. You can see that there are 1 Strings in the heap, and with a profiler you can tell where those Strings were created, but you can't tell how much total memory they take. Yoav Shapira Millennium ChemInformatics -Original Message- From: Steve Harris [mailto:[EMAIL PROTECTED] Sent: Thursday, April 03, 2003 2:35 PM To: [EMAIL PROTECTED] Subject: monitoring web apps Hi all, I run a few apps under tomcat 4 and I'm wondering if there are any tools for monitoring what each app is doing - memory usage, cpu utilization etc ? I use the manager for monitoring numbers of users, stopping/starting etc but I'm looking for something that geives me more insight. Cheers - Steve - 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]
RE: monitoring web apps
Have you looked at using the -Xincgc On Thu, 3 Apr 2003 [EMAIL PROTECTED] wrote: Hi there, I usually track the memory consumption of each request using a debug info which prints the free memory available. Runtime r = Runtime.getRuntime(); long freeMem = r.freeMemory(); System.out.println(free memory: + freeMem); I think packaging this into a memory tracking module for all requests served could be quite informative for a developer. Personally I think it's a fundamental weakness of Java that you don't have a String.getMemoryConsumption() method or something like that. That would make it much easier to track memory consumption. However, the garbage collector seems to run at quite undetermined intervals, because after ten requests in a row the free memory goes up again. Does anybody know how to configure the garbage collector for Tomcat? Cheers, Johannes Shapira, Yoav [EMAIL PROTECTED] 03.04.2003 21:39 Please respond to Tomcat Users List [EMAIL PROTECTED] To Tomcat Users List [EMAIL PROTECTED] cc Subject RE: monitoring web apps Howdy, The JVM itself (so tomcat as well) can't track memory usage or CPU usage per webapp as webapp is not a unit of execution in the JVM. Using a profiler and some load/stress tests, you can profile one application at a time to discern its resource consumption and behavior under stress. But getting this information at runtime, without a profiler, is difficult at best and basically intractable in common setups. Part of the problem is it all comes down to the basic java data types, e.g. String and int. You can see that there are 1 Strings in the heap, and with a profiler you can tell where those Strings were created, but you can't tell how much total memory they take. Yoav Shapira Millennium ChemInformatics -Original Message- From: Steve Harris [mailto:[EMAIL PROTECTED] Sent: Thursday, April 03, 2003 2:35 PM To: [EMAIL PROTECTED] Subject: monitoring web apps Hi all, I run a few apps under tomcat 4 and I'm wondering if there are any tools for monitoring what each app is doing - memory usage, cpu utilization etc ? I use the manager for monitoring numbers of users, stopping/starting etc but I'm looking for something that geives me more insight. Cheers - Steve - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: monitoring web apps
Howdy, I usually track the memory consumption of each request using a debug info which prints the free memory available. Runtime r = Runtime.getRuntime(); long freeMem = r.freeMemory(); System.out.println(free memory: + freeMem); So this tells you the free memory when the request came in. You can do it when the request goes out as well, but unless this was the only request during that time and nothing else is happening, the information is meaningless. And in a servlet container, it's almost never true that nothing else is happening. I think packaging this into a memory tracking module for all requests served could be quite informative for a developer. How??? You would have to prove the validity of this memory tracking approach before people accept it as a valid tool. Personally I think it's a fundamental weakness of Java that you don't have a String.getMemoryConsumption() method or something like that. That would make it much easier to track memory consumption. It would make it much easier indeed, but I still don't think that functionality belongs in the core language. This is what the JVMPI is for. However, the garbage collector seems to run at quite undetermined intervals, because after ten requests in a row the free memory goes up again. Does anybody know how to configure the garbage collector for Tomcat? Tomcat doesn't have its own garbage collector, the JVM does. And it's quite configurable. See http://java.sun.com/docs/hotspot/VMOptions.html for the available tuning parameters, nearly all of which can greatly affect garbage collection. 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]
RE: monitoring web apps
Hi Yoav, oops. I didn't line out that this kind of memory tracking is for testing locally with my dev environment to see how tomcat does when handling 100.000 records of a ResultSet or so... and when memory does show up again. Thanks for the link, I'll investigate it later... Is the JVMPI powerful enough to get used in a memory tracker for tomcat (I haven't used it yet)? Wouldn't it make sense to have a monitoring app for memory and database connections for Tomcat (i.e. dbcp/poolman functionality + jvmpi in one admin app)? thx Johannes
Server.xml messed up by /admin web apps
Hello All, I've just upgraded from tomcat 4.0.4 to 4.1.18 and put it on a test server to test and see if it works with my enviroment. The first thing I've done was to replicate the production server structure to my dev server, so I added with the /admin web interface some Hosts and one blank Context for each Host. Then I applyed the changes and... booom no Host started toi run... the jsp pages in the root dir did not excute and I see the code instead of the execution, while the pages inside the subdirs didn't compile and give a Jasper compilation error... the page won't compile but error is generated in the some jasper.* class So I made a test, rolled back the server.xml to the default one and addedd Hosts and Context manually to the file (old-style :-)) and now everything works... Does anybody have ever experienced the problem? Simone - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Virtual host / web-apps / win2k and a BUG
Seriously, you'll probably get the response you keep looking for if you move this thread to tomcat-dev instead of tomcat-user. The people who participate on this list aren't typically the developers, and the developers who do participate here do so rarely because of time constraints and the amount of traffic here. If it's really a bug, you'll save yourself time, effort, and grief by simply posting your findings to bugzilla and starting a thread on tomcat-dev. Repeatedly posting here with implied sarcasm that you're not getting the response you want here because you aren't using Linux is unreasonable, illogical, and rude. There's a process for bugs, and complaining about them or the lack or response by the developers to your complaints on tomcat-user isn't it. John -Original Message- From: Tom Holmes Jr. [mailto:[EMAIL PROTECTED]] Sent: Friday, January 24, 2003 11:45 PM To: Tomcat Users List Subject: Virtual host / web-apps / win2k and a BUG I have been complaining about a problem I have had with Apache 2.0.43, Tomcat 4.1.18, Jk2 and Windows 2000. The problem stems from the fact that if you define multiple vhosts/web-apps listed in the httpd.conf file, then the last web-app will work 100%, but ONLY the last one. If you have multiple web-apps listed (before the last one), the JSP pages will only work if they are filed in the root directory of that web-app. If you put JSP's in any other sub-directory, they will NOT be displayed correctly. Only the source of the JSP page will show and that will be a MAJOR security problem for anyone using multiple web-apps on Apache-Tomcat on Windows 2000. This fix can be corrected if you put the URI information in the workers2.properties file. I have been told you do not need to do this if you put the Location tag inside the VirtualHost as I have shown ... but as I said this only works for the LAST web-app listed. I am 99.9% that this is a BUG with either Tomcat and/or Jk2 because of the nature of the problem and how I solved it. My next step is to take the same configuration and port it to Red Hat Linux 8.0 and see if the problem still happens. If it is a problem in Linux also, I do believe that this problem will be fixed faster. I can 100% of the time reproduce this problem, and have done so many times now. If anyone has any questions, please let me know. Thanks. Tom In the httpd.conf file, I had my virtual host configured as: VirtualHost * ServerName tomholmes.net ServerAlias test.tomholmes.net ServerAdmin [EMAIL PROTECTED] DocumentRoot d:/web_software/jakarta-tomcat-4.1.18/wwwroot/test Location /*.jsp JkUriSet worker ajp13:localhost:8009 /Location ErrorLog logs/test-error_log CustomLog logs/test-access_log common DirectoryIndex default.jsp index.jsp /VirtualHost Partial listing of the server.xml file had a Host tag setup as follows: Host name=test.tomholmes.net debug=0 appBase=wwwroot unpackWARs=true autoDeploy=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=test_log. suffix=.txt timestamp=true/ Context path= docBase=test debug=0 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=test_context_log. suffix=.txt timestamp=true/ /Context /Host Partial listing of the workers2.properties file as follows: [uri:/test] info=Example webapp in the default context. context=/test debug=0 [uri:/test/*.jsp] info=Extension mapping [uri:/test/*] info=Map the whole webapp -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] --- Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003 --- Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Virtual host / web-apps / win2k and a BUG
I have been complaining about a problem I have had with Apache 2.0.43, Tomcat 4.1.18, Jk2 and Windows 2000. The problem stems from the fact that if you define multiple vhosts/web-apps listed in the httpd.conf file, then the last web-app will work 100%, but ONLY the last one. If you have multiple web-apps listed (before the last one), the JSP pages will only work if they are filed in the root directory of that web-app. If you put JSP's in any other sub-directory, they will NOT be displayed correctly. Only the source of the JSP page will show and that will be a MAJOR security problem for anyone using multiple web-apps on Apache-Tomcat on Windows 2000. This fix can be corrected if you put the URI information in the workers2.properties file. I have been told you do not need to do this if you put the Location tag inside the VirtualHost as I have shown ... but as I said this only works for the LAST web-app listed. I am 99.9% that this is a BUG with either Tomcat and/or Jk2 because of the nature of the problem and how I solved it. My next step is to take the same configuration and port it to Red Hat Linux 8.0 and see if the problem still happens. If it is a problem in Linux also, I do believe that this problem will be fixed faster. I can 100% of the time reproduce this problem, and have done so many times now. If anyone has any questions, please let me know. Thanks. Tom In the httpd.conf file, I had my virtual host configured as: VirtualHost * ServerName tomholmes.net ServerAlias test.tomholmes.net ServerAdmin [EMAIL PROTECTED] DocumentRoot d:/web_software/jakarta-tomcat-4.1.18/wwwroot/test Location /*.jsp JkUriSet worker ajp13:localhost:8009 /Location ErrorLog logs/test-error_log CustomLog logs/test-access_log common DirectoryIndex default.jsp index.jsp /VirtualHost Partial listing of the server.xml file had a Host tag setup as follows: Host name=test.tomholmes.net debug=0 appBase=wwwroot unpackWARs=true autoDeploy=true Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=test_log. suffix=.txt timestamp=true/ Context path= docBase=test debug=0 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=test_context_log. suffix=.txt timestamp=true/ /Context /Host Partial listing of the workers2.properties file as follows: [uri:/test] info=Example webapp in the default context. context=/test debug=0 [uri:/test/*.jsp] info=Extension mapping [uri:/test/*] info=Map the whole webapp -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: web apps and directory structure...
thats only for windows 2000, but thanks. also we are looking for a more general solution not dependant on the OS On Sun, 5 Jan 2003, Noel J. Bergman wrote: Jason, Does this help at all? http://www.mvps.org/win32/ntfs/lnw.html --- Noel -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - - Jason Pyeron http://www.pyerotechnics.com - - Owner Lead Pyerotechnics Development, Inc. - - +1 410 808 6646 (c) 500 West University Parkway #1S - - +1 410 467 2266 (f) Baltimore, Maryland 21210-3253 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, purge the message from your system and notify the sender immediately. Any other use of the email by you is prohibited. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
web apps and directory structure...
to all, this may be silly, but it is real issue. rationale: I have a client run windows nt 4.0 One of his vendors provides him with oracle, and other IIS based applications. His support contract does not allow hime to change the directory structure on his machine. details: here is the directory tree: /c /iisfiles /app1 /app2 /app3 /ourapp4 /d /publicdata /reports /images iis config mounts /d/publicdata/images under each app[1..3] etc. we have written a web app (which they got approval to install) /c/iisfiles/ourapp4 now we need to make use of the dataunder /d/publicdata Host name=localhost appBase=C:/iisfiles/ourapp4 debug=0 unpackWARs=true autoDeploy=true Context path= docBase= crossContext=true debug=0 reloadable=true/ /Host question: can we modify the config to mount/alias d:/publicdata/foodata to WEBAPP/foodata? that is: treated like it is a sub dir under the WEBAPP? -jason pyeron -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - - Jason Pyeron http://www.pyerotechnics.com - - Owner Lead Pyerotechnics Development, Inc. - - +1 410 808 6646 (c) 500 West University Parkway #1S - - +1 410 467 2266 (f) Baltimore, Maryland 21210-3253 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, purge the message from your system and notify the sender immediately. Any other use of the email by you is prohibited. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: web apps and directory structure...
Jason, Does this help at all? http://www.mvps.org/win32/ntfs/lnw.html --- Noel -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Contribution to the running.txt file for thje admin and manager web apps.
file this as an enhancement in bugzilla. This is the best way to make sure it is not overlooked. Charlie -Original Message- From: Sriram N [mailto:sriramx_2000;yahoo.com] Sent: Saturday, November 09, 2002 11:20 AM To: [EMAIL PROTECTED] Subject: Contribution to the running.txt file for thje admin and manager web apps. Hello, Since the running.txt does not contain any kickstart information for the manager and admin web applications, here's something that we could use as a placeholder until something better is developed. I was thinking of placing this paragraph before the (5) Troubleshooting section in the file running.txt * The Manager and the Admin web applications. --- These web applications can be used to maintain the Tomcat. They are priveleged web applications. If you are using the Memory Realm (which is the default), then the access can be configured from the $CATALINA_HOME$/conf/tomcat-users.xml. This file contains a few predefined roles and users for such roles. To access the manager application with the username mgr and the password pwd , add the following line to tomcat-users.xml user username=mgr password=pwd roles=manager/ The manager web application is documented in the Manger-Howto, a part of the Tomcat documentation. To access the admin application with the username adm and the password pwd, add the following line to tomcat-users.xml user username=adm password=pwd roles=admin/ The admin web application does not have a dedicated documentation page. Contributions are welcome. * Sriram __ Do you Yahoo!? U2 on LAUNCH - Exclusive greatest hits videos http://launch.yahoo.com/u2 -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org
Contribution to the running.txt file for thje admin and manager web apps.
Hello, Since the running.txt does not contain any kickstart information for the manager and admin web applications, here's something that we could use as a placeholder until something better is developed. I was thinking of placing this paragraph before the (5) Troubleshooting section in the file running.txt * The Manager and the Admin web applications. --- These web applications can be used to maintain the Tomcat. They are priveleged web applications. If you are using the Memory Realm (which is the default), then the access can be configured from the $CATALINA_HOME$/conf/tomcat-users.xml. This file contains a few predefined roles and users for such roles. To access the manager application with the username mgr and the password pwd , add the following line to tomcat-users.xml user username=mgr password=pwd roles=manager/ The manager web application is documented in the Manger-Howto, a part of the Tomcat documentation. To access the admin application with the username adm and the password pwd, add the following line to tomcat-users.xml user username=adm password=pwd roles=admin/ The admin web application does not have a dedicated documentation page. Contributions are welcome. * Sriram __ Do you Yahoo!? U2 on LAUNCH - Exclusive greatest hits videos http://launch.yahoo.com/u2 -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org
Contribution to the running.txt file for thje admin and manager web apps.
Hello, Since the running.txt does not contain any kickstart information for the manager and admin web applications, here's something that we could use as a placeholder until something better is developed. I was thinking of placing this paragraph before the (5) Troubleshooting section in the file running.txt * The Manager and the Admin web applications. --- These web applications can be used to maintain the Tomcat. They are priveleged web applications. If you are using the Memory Realm (which is the default), then the access can be configured from the $CATALINA_HOME$/conf/tomcat-users.xml. This file contains a few predefined roles and users for such roles. To access the manager application with the username mgr and the password pwd , add the following line to tomcat-users.xml user username=mgr password=pwd roles=manager/ The manager web application is documented in the Manger-Howto, a part of the Tomcat documentation. To access the admin application with the username adm and the password pwd, add the following line to tomcat-users.xml user username=adm password=pwd roles=admin/ The admin web application does not have a dedicated documentation page. Contributions are welcome. * Sriram __ Do you Yahoo!? U2 on LAUNCH - Exclusive greatest hits videos http://launch.yahoo.com/u2 -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org
Re: shared jars amongst web apps.
Well, shared/lib is better than common/lib (since it doesn't affect the Tomcat classes). A declared servlet (via servlet in web.xml) will create a new instance of the class for each context that it is used (actually, for each servlet declaration that it is used). This actually holds true for the (deprecated) Invoker mapping as well. Frank Diakovasilis [EMAIL PROTECTED] wrote in message news:810830D03816D411A480006008A979102F43CD;SPIKE... Does anybody know of a location where I can put a jar file that is shared among the web apps of a tomcat instance, but not thought out all instances. i.e. putting a jar in common/ would share that file throughout all instances of tomcat, which I do not want. Short of explicitly including the location in class path, is there a way to do this? Thanks -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org
RE: shared jars amongst web apps.
sounds like you want each webapp to have its own instance of statics,singletons,etc within your jar. In order to do this, you will need to copy the jar into each WEB-INF/lib where it is needed (and allow each with catalina.policy if applicable) Charlie -Original Message- From: Frank Diakovasilis [mailto:fdiak;lexel.com] Sent: Monday, October 28, 2002 11:23 AM To: Tomcat Users List Subject: shared jars amongst web apps. Does anybody know of a location where I can put a jar file that is shared among the web apps of a tomcat instance, but not thought out all instances. i.e. putting a jar in common/ would share that file throughout all instances of tomcat, which I do not want. Short of explicitly including the location in class path, is there a way to do this? Thanks -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org
shared jars amongst web apps.
Does anybody know of a location where I can put a jar file that is shared among the web apps of a tomcat instance, but not thought out all instances. i.e. putting a jar in common/ would share that file throughout all instances of tomcat, which I do not want. Short of explicitly including the location in class path, is there a way to do this? Thanks
Re: Java Logger problem with Tomcat4 web apps on Unix platforms...
do you mean that the the tomcat user has to have write priveledge for the directory being written to ?? On Thursday, Oct 24, 2002, at 21:44 Etc/GMT, Sexton, George wrote: Sounds like a permissions problem to me. -Original Message- From: Vijay KN [mailto:KNVIJAY;novell.com] Sent: Thursday, October 24, 2002 00:46 To: [EMAIL PROTECTED] Subject: Java Logger problem with Tomcat4 web apps on Unix platforms... Hi, We are using JVM1.4 Logger APIs in our servlet application deployed in Tomcat4.0 container to log messages into a file. On Unix platforms, the log file doesn't get created, though the application using Logger objects does not throw any exceptions. However, the same code works on other platforms like WinXP. Appreciate an early response. thanks vijay -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org
Java Logger problem with Tomcat4 web apps on Unix platforms...
Hi, We are using JVM1.4 Logger APIs in our servlet application deployed in Tomcat4.0 container to log messages into a file. On Unix platforms, the log file doesn't get created, though the application using Logger objects does not throw any exceptions. However, the same code works on other platforms like WinXP. Appreciate an early response. thanks vijay -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org
RE: Java Logger problem with Tomcat4 web apps on Unix platforms...
Hi, On Unix platforms, the log file doesn't get created, though the application using Logger objects does not throw any exceptions. However, the same code works on other platforms like WinXP. Perhaps a permissions problem on the directory where the file is supposed to get created? Does the server user have permissions to create and write in that directory? Also, maybe you could try configuring a console appender in addition to the file appender, to make sure you logging messages are coming out as expected. 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: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org
RE: Java Logger problem with Tomcat4 web apps on Unix platforms...
You need to provide some more information. What is the code that sets up the logging file look like? Where are you telling it to put the log file? -Original Message- From: Vijay KN [mailto:KNVIJAY;novell.com] Sent: Thursday, October 24, 2002 00:46 To: [EMAIL PROTECTED] Subject: Java Logger problem with Tomcat4 web apps on Unix platforms... Hi, We are using JVM1.4 Logger APIs in our servlet application deployed in Tomcat4.0 container to log messages into a file. On Unix platforms, the log file doesn't get created, though the application using Logger objects does not throw any exceptions. However, the same code works on other platforms like WinXP. Appreciate an early response. thanks vijay -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org
RE: Java Logger problem with Tomcat4 web apps on Unix platforms...
Sounds like a permissions problem to me. -Original Message- From: Vijay KN [mailto:KNVIJAY;novell.com] Sent: Thursday, October 24, 2002 00:46 To: [EMAIL PROTECTED] Subject: Java Logger problem with Tomcat4 web apps on Unix platforms... Hi, We are using JVM1.4 Logger APIs in our servlet application deployed in Tomcat4.0 container to log messages into a file. On Unix platforms, the log file doesn't get created, though the application using Logger objects does not throw any exceptions. However, the same code works on other platforms like WinXP. Appreciate an early response. thanks vijay -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:tomcat-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:tomcat-user-help;jakarta.apache.org
multiple discreet web apps
How can one have multiple discreet web apps running from Tomcat, each with its own URL? I wrote to ask this question a week ago and I recieved a response saying that seperate connectors must be setup, each to listen to specific IPs. And that host nodes must be setup for each discreet webapp, each containing a context node. BUT, I do not see how the two connect. I mean, so the host defines a webapp. And, a connector listens to an IP but how do you (or do you?) connect a connector to a host? How does tomcat know which IP/URL maps to which host/webapp? The documentation has only confused me more ... if anyone would be kind enough to explain this to me, I would greatly appreciate it. :) Thanks. Neal -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Tomcat - IP binding for multiple web apps
I would like to run multiple web applications from the same instance of tomcat. I have set this up in my dev environment, no problem. The problem is this: I can not figure out how to bind an IP address (one seperate IP per web app) to each of these web apps. Actually, I haven't even seen in the docs how to bing a single IP to Tomcat either DO I need to usa Appche (via Warp) to do this or something? Note: I am currently running standalone Tomcat 4.0.3, on Win2k, profesisonal. Thanks. Neal -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Tomcat - IP binding for multiple web apps
Modify your Http/1.1 Connector and add an address attribute to specify which IP address to listen on. By default, the Connector listens on ALL IP addresses. Connector class=org.apache.catalina.connector.http.HttpConnector address=127.0.0.1 / http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/http11.html From what I can tell, you can't define a webapp (defined as a Context in the server.xml) as running on a specific address. What you can do is use multiple Host entries to define Hosts that pick up different DNS Names. http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/host.html Host name=www.site1.com Context path=/webapp1 docBase=webapp1 / /Host Host name=www.site2.com Context path=/webapp2 docBase=webapp2 / /Host - Andrew -Original Message- From: neal [mailto:[EMAIL PROTECTED]] Sent: Sunday, August 18, 2002 3:19 PM To: Tomcat Users List Subject: Tomcat - IP binding for multiple web apps I would like to run multiple web applications from the same instance of tomcat. I have set this up in my dev environment, no problem. The problem is this: I can not figure out how to bind an IP address (one seperate IP per web app) to each of these web apps. Actually, I haven't even seen in the docs how to bing a single IP to Tomcat either DO I need to usa Appche (via Warp) to do this or something? Note: I am currently running standalone Tomcat 4.0.3, on Win2k, profesisonal. Thanks. Neal -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Tomcat - IP binding for multiple web apps
Thanks. You point out two things: (1) how to specify which IPs to listen on, and (2) how to associate a context with a host, where the host name is the URI pointing to the webapp. In Microsoft IIS, you bind an IP to each virtual host, and its the DNS servers job to point you to the right IP, based upon the URL lookup. In your suggestion with Tomcat I see how you are suggesting to bind IPs to Tomcat, but how does Tomcat then make the leap to binding those Ips to the correct virtual Host? Also, I read in the provided link (thanks for that, btw) that you can assign multiple contexts to each host, and multiple hosts to an enginer. I presume Tomcat is the engine, and that a host is essentially a Virtual Host, correct? How/why would one then have multiple contexts per a single host? Is it just me or is the Tomcat documentation a little lacking in this area? Thanks for your help! :) Neal -Original Message- From: Andrew Conrad [mailto:[EMAIL PROTECTED]] Sent: Sunday, August 18, 2002 12:43 PM To: 'Tomcat Users List' Subject: RE: Tomcat - IP binding for multiple web apps Modify your Http/1.1 Connector and add an address attribute to specify which IP address to listen on. By default, the Connector listens on ALL IP addresses. Connector class=org.apache.catalina.connector.http.HttpConnector address=127.0.0.1 / http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/http11.html From what I can tell, you can't define a webapp (defined as a Context in the server.xml) as running on a specific address. What you can do is use multiple Host entries to define Hosts that pick up different DNS Names. http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/host.html Host name=www.site1.com Context path=/webapp1 docBase=webapp1 / /Host Host name=www.site2.com Context path=/webapp2 docBase=webapp2 / /Host - Andrew -Original Message- From: neal [mailto:[EMAIL PROTECTED]] Sent: Sunday, August 18, 2002 3:19 PM To: Tomcat Users List Subject: Tomcat - IP binding for multiple web apps I would like to run multiple web applications from the same instance of tomcat. I have set this up in my dev environment, no problem. The problem is this: I can not figure out how to bind an IP address (one seperate IP per web app) to each of these web apps. Actually, I haven't even seen in the docs how to bing a single IP to Tomcat either DO I need to usa Appche (via Warp) to do this or something? Note: I am currently running standalone Tomcat 4.0.3, on Win2k, profesisonal. Thanks. Neal -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Tomcat - IP binding for multiple web apps
I can't tell you exactly, because I didn't write it, but here is what I have conferred from watching this list. A connector binds directly to your TCP/IP stack, and allows access via those addresses and ports. Tomcat then reads the Request information and determines the host and context. http://www.server1.com/myApp If you want a compare it to IIS, think this Engine is IIS Host is WebSite Context is VirtualDirectory. The reason why you would want more than one context is because you may want more than one webapp per host If you have two webapps called DestroyWorld and SaveWorld, you could put those webapps anywhere on the machine and not necessarily together. Say c:\goodprograms\SaveWorld and c:\badprograms\DestroyWorld. Using contexts, you could define access to both of those webapps. So you could type http://www.site.com/DestroyWorld and http://www.site.com/SaveWorld As far as the documentation goes, It's not perfect, but it's not too bad once you start reading it. Just jump in, and hopefully you will be swimming soon. - Andrew -Original Message- From: neal [mailto:[EMAIL PROTECTED]] Sent: Sunday, August 18, 2002 5:24 PM To: Tomcat Users List Subject: RE: Tomcat - IP binding for multiple web apps Thanks. You point out two things: (1) how to specify which IPs to listen on, and (2) how to associate a context with a host, where the host name is the URI pointing to the webapp. In Microsoft IIS, you bind an IP to each virtual host, and its the DNS servers job to point you to the right IP, based upon the URL lookup. In your suggestion with Tomcat I see how you are suggesting to bind IPs to Tomcat, but how does Tomcat then make the leap to binding those Ips to the correct virtual Host? Also, I read in the provided link (thanks for that, btw) that you can assign multiple contexts to each host, and multiple hosts to an enginer. I presume Tomcat is the engine, and that a host is essentially a Virtual Host, correct? How/why would one then have multiple contexts per a single host? Is it just me or is the Tomcat documentation a little lacking in this area? Thanks for your help! :) Neal -Original Message- From: Andrew Conrad [mailto:[EMAIL PROTECTED]] Sent: Sunday, August 18, 2002 12:43 PM To: 'Tomcat Users List' Subject: RE: Tomcat - IP binding for multiple web apps Modify your Http/1.1 Connector and add an address attribute to specify which IP address to listen on. By default, the Connector listens on ALL IP addresses. Connector class=org.apache.catalina.connector.http.HttpConnector address=127.0.0.1 / http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/http11.html From what I can tell, you can't define a webapp (defined as a Context in the server.xml) as running on a specific address. What you can do is use multiple Host entries to define Hosts that pick up different DNS Names. http://jakarta.apache.org/tomcat/tomcat-4.0-doc/config/host.html Host name=www.site1.com Context path=/webapp1 docBase=webapp1 / /Host Host name=www.site2.com Context path=/webapp2 docBase=webapp2 / /Host - Andrew -Original Message- From: neal [mailto:[EMAIL PROTECTED]] Sent: Sunday, August 18, 2002 3:19 PM To: Tomcat Users List Subject: Tomcat - IP binding for multiple web apps I would like to run multiple web applications from the same instance of tomcat. I have set this up in my dev environment, no problem. The problem is this: I can not figure out how to bind an IP address (one seperate IP per web app) to each of these web apps. Actually, I haven't even seen in the docs how to bing a single IP to Tomcat either DO I need to usa Appche (via Warp) to do this or something? Note: I am currently running standalone Tomcat 4.0.3, on Win2k, profesisonal. Thanks. Neal -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:tomcat-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tomcat 4.0, Linux 2.4 - Tomcat appears to deploy all directoriesunder /usr/local/tomcat as web apps.
actually what u should do is add a attribute to Host tar which is -- appsBase=/home and then u should have the docBase as /site/... The the nbase of ur application will be /home and not /usr.. tarun _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Tomcat 4.0, Linux 2.4 - Tomcat appears to deploy all directoriesunder /usr/local/tomcat as web apps.
Hi, I have trawled the web and most newsgroups and cannot find the solution, no doubt I have misconfigured something somwhere along the line. The situation is that all Host entries I have defined try to deploy the directory structure under /usr/local/tomcat. This is an example of the host I have defined in server.xml: -- server.xml begin --- Host name=www.site1.com debug=0 unpackWARs=false Valve className=org.apache.catalina.valves.AccessLogValve directory=logs prefix=site_access_log. suffix=.txt pattern=common/ Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=site_log. suffix=.txt timestamp=true/ Context path= docBase=/home/site/public_html debug=0/ /Host -- server.xml end --- The problem is that, in the willets_log file that gets created it has these entries: -- willets_log start HostConfig[www.site1.com]: Deploying web application directory bin 2002-02-11 12:31:35 StandardHost[www.site1.com]: Installing web application at context path /bin from URL file:/usr/local/jakarta-tomcat-4.0/bin etc -- willets_log end - Any rtfms, websites links and general guidance appreciated. It doesn't appear to break anything but I find it worrying and it does make the logfiles harder to read (can't see wood for all the trees...). TIA Diziet -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Accessing resources from other web-apps
Hello, I have two web-apps (main.war and employees.war). employees.war needs to obtain a dynamically-generated web page ('commonHeader.jsp') from the main.war. Is that possible? Sincerely, Sergei Batiuk. -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Accessing resources from other web-apps
Sergei Batiuk wrote: I have two web-apps (main.war and employees.war). employees.war needs to obtain a dynamically-generated web page ('commonHeader.jsp') from the main.war. Check out the javadocs for: javax.servlet.Context.getContext() javax.servelt.Context.getRequestDispatcher() Note that in Tomcat 4, in the Context element in web.xml, there's an attribute called crossContext that controls if you're allowed to do this sort of thing. There's a further explanation in the Config. Reference in the Tomcat doc page. You should have a local copy, but it's also avilable online at: http://jakarta.apache.org/tomcat/tomcat-4.0-doc/index.html -- Christopher St. John [EMAIL PROTECTED] DistribuTopia http://www.distributopia.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Shared jars of multiple web apps
I have two web apps that share a set of jars. Since these jars may be conflict with some other web apps on the same server, I prefer not to install them in the $CATALINA_HOME/lib directory. I know one option is to let each of the two web apps to have its own copy of all these jars in its WEB-INF/lib. What I want to find out is if there is any other option to keep only one copy of the shared jars? Thanks. -ming,
RE: Shared jars of multiple web apps
Make a symolic link to the WEB-INF/lib directory (although I don't use it myself, it could work.) Mvgr, Martin -Original Message- From: Ming Zhou [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 09, 2002 21:09 To: 'Tomcat Users List' (E-mail) Subject: Shared jars of multiple web apps I have two web apps that share a set of jars. Since these jars may be conflict with some other web apps on the same server, I prefer not to install them in the $CATALINA_HOME/lib directory. I know one option is to let each of the two web apps to have its own copy of all these jars in its WEB-INF/lib. What I want to find out is if there is any other option to keep only one copy of the shared jars? Thanks. -ming, -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Shared jars of multiple web apps
On Wed, 9 Jan 2002, Ming Zhou wrote: Date: Wed, 9 Jan 2002 14:09:08 -0600 From: Ming Zhou [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: 'Tomcat Users List' (E-mail) [EMAIL PROTECTED] Subject: Shared jars of multiple web apps I have two web apps that share a set of jars. Since these jars may be conflict with some other web apps on the same server, I prefer not to install them in the $CATALINA_HOME/lib directory. I know one option is to let each of the two web apps to have its own copy of all these jars in its WEB-INF/lib. By far the best option, IMHO. Not only is the cost of disk space trivial, this lets each of your apps switch to a newer version of the shared JAR later, on its own schedule, without having to do them all at once. What I want to find out is if there is any other option to keep only one copy of the shared jars? You'd have to modify Tomcat to have another kind of shared classloader that was assigned only to specific apps in order to do this. Thanks. -ming, Craig -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Shared jars of multiple web apps
Symbolic link is definitely a good option, but my deployment platform could be Windows. -Original Message- From: Martin van den Bemt [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 09, 2002 2:25 PM To: Tomcat Users List Subject: RE: Shared jars of multiple web apps Make a symolic link to the WEB-INF/lib directory (although I don't use it myself, it could work.) Mvgr, Martin -Original Message- From: Ming Zhou [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 09, 2002 21:09 To: 'Tomcat Users List' (E-mail) Subject: Shared jars of multiple web apps I have two web apps that share a set of jars. Since these jars may be conflict with some other web apps on the same server, I prefer not to install them in the $CATALINA_HOME/lib directory. I know one option is to let each of the two web apps to have its own copy of all these jars in its WEB-INF/lib. What I want to find out is if there is any other option to keep only one copy of the shared jars? Thanks. -ming, -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]