RE: tomcat 6 and subdirectories
Chuck, Thanks for the advise, I fixed the problem. IT was definitely related to the way contexts were defined and not to the servlet mappings. Some of your replies to older postings helped me figure out the problem. As a solution, I put the context files for the applications in conf/Catalina/[host]/[appName].xml as described in http://tomcat.apache.org/tomcat-6.0-doc/config/context.html It didn't work right away. I had to remove the appBase attribute from the host definition and provide an absolute path in the context's docBase. After that everything worked as expected and all subdirectories mapped to the proper servlet. Thanks, Ross -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Thursday, October 23, 2008 5:49 PM To: Tomcat Users List Subject: RE: tomcat 6 and subdirectories From: Angelov, Rossen [mailto:[EMAIL PROTECTED] Subject: RE: tomcat 6 and subdirectories I will try in META-INF/context.xml, although how do you specify multiple contexts in this case? There's a separate META-INF directory in each webapp, so each gets its own context.xml file. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: tomcat 6 and subdirectories
OK, I will put the appBase back in the host. -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Friday, October 24, 2008 3:38 PM To: Tomcat Users List Subject: RE: tomcat 6 and subdirectories From: Angelov, Rossen [mailto:[EMAIL PROTECTED] Subject: RE: tomcat 6 and subdirectories I had to remove the appBase attribute from the host definition and provide an absolute path in the context's docBase. That's not right. Each Host should have an appBase; you just need to insure that your webapps are installed somewhere else than under the appBase settings. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: tomcat 6 and subdirectories
Thanks Chuck, It is in server.xml and may that's the problem. In previous version I had in subdirectories under conf/Catalina. I will try in META-INF/context.xml, although how do you specify multiple contexts in this case? Ross -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Monday, October 20, 2008 2:18 PM To: Tomcat Users List Subject: RE: tomcat 6 and subdirectories From: Angelov, Rossen [mailto:[EMAIL PROTECTED] Subject: RE: tomcat 6 and subdirectories I have the feeling it's not the pattern, but something else that's causing this problem. Are you still specifying an empty docBase? That's illegal. Where is your Context element located? It should not be in server.xml (strongly discouraged, but not yet illegal), but rather in the webapp's META-INF/context.xml file. Note that the path attribute is not allowed when the Context is in the proper location. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
tomcat 6 and subdirectories
Hi, I recently started using Tomcat 6 but can't configure it to map subdirectories to same servlet within the default context. I didn't have problems with the same setup in Tomcat 5. Here is an example. http://mysite/test.html - maps to the application servlet and works as expected http://mysite/directory/test.html - doesn't maps to the application servlet and fails to display correctly The second link works only after I create an additional context, but it's not an acceptable solution because there are many directories in application base. Context path=directory docBase= / In web.xml I have the following servlet mapping: servlet-mapping servlet-nameappServlet/servlet-name url-pattern*.html/url-pattern /servlet-mapping I tried different url patters to match subdirectories, but neither one worked: url-pattern/*/url-pattern url-pattern/directory/*/url-pattern url-patterndirectory/*/url-pattern Any help is appreciated. Thanks, Ross This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat Monitoring
What is recommended for monitoring Tomcat? Or is there anything built in that can help monitoring the performance and the state of the thread pools? More specifically, I'm trying to find a way to time how long it take from the moment a request was received and when the response was returned. Thanks, Ross This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
context.xml locations and servlet mappings
Hi, I am experiencing a weird problem; when configuring my context in META-INF/context.xml, the servlet mappings stop working. I am trying to migrate web applications setup to run on Tomcat 5.0 to Tomcat 5.5 or 6. Currently one or more contexts are configured inside a host in server.xml. When I try moving these contexts in META-INF/context.xml, the servlet mappings in web.xml stop working and I can't figure out where the problem is. If I put the context back to server.xml, the mappings work fine and pages display correctly. Any help will be appreciated. web.xml ... servlet-mapping servlet-namemyServlet/servlet-name url-pattern*.html/url-pattern /servlet-mapping ... Server.xml Host name=hostname appBase=C:\projects\myApp .../ META-INF/context.xml Context path= docBase=html debug=0 privileged=true /Context Also tried Context docBase=html debug=0 privileged=true /Context The WEB-INF and META-INF are in C:\projects\myApp\html I am also not sure what is correct location for META-INF. Thanks, Ross This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: context.xml locations and servlet mappings
Chris, This didn't help. Removing them is not generating errors, the servlet still loads on startup, but then the mapping don't work. It doesn't make sense to remove the path and the docBase. Especially the docBase, it specifies the Context Root. If it's empty, it probably uses the host appBase for root, but this is incorrect. I should be able to specify the context root. What about the cases when there are more than one contexts per host? The problem seems to be somewhere else, but thanks for the advise. Ross -Original Message- From: Christopher Schultz [mailto:[EMAIL PROTECTED] Sent: Monday, June 04, 2007 4:46 PM To: Tomcat Users List Subject: Re: context.xml locations and servlet mappings -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ross, Angelov, Rossen wrote: META-INF/context.xml Context path= docBase=html debug=0 privileged=true Take out the path and docBase parameters. They are either illegal or ill-advised when using META-INF/context.xml. This might not be /the/ problem, but you should definitely remove those two attributes. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGZIgZ9CaO5/Lv0PARAoQoAKCIs1myORR5N3hhQAaBcEsyOZmi6ACfXMrx HUvaShUKZFwX385E0A1dq98= =3Rfo -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: context.xml locations and servlet mappings
Thank you for explaining about the META-INF location. Mine is following exactly the same pattern as you described, but still the servlet mappings are not functioning when using the META-INF/context.xml. Do you have any clues why this could be happening? The mappings work fine when inside the host element in server.xml. Ross -Original Message- From: Pid [mailto:[EMAIL PROTECTED] Sent: Monday, June 04, 2007 5:25 PM To: Tomcat Users List Subject: Re: context.xml locations and servlet mappings One META-INF/context.xml per Context is the intended usage. The appBase ../your/app/base should contain: .../app/base/ROOT/index.jsp .../app/base/ROOT/WEB-INF/web.xml .../app/base/ROOT/META-INF/context.xml .../app/base/Other/index.jsp .../app/base/Other/WEB-INF/web.xml .../app/base/Other/META-INF/context.xml for /index.jsp and /Other/index.jsp, where ROOT is the location for the default Context. p Angelov, Rossen wrote: Chris, This didn't help. Removing them is not generating errors, the servlet still loads on startup, but then the mapping don't work. It doesn't make sense to remove the path and the docBase. Especially the docBase, it specifies the Context Root. If it's empty, it probably uses the host appBase for root, but this is incorrect. I should be able to specify the context root. What about the cases when there are more than one contexts per host? The problem seems to be somewhere else, but thanks for the advise. Ross -Original Message- From: Christopher Schultz [mailto:[EMAIL PROTECTED] Sent: Monday, June 04, 2007 4:46 PM To: Tomcat Users List Subject: Re: context.xml locations and servlet mappings -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ross, Angelov, Rossen wrote: META-INF/context.xml Context path= docBase=html debug=0 privileged=true Take out the path and docBase parameters. They are either illegal or ill-advised when using META-INF/context.xml. This might not be /the/ problem, but you should definitely remove those two attributes. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGZIgZ9CaO5/Lv0PARAoQoAKCIs1myORR5N3hhQAaBcEsyOZmi6ACfXMrx HUvaShUKZFwX385E0A1dq98= =3Rfo -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How set a default context
I know two ways to define a default context in Tomcat: - a Context that has an empty PATH attribute will become the default web application for the virtual host. This definitely works on Tomcat 5.5 - DefaultContext element in the Host is the other way to define a default context, but this may work only on Tomcat 5.0 Ross -Original Message- From: Ivan Balashov [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 26, 2006 1:08 PM To: 'Tomcat Users List' Subject: RE: How set a default context I think it should be configurable from somewhere. Moving directories or writing some custom apps for this IMHo is not quite right. -Ivan -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 26, 2006 11:54 AM To: Tomcat Users List Subject: Re: How set a default context Ivan Balashov wrote: But that means the context of application will change, as opposed to making it default. I'm not sure if this change is harmful to the application, but if it uses e.g. context name for some reason it might be failing. -Ivan If this is the case then you have a badly written application. In the short term you can try putting a simple ROOT app that just redirects to your app . Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How set a default context
What I wrote was extracted from the same doc, the URL you pasted in your response. You may define as many Context elements as you wish. Each such Context MUST have a unique context path, which is defined by the path attribute. In addition, you MUST define a Context with a context path equal to a zero-length string. This Context becomes the default web application for this virtual host, and is used to process all requests that do not match any other Context's context path. -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 26, 2006 2:15 PM To: Tomcat Users List Subject: RE: How set a default context From: Angelov, Rossen [mailto:[EMAIL PROTECTED] Subject: RE: How set a default context - a Context that has an empty PATH attribute will become the default web application for the virtual host. This definitely works on Tomcat 5.5 Definitely not true. Read the doc: http://tomcat.apache.org/tomcat-5.5-doc/config/context.html which states: Please note that for tomcat 5, unlike tomcat 4.x, it is NOT recommended to place Context elements directly in the server.xml file. Instead, put them in the META-INF/context.xml directory of your WAR file or the conf directory as described above. and The value of this field [path] must not be set except when statically defining a Context in server.xml, as it will be infered [sic] from the filenames used for either the .xml context file or the docBase. - DefaultContext element in the Host is the other way to define a default context, but this may work only on Tomcat 5.0 The DefaultContext element only specified the set of attributes common to all contexts; it did not specify what the default application was. DefaultContext was replaced by the conf/context.xml file quite some time ago. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: isVirtualWebappRelative not working
The problems, I was trying to describe appeared to be a bug - http://issues.apache.org/bugzilla/show_bug.cgi?id=39752 In my case I preferred to go back to Tomcat 5.5.9 where SSI works correctly, but in case other people have the same problem the fix is available in SVN. Ross -Original Message- From: Angelov, Rossen [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 16, 2006 10:40 AM To: Tomcat Users List; Martin Gainty Subject: RE: isVirtualWebappRelative not working Martin, thanks for replying. I agree with what you are saying, but my point is that !--#include virtual=/head.html -- should work from any subdirectory /Foo or /Foo/Moo or /Foo/Moo/TooFoo because the isVirtualWebappRelative parameter is set to true. Which means the virtual path should be interpreted as relative to the context root. If the current directory is /Foo or /Too/Moo, !--#include virtual=/head.html -- should still work. if in /Foo, !--#include virtual=../head.html -- this will also work in in /Foo/Moo !--#include virtual=../../head.html -- should work too Setting isVirtualWebappRelative to true or false has worked fine for me with previous versions of Tomcat, but not with Tomcat 5.5. This makes migrating sites very difficult. A developer shouldn't be changing the code every time the web server version is upgraded. Ross -Original Message- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 16, 2006 5:49 AM To: Tomcat Users List Subject: Re: isVirtualWebappRelative not working Good Morning Ross- If your path does not begin with a slash (/) then it is taken to be *relative to the current document* !--#include virtual=/head.html -- --Include head.html (head.html current location loads correctly) !--#include virtual=/Foo/Foo.html -- --Include in Foo.html (Foo.html loads current location) from Foo folder note the absence of / in the first position so this is the relative to current document !--#include virtual=../header.html -- --Include in the original head.html NB: Use #include virtual instead of #exec cgi to pass QueryStrings More info available at http://httpd.apache.org/docs/1.3/mod/mod_include.html HTH, Martin-- * This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. Hi everybody, I'm having issues with isVirtualWebappRelative parameter when configuring the SSIServlet. It just won't work for me. I have set up the value to 1 to make the path be interpreted as relative to the context root, but I'm still getting the following output in catalina.out: ... SEVERE: #include--Couldn't include file: /head.html java.io.IOException: Couldn't find file: /head.html at org.apache.catalina.ssi.SSIServletExternalResolver.getFileText(SSIServletExternalResolver.java:537) at org.apache.catalina.ssi.SSIMediator.getFileText(SSIMediator.java:155) at org.apache.catalina.ssi.SSIInclude.process(SSIInclude.java:44) ... The file, head.html, exists in the context root and everything works fine when a file from the same directory is including it via !--#include virtual=/head.html-- The problem comes when a file from a subdirectory tries to include it. I'm testing this with Tomcat 5.5.17 on Linux. The same configuration works fine with Tomcat 5.0.25 Does anybody know of any bugs related to the isVirtualWebappRelative parameter in Tomcat 5.5? I might have missed something in the configuration, but can't think of it right now. Any help and ideas are welcome. Thanks, Ross This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
isVirtualWebappRelative not working
Hi everybody, I'm having issues with isVirtualWebappRelative parameter when configuring the SSIServlet. It just won't work for me. I have set up the value to 1 to make the path be interpreted as relative to the context root, but I'm still getting the following output in catalina.out: ... SEVERE: #include--Couldn't include file: /head.html java.io.IOException: Couldn't find file: /head.html at org.apache.catalina.ssi.SSIServletExternalResolver.getFileText(SSIServletExternalResolver.java:537) at org.apache.catalina.ssi.SSIMediator.getFileText(SSIMediator.java:155) at org.apache.catalina.ssi.SSIInclude.process(SSIInclude.java:44) ... The file, head.html, exists in the context root and everything works fine when a file from the same directory is including it via !--#include virtual=/head.html-- The problem comes when a file from a subdirectory tries to include it. I'm testing this with Tomcat 5.5.17 on Linux. The same configuration works fine with Tomcat 5.0.25 Does anybody know of any bugs related to the isVirtualWebappRelative parameter in Tomcat 5.5? I might have missed something in the configuration, but can't think of it right now. Any help and ideas are welcome. Thanks, Ross This communication is intended solely for the addressee and is confidential and not for third party unauthorized distribution - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]