Setting up a Context outside of webapps (was: Host appBase vs. Context docBase)
I'm asking my question differently since it didn't get much traction when I asked it before. I want to set up a Web Context outside of %CATALINA_BASE%/webapps, e.g. at C:\WebRoot\myapp. I prefer to configure it in server.xml, because I like it that all of my config files are at %CATALINA_BASE%/conf. So for example, to set up an app for myapp.tld, with contents in C:\WebRoot\myapp, I use the following snippet: I don't want to specify Host appBase to C:\WebRoot because it contains separate sites (Contexts) in different directories, and each site is configured to run at the root directory of the site, e.g. http://myapp.tld/. I also clear the contents of %CATALINA_BASE%/webapps. Is that the right way to do it? Is there a better way? Anything wrong with this set up? It'd be great if the docs had contained some real examples. Thanks, Igal Sapir Lucee Core Developer Lucee.org <http://lucee.org/> On 10/21/2016 1:21 AM, r.bott...@afterbit.com wrote: Hello, did you received some real config? Roberto. -Messaggio originale- Da: Igal @ Lucee.org [mailto:i...@lucee.org] Inviato: venerdì 7 ottobre 2016 21:57 A: Tomcat Users List <users@tomcat.apache.org> Oggetto: Re: Host appBase vs. Context docBase Suppose you tell us your Tomcat version. I'm using Tomcat 8.5.5 -- not sure how relevant that is since AFAIK this has not changed in years. It is highly unlikely that you want the name to be App1 Of course that my host name is not App1, that was to remove fluff and to keep only the relevant information in the email. The path attribute of the element must not be used unless the element is in server.xml, which it should not be I actually prefer it to be in server.xml The docBase attribute is used only when the element is located in conf/Catalina/[host]/[appName].xml That is definitely not true. I've set up Tomcat many many times like this and it works. I may have not set it up the best way, hence my question here, but the docBase attribute is indeed, used. You need to read the documentation for , , and deployment for the Tomcat version you're using. It would have been nice to see some real life examples of complete configurations. Igal Sapir Lucee Core Developer Lucee.org <http://lucee.org/> On 10/7/2016 12:39 PM, Caldarale, Charles R wrote: From: Igal @ Lucee.org [mailto:i...@lucee.org] Subject: Host appBase vs. Context docBase Suppose that I have an application at C:\WebApps\App1 Suppose you tell us your Tomcat version. Both of the above are incorrect. It is highly unlikely that you want the name to be App1. The appBase attribute of must point to a directory where one or more webapps are located for automatic deployment. It must never point to a specific webapp. The path attribute of the element must not be used unless the element is in server.xml, which it should not be. The docBase attribute is used only when the element is located in conf/Catalina/[host]/[appName].xml. You need to read the documentation for , , and deployment for the Tomcat version you're using. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
R: Host appBase vs. Context docBase
Hello, did you received some real config? Roberto. -Messaggio originale- Da: Igal @ Lucee.org [mailto:i...@lucee.org] Inviato: venerdì 7 ottobre 2016 21:57 A: Tomcat Users List <users@tomcat.apache.org> Oggetto: Re: Host appBase vs. Context docBase > Suppose you tell us your Tomcat version. I'm using Tomcat 8.5.5 -- not sure how relevant that is since AFAIK this has not changed in years. > It is highly unlikely that you want the name to be App1 Of course that my host name is not App1, that was to remove fluff and to keep only the relevant information in the email. > The path attribute of the element must not be used unless > the element is in server.xml, which it should not be I actually prefer it to be in server.xml > The docBase attribute is used only when the element is > located in conf/Catalina/[host]/[appName].xml That is definitely not true. I've set up Tomcat many many times like this and it works. I may have not set it up the best way, hence my question here, but the docBase attribute is indeed, used. > You need to read the documentation for , , and deployment for the Tomcat version you're using. It would have been nice to see some real life examples of complete configurations. Igal Sapir Lucee Core Developer Lucee.org <http://lucee.org/> On 10/7/2016 12:39 PM, Caldarale, Charles R wrote: >> From: Igal @ Lucee.org [mailto:i...@lucee.org] >> Subject: Host appBase vs. Context docBase Suppose that I have an >> application at C:\WebApps\App1 > Suppose you tell us your Tomcat version. > >> >> >> >> >> >> > Both of the above are incorrect. It is highly unlikely that you want the name to be App1. The appBase attribute of must point to a directory where one or more webapps are located for automatic deployment. It must never point to a specific webapp. The path attribute of the element must not be used unless the element is in server.xml, which it should not be. The docBase attribute is used only when the element is located in conf/Catalina/[host]/[appName].xml. > > You need to read the documentation for , , and deployment for the Tomcat version you're using. > > - Chuck > > > THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Host appBase vs. Context docBase
Suppose you tell us your Tomcat version. I'm using Tomcat 8.5.5 -- not sure how relevant that is since AFAIK this has not changed in years. It is highly unlikely that you want the name to be App1 Of course that my host name is not App1, that was to remove fluff and to keep only the relevant information in the email. The path attribute of the element must not be used unless the element is in server.xml, which it should not be I actually prefer it to be in server.xml The docBase attribute is used only when the element is located in conf/Catalina/[host]/[appName].xml That is definitely not true. I've set up Tomcat many many times like this and it works. I may have not set it up the best way, hence my question here, but the docBase attribute is indeed, used. You need to read the documentation for , , and deployment for the Tomcat version you're using. It would have been nice to see some real life examples of complete configurations. Igal Sapir Lucee Core Developer Lucee.org <http://lucee.org/> On 10/7/2016 12:39 PM, Caldarale, Charles R wrote: From: Igal @ Lucee.org [mailto:i...@lucee.org] Subject: Host appBase vs. Context docBase Suppose that I have an application at C:\WebApps\App1 Suppose you tell us your Tomcat version. Both of the above are incorrect. It is highly unlikely that you want the name to be App1. The appBase attribute of must point to a directory where one or more webapps are located for automatic deployment. It must never point to a specific webapp. The path attribute of the element must not be used unless the element is in server.xml, which it should not be. The docBase attribute is used only when the element is located in conf/Catalina/[host]/[appName].xml. You need to read the documentation for , , and deployment for the Tomcat version you're using. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Host appBase vs. Context docBase
> From: Igal @ Lucee.org [mailto:i...@lucee.org] > Subject: Host appBase vs. Context docBase > Suppose that I have an application at C:\WebApps\App1 Suppose you tell us your Tomcat version. > > > > > > > Both of the above are incorrect. It is highly unlikely that you want the name to be App1. The appBase attribute of must point to a directory where one or more webapps are located for automatic deployment. It must never point to a specific webapp. The path attribute of the element must not be used unless the element is in server.xml, which it should not be. The docBase attribute is used only when the element is located in conf/Catalina/[host]/[appName].xml. You need to read the documentation for , , and deployment for the Tomcat version you're using. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Host appBase vs. Context docBase
Hi, Suppose that I have an application at C:\WebApps\App1 Is it better to set it up as Host appBase (option 1) or as Context docBase with empty path (option 2): Thanks, Igal Sapir Lucee Core Developer Lucee.org <http://lucee.org/>
RE: Host appBase vs Context docBase
-Original Message- From: Igal @ getRailo.org [mailto:i...@getrailo.org] Sent: Friday, July 04, 2014 9:05 PM To: Tomcat Users List Subject: Host appBase vs Context docBase I'm a little confused about the Host appBase attribute. Let's say that my website resides in D:\www\site1 I don't like using {Tomcat}/webapps so I don't want to have it as a base directory for websites. What I've been doing so far is create an empty folder alongside webapps, named empty, and use it as appBase, e.g. Host name=Site1 appBase=empty unpackWARs=false autoDeploy=false !-- this works but what's the deal with appBase? !-- Context path=/ docBase=D:/www/site1 / /Host But it feels like I'm doing something wrong. I expect this to work, but it doesn't: Host name=Site1 appBase=D:/www/site1 unpackWARs=false autoDeploy=false !-- this doesn't work !-- /Host Can anyone explain why the snippet above doesn't work, and if that is the way it should be, then what is the purpose of Host/appBase? TIA -- Igal Sapir Railo Core Developer http://getRailo.org/ Igal - For the way you want to configure your setup, your original configuration will work, except that you need to change the path from / to . That's kind of the one thing bothered me from the beginning: if you wanted a named path, like virtdir you have to specify it with a leading slash, /virtdir but for the ROOT you don't specify it. Seemed like an inconsistent treatment to me. That said, I'd really recommend following current practices and moving the Context element to its own file under the conf/engine_name/host_name directory structure. For one, you don't have to worry about that path parameter ever again. The name of the XML file becomes the path value, with the exception of needing to name the file ROOT.xml to get the null path. Also, this allows you to store the file under the META-INF directory of your application and maintain the information there and have it copied to the correct place on deployment. Read the docs for more info. Here's how to remember the difference between appbase and docbase: The appbase is the path to a directory where the applications for the host reside. Any directory or war file stored there will be deployed under the host. The docbase is the path to the directory containing the files for a specific application. If it is a relative path, the directory is expected to reside under the appbase (take care to avoid double-deployment). If it is a fully-qualified path, then the appbase value is ignored. It is possible to mix the two, but you need to be careful if you attempt that. Creating a new directory for each host is a good idea, even if they are empty. If I were you, I'd really look at moving to the current configuration mechanism. After you get used to it, you'll see it makes a lot more sense. As an added plus, any change you make to the context can take effect without having to restart the entire Tomcat service. Jeff - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Host appBase vs Context docBase
On 7/5/2014 1:38 PM, Igal @ getRailo.org wrote: What version of Tomcat are you using? I've been using Tomcat 6 and 7 for a while, and now running Tomcat 8. it is recommended that Context elements not be placed directly in server.xml I know, but it is much easier for me to edit a single file, server.xml then deploy all the other files. I'm looking to keep the deployment process as simple as possible. you shouldn't need the empty directory. I've used an absolute path for the Host appBase attribute with relative paths for Context docBase attributes in Tomcat 6 and 7 without any problems. when I try that then webapps is used by default. if a request is made for a file that exists in webapps, e.g. index.jsp and does not exist in my application's folder, then it is served from webapps and I don't want that. are you sure you want / for the Context path attribute in the first example above? it was my understanding that and / are the same here. / reads more clearly to me as the root directory so I prefer to use that. *after reading your email and testing it, however, I noticed that if I omit the Host/appBase and use an empty-string for the Context/docBase/path it works as intended, so maybe that's what I was doing wrong? is that the best practice?* Host name=Site1 unpackWARs=false autoDeploy=false Context path= docBase=D:/www/site1 / Context path=/virtualdir docBase=D:/www/shared/virtualdir / /Host ? thank you both for your responses, Igal On 7/5/2014 9:48 AM, Terence M. Bandoian wrote: On 7/4/2014 9:04 PM, Igal @ getRailo.org wrote: I'm a little confused about the Host appBase attribute. Let's say that my website resides in D:\www\site1 I don't like using {Tomcat}/webapps so I don't want to have it as a base directory for websites. What I've been doing so far is create an empty folder alongside webapps, named empty, and use it as appBase, e.g. Host name=Site1 appBase=empty unpackWARs=false autoDeploy=false !-- this works but what's the deal with appBase? !-- Context path=/ docBase=D:/www/site1 / /Host But it feels like I'm doing something wrong. I expect this to work, but it doesn't: Host name=Site1 appBase=D:/www/site1 unpackWARs=false autoDeploy=false !-- this doesn't work !-- /Host Can anyone explain why the snippet above doesn't work, and if that is the way it should be, then what is the purpose of Host/appBase? TIA Hi, Igal- What version of Tomcat are you using? Also, it is recommended that Context elements not be placed directly in server.xml. See: http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Defining_a_context That said, you shouldn't need the empty directory. I've used an absolute path for the Host appBase attribute with relative paths for Context docBase attributes in Tomcat 6 and 7 without any problems. I haven't tried it with absolute paths for both appBase and docBase. Lastly, are you sure you want / for the Context path attribute in the first example above? The Context path for the default web application of a Host should be an empty string (). See: http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Common_Attributes -Terence Bandoian Hi, Igal- Glad you were able to get it working. Please note the warning in the Tomcat docs about using the Context path attribute that reads: Even when statically defining a Context in server.xml, this attribute must not be set unless either the docBase is not located under the Host's appBase or both deployOnStartup and autoDeploy are false. If this rule is not followed, double deployment is likely to result. This is included in: http://tomcat.apache.org/tomcat-8.0-doc/config/context.html#Common_Attributes For information about about how context paths relate to WAR file names and application directory names, see: http://tomcat.apache.org/tomcat-8.0-doc/config/context.html#Naming In particular, please note that If the context path is the empty string them the base name will be ROOT (always in upper case) The recommended practice is to create separate context XML files and package them in the application WAR files. However, for simple installations, I've had success with something like: Host name=Host appBase=c:/webapps autoDeploy=false deployOnStartup=true unpackWARs=true Context path= docBase=ROOT / /Host The [Tomcat]/webapps directory may then be deleted (if you don't need the packaged apps or doc) and ROOT.war placed directly in c:/webapps. -Terence Bandoian - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Host appBase vs Context docBase
hi Terence, thanks again for your reply. I have autoDeploy set to false, but did not explicitly set deployOnStartup (I think that the default is true). I am actually not using WARs so I'm not sure how, or if, any of this is applicable to my case. Igal On 7/7/2014 9:54 AM, Terence M. Bandoian wrote: On 7/5/2014 1:38 PM, Igal @ getRailo.org wrote: What version of Tomcat are you using? I've been using Tomcat 6 and 7 for a while, and now running Tomcat 8. it is recommended that Context elements not be placed directly in server.xml I know, but it is much easier for me to edit a single file, server.xml then deploy all the other files. I'm looking to keep the deployment process as simple as possible. you shouldn't need the empty directory. I've used an absolute path for the Host appBase attribute with relative paths for Context docBase attributes in Tomcat 6 and 7 without any problems. when I try that then webapps is used by default. if a request is made for a file that exists in webapps, e.g. index.jsp and does not exist in my application's folder, then it is served from webapps and I don't want that. are you sure you want / for the Context path attribute in the first example above? it was my understanding that and / are the same here. / reads more clearly to me as the root directory so I prefer to use that. *after reading your email and testing it, however, I noticed that if I omit the Host/appBase and use an empty-string for the Context/docBase/path it works as intended, so maybe that's what I was doing wrong? is that the best practice?* Host name=Site1 unpackWARs=false autoDeploy=false Context path= docBase=D:/www/site1 / Context path=/virtualdir docBase=D:/www/shared/virtualdir / /Host ? thank you both for your responses, Igal On 7/5/2014 9:48 AM, Terence M. Bandoian wrote: On 7/4/2014 9:04 PM, Igal @ getRailo.org wrote: I'm a little confused about the Host appBase attribute. Let's say that my website resides in D:\www\site1 I don't like using {Tomcat}/webapps so I don't want to have it as a base directory for websites. What I've been doing so far is create an empty folder alongside webapps, named empty, and use it as appBase, e.g. Host name=Site1 appBase=empty unpackWARs=false autoDeploy=false !-- this works but what's the deal with appBase? !-- Context path=/ docBase=D:/www/site1 / /Host But it feels like I'm doing something wrong. I expect this to work, but it doesn't: Host name=Site1 appBase=D:/www/site1 unpackWARs=false autoDeploy=false !-- this doesn't work !-- /Host Can anyone explain why the snippet above doesn't work, and if that is the way it should be, then what is the purpose of Host/appBase? TIA Hi, Igal- What version of Tomcat are you using? Also, it is recommended that Context elements not be placed directly in server.xml. See: http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Defining_a_context That said, you shouldn't need the empty directory. I've used an absolute path for the Host appBase attribute with relative paths for Context docBase attributes in Tomcat 6 and 7 without any problems. I haven't tried it with absolute paths for both appBase and docBase. Lastly, are you sure you want / for the Context path attribute in the first example above? The Context path for the default web application of a Host should be an empty string (). See: http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Common_Attributes -Terence Bandoian Hi, Igal- Glad you were able to get it working. Please note the warning in the Tomcat docs about using the Context path attribute that reads: Even when statically defining a Context in server.xml, this attribute must not be set unless either the docBase is not located under the Host's appBase or both deployOnStartup and autoDeploy are false. If this rule is not followed, double deployment is likely to result. This is included in: http://tomcat.apache.org/tomcat-8.0-doc/config/context.html#Common_Attributes For information about about how context paths relate to WAR file names and application directory names, see: http://tomcat.apache.org/tomcat-8.0-doc/config/context.html#Naming In particular, please note that If the context path is the empty string them the base name will be ROOT (always in upper case) The recommended practice is to create separate context XML files and package them in the application WAR files. However, for simple installations, I've had success with something like: Host name=Host appBase=c:/webapps autoDeploy=false deployOnStartup=true unpackWARs=true Context path= docBase=ROOT / /Host The [Tomcat]/webapps directory may then be deleted (if you don't need the packaged apps or doc) and ROOT.war placed directly in c:/webapps. -Terence Bandoian - To unsubscribe
Re: Host appBase vs Context docBase
Normally,we configure docBase when we want the application to be resided on a separate directory and not inside tomcat. So, when you use docBase I don't think you need to configure host/appbase as well. Appbase folders go under tomcat directory parallel to default appbase webapps. Each appbase is mapped to a particular host so we configure more than one appbases when we want to have applications running under different hosts deployed in the same tomcat. On Jul 5, 2014 7:35 AM, Igal @ getRailo.org i...@getrailo.org wrote: I'm a little confused about the Host appBase attribute. Let's say that my website resides in D:\www\site1 I don't like using {Tomcat}/webapps so I don't want to have it as a base directory for websites. What I've been doing so far is create an empty folder alongside webapps, named empty, and use it as appBase, e.g. Host name=Site1 appBase=empty unpackWARs=false autoDeploy=false !-- this works but what's the deal with appBase? !-- Context path=/ docBase=D:/www/site1 / /Host But it feels like I'm doing something wrong. I expect this to work, but it doesn't: Host name=Site1 appBase=D:/www/site1 unpackWARs=false autoDeploy=false !-- this doesn't work !-- /Host Can anyone explain why the snippet above doesn't work, and if that is the way it should be, then what is the purpose of Host/appBase? TIA -- Igal Sapir Railo Core Developer http://getRailo.org/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Host appBase vs Context docBase
On 7/4/2014 9:04 PM, Igal @ getRailo.org wrote: I'm a little confused about the Host appBase attribute. Let's say that my website resides in D:\www\site1 I don't like using {Tomcat}/webapps so I don't want to have it as a base directory for websites. What I've been doing so far is create an empty folder alongside webapps, named empty, and use it as appBase, e.g. Host name=Site1 appBase=empty unpackWARs=false autoDeploy=false !-- this works but what's the deal with appBase? !-- Context path=/ docBase=D:/www/site1 / /Host But it feels like I'm doing something wrong. I expect this to work, but it doesn't: Host name=Site1 appBase=D:/www/site1 unpackWARs=false autoDeploy=false !-- this doesn't work !-- /Host Can anyone explain why the snippet above doesn't work, and if that is the way it should be, then what is the purpose of Host/appBase? TIA Hi, Igal- What version of Tomcat are you using? Also, it is recommended that Context elements not be placed directly in server.xml. See: http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Defining_a_context That said, you shouldn't need the empty directory. I've used an absolute path for the Host appBase attribute with relative paths for Context docBase attributes in Tomcat 6 and 7 without any problems. I haven't tried it with absolute paths for both appBase and docBase. Lastly, are you sure you want / for the Context path attribute in the first example above? The Context path for the default web application of a Host should be an empty string (). See: http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Common_Attributes -Terence Bandoian - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Host appBase vs Context docBase
Normally,we configure docBase when we want the application to be resided on a separate directory and not inside tomcat that's exactly what I'm trying to do when you use docBase I don't think you need to configure host/appbase as well if I don't use host/appBase then webapps is set as default, and then if a document that exists in webapps is requested, e.g. /index.jsp and it does not exist in my application directory, then it is served from webapps, which is something that I really don't want to happen. sure, I can clear the contents of the webapps folder instead of creating the empty folder, but not sure I want to do that either. On 7/5/2014 3:49 AM, Neeraj Sinha wrote: Normally,we configure docBase when we want the application to be resided on a separate directory and not inside tomcat. So, when you use docBase I don't think you need to configure host/appbase as well. Appbase folders go under tomcat directory parallel to default appbase webapps. Each appbase is mapped to a particular host so we configure more than one appbases when we want to have applications running under different hosts deployed in the same tomcat. On Jul 5, 2014 7:35 AM, Igal @ getRailo.org i...@getrailo.org wrote: I'm a little confused about the Host appBase attribute. Let's say that my website resides in D:\www\site1 I don't like using {Tomcat}/webapps so I don't want to have it as a base directory for websites. What I've been doing so far is create an empty folder alongside webapps, named empty, and use it as appBase, e.g. Host name=Site1 appBase=empty unpackWARs=false autoDeploy=false !-- this works but what's the deal with appBase? !-- Context path=/ docBase=D:/www/site1 / /Host But it feels like I'm doing something wrong. I expect this to work, but it doesn't: Host name=Site1 appBase=D:/www/site1 unpackWARs=false autoDeploy=false !-- this doesn't work !-- /Host Can anyone explain why the snippet above doesn't work, and if that is the way it should be, then what is the purpose of Host/appBase? TIA -- Igal Sapir Railo Core Developer http://getRailo.org/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- Igal Sapir Railo Core Developer http://getRailo.org/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Host appBase vs Context docBase
What version of Tomcat are you using? I've been using Tomcat 6 and 7 for a while, and now running Tomcat 8. it is recommended that Context elements not be placed directly in server.xml I know, but it is much easier for me to edit a single file, server.xml then deploy all the other files. I'm looking to keep the deployment process as simple as possible. you shouldn't need the empty directory. I've used an absolute path for the Host appBase attribute with relative paths for Context docBase attributes in Tomcat 6 and 7 without any problems. when I try that then webapps is used by default. if a request is made for a file that exists in webapps, e.g. index.jsp and does not exist in my application's folder, then it is served from webapps and I don't want that. are you sure you want / for the Context path attribute in the first example above? it was my understanding that and / are the same here. / reads more clearly to me as the root directory so I prefer to use that. *after reading your email and testing it, however, I noticed that if I omit the Host/appBase and use an empty-string for the Context/docBase/path it works as intended, so maybe that's what I was doing wrong? is that the best practice?* Host name=Site1 unpackWARs=false autoDeploy=false Context path= docBase=D:/www/site1 / Context path=/virtualdir docBase=D:/www/shared/virtualdir / /Host ? thank you both for your responses, Igal On 7/5/2014 9:48 AM, Terence M. Bandoian wrote: On 7/4/2014 9:04 PM, Igal @ getRailo.org wrote: I'm a little confused about the Host appBase attribute. Let's say that my website resides in D:\www\site1 I don't like using {Tomcat}/webapps so I don't want to have it as a base directory for websites. What I've been doing so far is create an empty folder alongside webapps, named empty, and use it as appBase, e.g. Host name=Site1 appBase=empty unpackWARs=false autoDeploy=false !-- this works but what's the deal with appBase? !-- Context path=/ docBase=D:/www/site1 / /Host But it feels like I'm doing something wrong. I expect this to work, but it doesn't: Host name=Site1 appBase=D:/www/site1 unpackWARs=false autoDeploy=false !-- this doesn't work !-- /Host Can anyone explain why the snippet above doesn't work, and if that is the way it should be, then what is the purpose of Host/appBase? TIA Hi, Igal- What version of Tomcat are you using? Also, it is recommended that Context elements not be placed directly in server.xml. See: http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Defining_a_context That said, you shouldn't need the empty directory. I've used an absolute path for the Host appBase attribute with relative paths for Context docBase attributes in Tomcat 6 and 7 without any problems. I haven't tried it with absolute paths for both appBase and docBase. Lastly, are you sure you want / for the Context path attribute in the first example above? The Context path for the default web application of a Host should be an empty string (). See: http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Common_Attributes -Terence Bandoian - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- Igal Sapir Railo Core Developer http://getRailo.org/
Host appBase vs Context docBase
I'm a little confused about the Host appBase attribute. Let's say that my website resides in D:\www\site1 I don't like using {Tomcat}/webapps so I don't want to have it as a base directory for websites. What I've been doing so far is create an empty folder alongside webapps, named empty, and use it as appBase, e.g. Host name=Site1 appBase=empty unpackWARs=false autoDeploy=false !-- this works but what's the deal with appBase? !-- Context path=/ docBase=D:/www/site1 / /Host But it feels like I'm doing something wrong. I expect this to work, but it doesn't: Host name=Site1 appBase=D:/www/site1 unpackWARs=false autoDeploy=false !-- this doesn't work !-- /Host Can anyone explain why the snippet above doesn't work, and if that is the way it should be, then what is the purpose of Host/appBase? TIA -- Igal Sapir Railo Core Developer http://getRailo.org/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Deploying a relative docBase outside of appBase
Using the catalina.home variable did the trick, thank you! Peter On 6/26/14, 7:19 PM, Caldarale, Charles R chuck.caldar...@unisys.com wrote: From: Peter Rifel [mailto:pri...@mixpo.com] Subject: Deploying a relative docBase outside of appBase In Tomcat 7 I had a ROOT.xml file in conf/Catalina/hostname/ which contained my Context with a docBase=../../www.war parameter. This was able to reach my www.war directory that lived next to my tomcat directory (one directory above CATALINA_HOME, two above webapps). This doesn't work in Tomcat 8, giving an IAE Try this instead: Context docBase=${catalina.home}/../www.war / There might also be some confusion due to the .war extension on the directory name, but I thought that was fixed a while back. If the docBase is not absolute, we append the appBase with the docBase's getName() which returns just the last name in the pathname's name sequence according the javadocs. Should this be getPath() instead? getPath() would return the full relative path that when combined with the appBase, the canonical path will be the correct path to the application. That does look suspicious. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Deploying a relative docBase outside of appBase
Hello, I am in the process of upgrading from Tomcat 7.0.54 to 8.0.9 and am running into an issue with the location of my exploded war directories. In Tomcat 7 I had a ROOT.xml file in conf/Catalina/hostname/ which contained my Context with a docBase=../../www.war parameter. This was able to reach my www.war directory that lived next to my tomcat directory (one directory above CATALINA_HOME, two above webapps). This doesn't work in Tomcat 8, giving an IAE: SEVERE: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[hostname].StandardContext[]] … Caused by: java.lang.IllegalArgumentException: The main resource set specified [/path/to/tomcat/webapps/www.war] is not valid I stepped through the source code and arrived at o.a.c.webresources.StandardRoot.startInternal(). If the docBase is not absolute, we append the appBase with the docBase's getName() which returns just the last name in the pathname's name sequence according the javadocs. Should this be getPath() instead? getPath() would return the full relative path that when combined with the appBase, the canonical path will be the correct path to the application. Is this a bug or is it intentional and is there a better way I should be configuring my context? I've been testing this in Java 8 but it happens in 7 as well. Here is my current version info if it matters: Server version: Apache Tomcat/8.0.9 Server built: Jun 19 2014 01:54:25 Server number: 8.0.9.0 OS Name:Mac OS X OS Version: 10.9.3 Architecture: x86_64 JVM Version:1.8.0_05-b13 JVM Vendor: Oracle Corporation Thanks in advance, Peter
RE: Deploying a relative docBase outside of appBase
From: Peter Rifel [mailto:pri...@mixpo.com] Subject: Deploying a relative docBase outside of appBase In Tomcat 7 I had a ROOT.xml file in conf/Catalina/hostname/ which contained my Context with a docBase=../../www.war parameter. This was able to reach my www.war directory that lived next to my tomcat directory (one directory above CATALINA_HOME, two above webapps). This doesn't work in Tomcat 8, giving an IAE Try this instead: Context docBase=${catalina.home}/../www.war / There might also be some confusion due to the .war extension on the directory name, but I thought that was fixed a while back. If the docBase is not absolute, we append the appBase with the docBase's getName() which returns just the last name in the pathname's name sequence according the javadocs. Should this be getPath() instead? getPath() would return the full relative path that when combined with the appBase, the canonical path will be the correct path to the application. That does look suspicious. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Embedded Tomcat how to use addContext for docBase
2013/1/30 Jimmy Johnson eclectic.sou...@gmail.com: Ah, Okay, so I should use the addWebapp method to add a path to an external folder? e.g tomcat.addWebapp(/MyWebApp/images, /tmp/images); It should not matter whether it is an external folder or not, as you are not relying on the autodeployment feature. There are many examples of addWebapp calls in the test cases. I would not omit those File.getAbsolutePath() calls. I would beware that /tmp is usually cleaned when a server is rebooted. Is it OK to use such non-unique name as images? On Tue, Jan 29, 2013 at 2:06 PM, Konstantin Kolinko knst.koli...@gmail.comwrote: 2013/1/29 Jimmy Johnson eclectic.sou...@gmail.com: System: Mac OS X 10.8 Tomcat Version: 7.0.30 Language: Java I'm trying to set up the context in an embedded Tomcat instance to serve files from a local directory not within the deployed folder. In the standard server.xml when using the standard Tomcat configuration I have this: Context docBase=/MyWebApp/images path=/tmp/images/ reloadable=false/ and it works great. I have tried different variations on the following tomcat embedded call without success: tomcat.addContext(tomcat.getHost(), /MyWebApp/images, /documents/images/); I also tried: tomcat.addContext(/MyWebApp/images, /documents/images/); It seems that Tomcat does see the external docBase folder I have specified because if I specify a path that doesn't exist it complains. It also see's the context mapping because hitting the /MyWebApp/images filters out the request before it hits the spring security filters I have in place and reports a 404 file not found. I am planning on looking at the source this evening and seeing if I can track down the file path it is looking at, but I thought someone here might know of a solution. It looks like this grails question was along the same lines: http://stackoverflow.com/questions/8332851/grails-add-context-to-embedded-tomcat-in-development But im not using grails. Here is the full startup code I am using: package launch; import java.io.File; import org.apache.catalina.startup.Tomcat; public class Main { public static void main(String[] args) throws Exception { String webappDirLocation = /src/main/webapp/; Tomcat tomcat = new Tomcat(); //The port that we should run on can be set into an environment variable //Look for that variable and default to 8080 if it isn't there. String webPort = System.getenv(PORT); if(webPort == null || webPort.isEmpty()) { webPort = 8080; } tomcat.setPort(Integer.valueOf(webPort)); tomcat.addWebapp(/MyWebApp, new File(webappDirLocation).getAbsolutePath()); tomcat.addContext(/MyWebApp/images, /tmp/images/); The above two lines. You already know the addWebapp method, so why are you trying to use addContext? tomcat.start(); tomcat.getServer().await(); } } - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Embedded Tomcat how to use addContext for docBase
Awesome! Thanks a million Konstantin, it worked. As for using the /tmp folder. /tmp/images is it actually just a place where I give the images a uuid name, process them, and then save them elsewhere immediately I then delete the original so it should be okay. I will also add in the File.getAbsolutePath() call as you suggested and take a look at the tests cases. Thanks again! On Wed, Jan 30, 2013 at 3:08 AM, Konstantin Kolinko knst.koli...@gmail.comwrote: 2013/1/30 Jimmy Johnson eclectic.sou...@gmail.com: Ah, Okay, so I should use the addWebapp method to add a path to an external folder? e.g tomcat.addWebapp(/MyWebApp/images, /tmp/images); It should not matter whether it is an external folder or not, as you are not relying on the autodeployment feature. There are many examples of addWebapp calls in the test cases. I would not omit those File.getAbsolutePath() calls. I would beware that /tmp is usually cleaned when a server is rebooted. Is it OK to use such non-unique name as images? On Tue, Jan 29, 2013 at 2:06 PM, Konstantin Kolinko knst.koli...@gmail.comwrote: 2013/1/29 Jimmy Johnson eclectic.sou...@gmail.com: System: Mac OS X 10.8 Tomcat Version: 7.0.30 Language: Java I'm trying to set up the context in an embedded Tomcat instance to serve files from a local directory not within the deployed folder. In the standard server.xml when using the standard Tomcat configuration I have this: Context docBase=/MyWebApp/images path=/tmp/images/ reloadable=false/ and it works great. I have tried different variations on the following tomcat embedded call without success: tomcat.addContext(tomcat.getHost(), /MyWebApp/images, /documents/images/); I also tried: tomcat.addContext(/MyWebApp/images, /documents/images/); It seems that Tomcat does see the external docBase folder I have specified because if I specify a path that doesn't exist it complains. It also see's the context mapping because hitting the /MyWebApp/images filters out the request before it hits the spring security filters I have in place and reports a 404 file not found. I am planning on looking at the source this evening and seeing if I can track down the file path it is looking at, but I thought someone here might know of a solution. It looks like this grails question was along the same lines: http://stackoverflow.com/questions/8332851/grails-add-context-to-embedded-tomcat-in-development But im not using grails. Here is the full startup code I am using: package launch; import java.io.File; import org.apache.catalina.startup.Tomcat; public class Main { public static void main(String[] args) throws Exception { String webappDirLocation = /src/main/webapp/; Tomcat tomcat = new Tomcat(); //The port that we should run on can be set into an environment variable //Look for that variable and default to 8080 if it isn't there. String webPort = System.getenv(PORT); if(webPort == null || webPort.isEmpty()) { webPort = 8080; } tomcat.setPort(Integer.valueOf(webPort)); tomcat.addWebapp(/MyWebApp, new File(webappDirLocation).getAbsolutePath()); tomcat.addContext(/MyWebApp/images, /tmp/images/); The above two lines. You already know the addWebapp method, so why are you trying to use addContext? tomcat.start(); tomcat.getServer().await(); } } - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Embedded Tomcat how to use addContext for docBase
2013/1/29 Jimmy Johnson eclectic.sou...@gmail.com: System: Mac OS X 10.8 Tomcat Version: 7.0.30 Language: Java I'm trying to set up the context in an embedded Tomcat instance to serve files from a local directory not within the deployed folder. In the standard server.xml when using the standard Tomcat configuration I have this: Context docBase=/MyWebApp/images path=/tmp/images/ reloadable=false/ and it works great. I have tried different variations on the following tomcat embedded call without success: tomcat.addContext(tomcat.getHost(), /MyWebApp/images, /documents/images/); I also tried: tomcat.addContext(/MyWebApp/images, /documents/images/); It seems that Tomcat does see the external docBase folder I have specified because if I specify a path that doesn't exist it complains. It also see's the context mapping because hitting the /MyWebApp/images filters out the request before it hits the spring security filters I have in place and reports a 404 file not found. I am planning on looking at the source this evening and seeing if I can track down the file path it is looking at, but I thought someone here might know of a solution. It looks like this grails question was along the same lines: http://stackoverflow.com/questions/8332851/grails-add-context-to-embedded-tomcat-in-development But im not using grails. Here is the full startup code I am using: package launch; import java.io.File; import org.apache.catalina.startup.Tomcat; public class Main { public static void main(String[] args) throws Exception { String webappDirLocation = /src/main/webapp/; Tomcat tomcat = new Tomcat(); //The port that we should run on can be set into an environment variable //Look for that variable and default to 8080 if it isn't there. String webPort = System.getenv(PORT); if(webPort == null || webPort.isEmpty()) { webPort = 8080; } tomcat.setPort(Integer.valueOf(webPort)); tomcat.addWebapp(/MyWebApp, new File(webappDirLocation).getAbsolutePath()); tomcat.addContext(/MyWebApp/images, /tmp/images/); The above two lines. You already know the addWebapp method, so why are you trying to use addContext? tomcat.start(); tomcat.getServer().await(); } } - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Embedded Tomcat how to use addContext for docBase
Ah, Okay, so I should use the addWebapp method to add a path to an external folder? e.g tomcat.addWebapp(/MyWebApp/images, /tmp/images); Thanks, Jimmy On Tue, Jan 29, 2013 at 2:06 PM, Konstantin Kolinko knst.koli...@gmail.comwrote: 2013/1/29 Jimmy Johnson eclectic.sou...@gmail.com: System: Mac OS X 10.8 Tomcat Version: 7.0.30 Language: Java I'm trying to set up the context in an embedded Tomcat instance to serve files from a local directory not within the deployed folder. In the standard server.xml when using the standard Tomcat configuration I have this: Context docBase=/MyWebApp/images path=/tmp/images/ reloadable=false/ and it works great. I have tried different variations on the following tomcat embedded call without success: tomcat.addContext(tomcat.getHost(), /MyWebApp/images, /documents/images/); I also tried: tomcat.addContext(/MyWebApp/images, /documents/images/); It seems that Tomcat does see the external docBase folder I have specified because if I specify a path that doesn't exist it complains. It also see's the context mapping because hitting the /MyWebApp/images filters out the request before it hits the spring security filters I have in place and reports a 404 file not found. I am planning on looking at the source this evening and seeing if I can track down the file path it is looking at, but I thought someone here might know of a solution. It looks like this grails question was along the same lines: http://stackoverflow.com/questions/8332851/grails-add-context-to-embedded-tomcat-in-development But im not using grails. Here is the full startup code I am using: package launch; import java.io.File; import org.apache.catalina.startup.Tomcat; public class Main { public static void main(String[] args) throws Exception { String webappDirLocation = /src/main/webapp/; Tomcat tomcat = new Tomcat(); //The port that we should run on can be set into an environment variable //Look for that variable and default to 8080 if it isn't there. String webPort = System.getenv(PORT); if(webPort == null || webPort.isEmpty()) { webPort = 8080; } tomcat.setPort(Integer.valueOf(webPort)); tomcat.addWebapp(/MyWebApp, new File(webappDirLocation).getAbsolutePath()); tomcat.addContext(/MyWebApp/images, /tmp/images/); The above two lines. You already know the addWebapp method, so why are you trying to use addContext? tomcat.start(); tomcat.getServer().await(); } } - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: docBase
On 11/01/2013 20:24, Leo Donahue - RDSA IT wrote: Tomcat 7.0.34 Java 1.6.0_35 Can the document base of a context be an administrative share? Yes. But I would not encourage it. 2nd only to NFS for causing random errors. Unless you have a massive number of images totalling large amounts of data, it would be better to arrange a periodic sync job to copy images across to each node. p Ex: \\servername\share$\somedirectoryfile:///\\servername\share$\somedirectory I run tomcat as a service using a local account on webserver1, that same local account has read access to the administrative share (checked the passwords to make sure they were the same), but I'm getting an illegalArgumentException in the logs. The local account has share access and permissions on the \\servername\share$ root directory. SEVERE: Error starting static Resources java.lang.IllegalArgumentException: Document base \\servername\share$\somedirectory does not exist or is not a readable directory at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:138) at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4906) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5086) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657) at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1637) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Leo -- [key:62590808] - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: docBase
-Original Message- From: Pid [mailto:p...@pidster.com] Subject: Re: docBase On 11/01/2013 20:24, Leo Donahue - RDSA IT wrote: Tomcat 7.0.34 Java 1.6.0_35 Can the document base of a context be an administrative share? Yes. But I would not encourage it. 2nd only to NFS for causing random errors. Unless you have a massive number of images totalling large amounts of data, it would be better to arrange a periodic sync job to copy images across to each node. p Thank you sir. What if one suffers from having conservatively configured nodes? The amount of image cache we would want to create would not fit on any of our webservers. Our web servers are virtualized and have only a few GB of storage. Moving off topic: How does google do this: http://mt1.google.com/vt/lyrs=m@20500hl=ensrc=appx=11y=25z=6s=Ga do you think these images are sitting on every node? And what if google wanted to include an option to view aerial photos for each year for the past ten years? That becomes a lot of data that lives on each node? In the example above, when a user requests an image tile from google, you can't tell whether that image lives on the webserver, or whether the webserver fetches that image from a share on another server. I have a lot of room on my NAS, but not on my webservers. When we cache images for just our county, depending on how many scale levels I create and tile size, I can end up with several hundred GB for just a single year of aerial photos. Reading those images on local (webserver) storage vs network storage is what I'm trying to decide. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: docBase
On 16/01/2013 21:17, Leo Donahue - RDSA IT wrote: -Original Message- From: Pid [mailto:p...@pidster.com] Subject: Re: docBase On 11/01/2013 20:24, Leo Donahue - RDSA IT wrote: Tomcat 7.0.34 Java 1.6.0_35 Can the document base of a context be an administrative share? Yes. But I would not encourage it. 2nd only to NFS for causing random errors. Unless you have a massive number of images totalling large amounts of data, it would be better to arrange a periodic sync job to copy images across to each node. p Thank you sir. What if one suffers from having conservatively configured nodes? The amount of image cache we would want to create would not fit on any of our webservers. Our web servers are virtualized and have only a few GB of storage. If it can be publicly accessible, but CDNs are increasingly inexpensive. Moving off topic: How does google do this: http://mt1.google.com/vt/lyrs=m@20500hl=ensrc=appx=11y=25z=6s=Ga do you think these images are sitting on every node? And what if google wanted to include an option to view aerial photos for each year for the past ten years? That becomes a lot of data that lives on each node? No. Custom CDN some clever storage. In the example above, when a user requests an image tile from google, you can't tell whether that image lives on the webserver, or whether the webserver fetches that image from a share on another server. No shares, lots of DNS routing and other nifty stuff. I have a lot of room on my NAS, but not on my webservers. When we cache images for just our county, depending on how many scale levels I create and tile size, I can end up with several hundred GB for just a single year of aerial photos. Reading those images on local (webserver) storage vs network storage is what I'm trying to decide. That's quite a lot. :) How many are in use at any given moment? A caching app that was able to preload adjacent image tiles would work if you wanted to build something. p -- [key:62590808] - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: docBase
-Original Message- From: Leo Donahue - RDSA IT [mailto:leodona...@mail.maricopa.gov] Subject: docBase Tomcat 7.0.34 Java 1.6.0_35 Can the document base of a context be an administrative share? Ex: \\servername\share$\somedirectoryfile:///\\servername\share$\somedire ctory I run tomcat as a service using a local account on webserver1, that same local account has read access to the administrative share (checked the passwords to make sure they were the same), but I'm getting an illegalArgumentException in the logs. The local account has share access and permissions on the \\servername\share$ root directory. Leo Never mind. It always takes a post to find the error right after I hit send. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: docBase
On 1/11/2013 3:24 PM, Leo Donahue - RDSA IT wrote: Tomcat 7.0.34 Java 1.6.0_35 Can the document base of a context be an administrative share? Ex: \\servername\share$\somedirectoryfile:///\\servername\share$\somedirectory I run tomcat as a service using a local account on webserver1, that same local account has read access to the administrative share (checked the passwords to make sure they were the same), but I'm getting an illegalArgumentException in the logs. The local account has share access and permissions on the \\servername\share$ root directory. I assume you mean a user that you have set up, and not the local system account? I believe (not sure) that to access the administrative share, the user has to have admin privileges on the machine hosting the share you want to access. SEVERE: Error starting static Resources java.lang.IllegalArgumentException: Document base \\servername\share$\somedirectory does not exist or is not a readable directory at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:138) at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4906) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5086) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:657) at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1637) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Leo - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: docBase
On 1/11/2013 3:28 PM, Leo Donahue - RDSA IT wrote: -Original Message- From: Leo Donahue - RDSA IT [mailto:leodona...@mail.maricopa.gov] Subject: docBase Tomcat 7.0.34 Java 1.6.0_35 Can the document base of a context be an administrative share? Ex: \\servername\share$\somedirectoryfile:///\\servername\share$\somedire ctory I run tomcat as a service using a local account on webserver1, that same local account has read access to the administrative share (checked the passwords to make sure they were the same), but I'm getting an illegalArgumentException in the logs. The local account has share access and permissions on the \\servername\share$ root directory. Leo Never mind. It always takes a post to find the error right after I hit send. Care to share your findings? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: docBase
-Original Message- From: David kerber [mailto:dcker...@verizon.net] Subject: Re: docBase On 1/11/2013 3:28 PM, Leo Donahue - RDSA IT wrote: -Original Message- From: Leo Donahue - RDSA IT [mailto:leodona...@mail.maricopa.gov] Subject: docBase Tomcat 7.0.34 Java 1.6.0_35 Can the document base of a context be an administrative share? Ex: \\servername\share$\somedirectoryfile:///\\servername\share$\somedir e ctory I run tomcat as a service using a local account on webserver1, that same local account has read access to the administrative share (checked the passwords to make sure they were the same), but I'm getting an illegalArgumentException in the logs. The local account has share access and permissions on the \\servername\share$ root directory. Leo Never mind. It always takes a post to find the error right after I hit send. Care to share your findings? I take it all back. The typo in my context file I thought was the problem, was not it. In Tomcat 7.0.34 I had a context file in conf/Catalina/localhost called output.xml The docBase attribute was: docBase=\\servername\share$\gisoutput The purpose was to create a virtual output directory on Tomcat to read images from the network share. Something like http://servername/output/someimage.png Tomcat 7.0.34 was installed as a service using the service.bat, and the service was running under a local account on the webserver, not a local system account, one I created. The docBase was pointing to an administrative share on another storage server. I created the same local account on that storage server, and gave share and security permissions to that share. Then I started Tomcat 7.0.34 and got that exception in the log file. For the heck of it, I removed the 7.0.34 service and installed 7.0.32. The exact same setup is working in 7.0.32 Is the $ causing an issue? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [Tomcat 7] Why can't you use automatic deployment and exploded WAR when docBase is outside appBase?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Miguel, On 8/6/12 3:26 PM, Miguel Almeida wrote: Consider the following context file jamesbond.xml in $CATALINA_BASE/conf/[engine_name]/[host_name]): Context docBase=/srv/apps/jamesbond.war unpackWAR=true debug=0 privileged=true Environment name=my.env value=VAL type=java.lang.String override=true/ /Context *1)* In Tomcat 6 you'd update the war at /srv/apps and it would automatically be redeployed and exploded. However, in Tomcat 7 this isn't happening. From the docs (http://tomcat.apache.org/tomcat-7.0-doc/config/host.html), a new important text that wasn't in 6 reads: unpackWARs - (...) WAR files located outside of the Host's *appBase* will not be expanded. And in http://tomcat.apache.org/tomcat-7.0-doc/config/host.html#Automatic%20Application%20Deployment: - - When using automatic deployment, the docBase defined by an XML Contexthttp://tomcat.apache.org/tomcat-7.0-doc/config/context.htmlfile should be outside of the appBase directory. If this is not the case, difficulties may be experienced deploying the web application or the application may be deployed twice. The deployIgnore attribute can be used to avoid this situation. Both these rules means you can't have automatic deployment of files outside appBase and explode them (into appBase). Do you mean automatic deployment or automatic redeployment? If you want to update a WAR file that is outside of the appBase, then update the WAR file and then 'touch' the XML file in $CATALINA_BASE/conf/[engine_name]/[host_name]/jamesbond.xml. Why is this? How can one have the same behaviour as in Tomcat 6: have the war* outisde appBase*, use a context xml like the one above and have the application exploded. Do you really care about the WAR file being exploded? If this is really a complaint about your question #2 (handled by others separately within this thread), then you should be using the temp dirs instead of getRealPath and you won't have to worry about the lack of WAR-explosion anymore. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAlAhRK0ACgkQ9CaO5/Lv0PBElgCff5o8N1rNnTKAZ1HHRKxBqKTU t+oAmwWEcvU1uDLWX6zkYNT+QnhLSqxk =Z6qA -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
[Tomcat 7] Why can't you use automatic deployment and exploded WAR when docBase is outside appBase?
Dear all, I am going to divide my question in 2. The first part concerns a change in Tomcat7's behaviour (vs Tomcat6) that I would like to understand. The 2nd question is what lead me to the question, and it's a practical Java issue - where help is also appreciated. Onwards to the questions. Consider the following context file jamesbond.xml in $CATALINA_BASE/conf/[engine_name]/[host_name]): Context docBase=/srv/apps/jamesbond.war unpackWAR=true debug=0 privileged=true Environment name=my.env value=VAL type=java.lang.String override=true/ /Context *1)* In Tomcat 6 you'd update the war at /srv/apps and it would automatically be redeployed and exploded. However, in Tomcat 7 this isn't happening. From the docs (http://tomcat.apache.org/tomcat-7.0-doc/config/host.html), a new important text that wasn't in 6 reads: unpackWARs - (...) WAR files located outside of the Host's *appBase* will not be expanded. And in http://tomcat.apache.org/tomcat-7.0-doc/config/host.html#Automatic%20Application%20Deployment: - When using automatic deployment, the docBase defined by an XML Contexthttp://tomcat.apache.org/tomcat-7.0-doc/config/context.htmlfile should be outside of the appBase directory. If this is not the case, difficulties may be experienced deploying the web application or the application may be deployed twice. The deployIgnore attribute can be used to avoid this situation. Both these rules means you can't have automatic deployment of files outside appBase and explode them (into appBase). Why is this? How can one have the same behaviour as in Tomcat 6: have the war* outisde appBase*, use a context xml like the one above and have the application exploded. *2) *The motivation for this is a simple code ServletContext.getRealPath(/) to create a simple temporary inputstream that works in Tomcat6 but doesn't in Tomcat7 (because getRealPath(/) will return null). Setting up a dedicated directory seems a bit of a hassle for a temporary inputstream. Cheers, Miguel Almeida
RE: [Tomcat 7] Why can't you use automatic deployment and exploded WAR when docBase is outside appBase?
From: Miguel Almeida [mailto:migueldealme...@gmail.com] Subject: [Tomcat 7] Why can't you use automatic deployment and exploded WAR when docBase is outside appBase? The motivation for this is a simple code ServletContext.getRealPath(/) to create a simple temporary inputstream that works in Tomcat6 but doesn't in Tomcat7 (because getRealPath(/) will return null). And, if you check the servlet spec, getRealPath() is *never* guaranteed to work. Your code should be using either getResourceAsStream() or looking at the javax.servlet.context.tempdir context attribute to find where it can create temporary files. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [Tomcat 7] Why can't you use automatic deployment and exploded WAR when docBase is outside appBase?
On 8/6/2012 12:40 PM, Caldarale, Charles R wrote: From: Miguel Almeida [mailto:migueldealme...@gmail.com] Subject: [Tomcat 7] Why can't you use automatic deployment and exploded WAR when docBase is outside appBase? The motivation for this is a simple code ServletContext.getRealPath(/) to create a simple temporary inputstream that works in Tomcat6 but doesn't in Tomcat7 (because getRealPath(/) will return null). And, if you check the servlet spec, getRealPath() is *never* guaranteed to work. Your code should be using either getResourceAsStream() or looking at the javax.servlet.context.tempdir context attribute to find where it can create temporary files. - Chuck +1 I just spent the better part of a week ferreting out exactly this mess. The original application would read from and write to files inside the web application. Even worse, the original application hard-coded the path in a set of variables set at web application load time. This meant that every time the server was changed, the application moved, or the application name changed, the war file had to be unpacked, these values changed, and then the war file had to be repacked. Use getResourceAsStream() for things you need to read. Put those items in WEB-INF/classes or in a jar in WEB-INF/lib. If you need to write temporary files, use java.io.tmpdir, file.separator, and possibly createTempFile(). Tomcat (catalina.sh) sets java.io.tmpdir to $CATALINA_BASE/temp for your convenience by default. . . . just my (somewhat frustrated) 2 cents. /mde/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [Tomcat 7] Why can't you use automatic deployment and exploded WAR when docBase is outside appBase?
Thanks for the input regarding 2). What's the difference between using javax.servlet.context.tempdir vs java.io.tmpdir ? Also, do you know the answer to 1 - ie, why did the change occur regarding not exploding when the WAR is outside appBase? On Mon, Aug 6, 2012 at 9:32 PM, Mark Eggers its_toas...@yahoo.com wrote: On 8/6/2012 12:40 PM, Caldarale, Charles R wrote: From: Miguel Almeida [mailto:migueldealmeida@gmail.**commigueldealme...@gmail.com ] Subject: [Tomcat 7] Why can't you use automatic deployment and exploded WAR when docBase is outside appBase? The motivation for this is a simple code ServletContext.getRealPath(/* *) to create a simple temporary inputstream that works in Tomcat6 but doesn't in Tomcat7 (because getRealPath(/) will return null). And, if you check the servlet spec, getRealPath() is *never* guaranteed to work. Your code should be using either getResourceAsStream() or looking at the javax.servlet.context.tempdir context attribute to find where it can create temporary files. - Chuck +1 I just spent the better part of a week ferreting out exactly this mess. The original application would read from and write to files inside the web application. Even worse, the original application hard-coded the path in a set of variables set at web application load time. This meant that every time the server was changed, the application moved, or the application name changed, the war file had to be unpacked, these values changed, and then the war file had to be repacked. Use getResourceAsStream() for things you need to read. Put those items in WEB-INF/classes or in a jar in WEB-INF/lib. If you need to write temporary files, use java.io.tmpdir, file.separator, and possibly createTempFile(). Tomcat (catalina.sh) sets java.io.tmpdir to $CATALINA_BASE/temp for your convenience by default. . . . just my (somewhat frustrated) 2 cents. /mde/ --**--**- To unsubscribe, e-mail: users-unsubscribe@tomcat.**apache.orgusers-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [Tomcat 7] Why can't you use automatic deployment and exploded WAR when docBase is outside appBase?
On 8/6/2012 1:43 PM, Miguel Almeida wrote: Thanks for the input regarding 2). What's the difference between using javax.servlet.context.tempdir vs java.io.tmpdir ? Also, do you know the answer to 1 - ie, why did the change occur regarding not exploding when the WAR is outside appBase? Please don't top post. I just switched to using a real mail client and I now know why others lament so much about this. Anyway, from the fine documentation at: http://tomcat.apache.org/tomcat-7.0-doc/config/context.html workDir Pathname to a scratch directory to be provided by this Context for temporary read-write use by servlets within the associated web application. This directory will be made visible to servlets in the web application by a servlet context attribute (of type java.io.File) named javax.servlet.context.tempdir as described in the Servlet Specification. If not specified, a suitable directory underneath $CATALINA_BASE/work will be provided. So in short, read the Servlet Specification. (This is also of type File, while the property is of type String.) I suspect that if you use javax.servlet.context.tempdir, the scratch space will be under CATALINA_BASE/work/[Engine]/[host]/[app]. [Engine] is by default Catalina [host] is by default localhost [app] is your web application context name This is different than java.io.tmpdir, which is set to CATALINA_BASE/temp. One of the nice things about using javax.servlet.context.tempdir is that it's deleted when you undeploy your application. Another nice thing about javax.servlet.context.tempdir is that you get a location per web application, not a location per Tomcat. This means that various contexts can't step on each other. One of the not so nice things about javax.servlet.context.tempdir is that it normally doesn't exist outside of a servlet container or web application server. This means that if you do unit testing, you'll have to define that property when you run tests with -Djavax.servlet.context.tempdir=somewhere-i-can-write and open this as a file (see above for comments about type). For your answer to question 1, I guess you'll have to read any discussion on the development mailing list. Searchable archives are available online. I'm just a user, and while I casually read the development list I don't currently don't participate. . . . just my 2 cents. /mde/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Access dbf files outside context/docbase - fixed
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David, On 12/19/11 8:28 PM, David Kerber wrote: Just to close out this thread, it's now fixed. I found a native Java dBase (.dbf) file driver, and it works great in both 32- and 64-bit environments, without having to mess with ODBC or the screwy Microsoft database file drivers. Cool. Plus, now you can move to *NIX since you aren't dependent upon ODBC. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk7wz3cACgkQ9CaO5/Lv0PAwWQCfQ4t94Fb78T5hIERfge0H/RZP WlwAnj2lTorjjbS7k3SRVfaKUyiPmgNV =bdrl -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Access dbf files outside context/docbase - fixed
On 12/20/2011 1:09 PM, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David, On 12/19/11 8:28 PM, David Kerber wrote: Just to close out this thread, it's now fixed. I found a native Java dBase (.dbf) file driver, and it works great in both 32- and 64-bit environments, without having to mess with ODBC or the screwy Microsoft database file drivers. Cool. Plus, now you can move to *NIX since you aren't dependent upon ODBC. - -chris That thought has crossed my mind more than once! D - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Access dbf files outside context/docbase - fixed
Just to close out this thread, it's now fixed. I found a native Java dBase (.dbf) file driver, and it works great in both 32- and 64-bit environments, without having to mess with ODBC or the screwy Microsoft database file drivers. D On 12/16/2011 10:09 PM, David Kerber wrote: On 12/16/2011 5:54 PM, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David, Thanks for posting back. On 12/16/11 2:50 PM, David kerber wrote: Figured out the cause, though I don't have it fixed yet: I'm running under a 64-bit JRE, and there is no 64-bit dBAse driver installed, just 32-bit. So I have to either find a 64-bit dbase ODBC driver (Hah!), or switch to a 32-bit TC and JRE. Unless you need a huge heap, running a 32-bit process might be a better idea, anyway. You can probably improve performance a bit, too. Another good idea is probably to upgrade from Access (or are you really using dBase?) to Microsoft SQL Server (or any actual RDBMS for that matter). :) Yes, using real .dbf files. They're much more reliable than Access .mdbs are, IME. We're actually using them in parallel with a real SQL backend, for different purposes. It's kind of an awkward architecture the way it's being used in this particular case, but it worked great when it was first implemented, and still does for 98% of our needs. This is the first time we've had to mix the two. The real answer, as I did a bit more digging, is to switch to a java native dbase driver, rather than going through MS's ODBC kludge. Since my app is fairly well modularized, that shouldn't be too tough (famous last words) To answer various other issues and possibilities that had been mentioned: I verfied that the driver works fine on my dev machine with UNC names, and I changed the user under which the TC is running to the domain administrator, and that didn't help. I believe Sun's Java started supporting UNC path names somewhere around the late 1.5 or initial 1.6 releases, so it might not have anything to do with the driver itself. Ok, thanks for that tidbit; I didn't realize they came to the UNC table that late in the game. D - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Access dbf files outside context/docbase
David Kerber wrote: On 12/15/2011 4:47 PM, Pid wrote: On 15/12/2011 20:56, David kerber wrote: I am trying to figure out how to access .dbf files that are on a networked drive from my TC 5.5.xx server. I have no trouble with the coding; it all works fine from my Eclipse dev environment. I believe the issue is tomcat's contexts on the production server. I've seen plenty of suggestions for just reading and streaming files from outside the docbase, but nothing for accessing them for database purposes. I'm using the Microsoft DBF driver. As I said above, it all works fine in my dev environment through Eclipse, connection to the dbf files in their real home on the network. However, when I try to do it from my production server, I get the following log entries: 2011-12-15 14:47:53: debugValue = 32: In WraDbfJdbc: Connect params: urlPrefix=jdbc:odbc:DRIVER={Microsoft dBase Driver (*.dbf)};DBQ=, databaseName = //172.17.47.9/dbase/customer/delta Thu Dec 15 14:47:53 EST 2011: Exception in class: com.wra.websira.WraDbfJdbc, Msg: 'Creating database: //172.17.47.9/dbase/customer/delta', Exception: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified I belive that means it can't get to the UNC name listed as the database. Any hints? I've been googling and reading for a couple of hours now, and haven't come up with anything. Obvious first question: file permissions? p Wide open. And from previous experience, permissions and file-in-use errors give different text in the message. Are you sure that the driver understands UNC path notation ? What if you map that path to a device letter on the local system, and try to connect using that local path ? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Access dbf files outside context/docbase
André Warnier wrote: David Kerber wrote: On 12/15/2011 4:47 PM, Pid wrote: On 15/12/2011 20:56, David kerber wrote: I am trying to figure out how to access .dbf files that are on a networked drive from my TC 5.5.xx server. I have no trouble with the coding; it all works fine from my Eclipse dev environment. I believe the issue is tomcat's contexts on the production server. I've seen plenty of suggestions for just reading and streaming files from outside the docbase, but nothing for accessing them for database purposes. I'm using the Microsoft DBF driver. As I said above, it all works fine in my dev environment through Eclipse, connection to the dbf files in their real home on the network. However, when I try to do it from my production server, I get the following log entries: 2011-12-15 14:47:53: debugValue = 32: In WraDbfJdbc: Connect params: urlPrefix=jdbc:odbc:DRIVER={Microsoft dBase Driver (*.dbf)};DBQ=, databaseName = //172.17.47.9/dbase/customer/delta Thu Dec 15 14:47:53 EST 2011: Exception in class: com.wra.websira.WraDbfJdbc, Msg: 'Creating database: //172.17.47.9/dbase/customer/delta', Exception: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified I belive that means it can't get to the UNC name listed as the database. Any hints? I've been googling and reading for a couple of hours now, and haven't come up with anything. Obvious first question: file permissions? p Wide open. And from previous experience, permissions and file-in-use errors give different text in the message. Are you sure that the driver understands UNC path notation ? What if you map that path to a device letter on the local system, and try to connect using that local path ? Addendum : but if your are indeed running Tomcat as a Service, then the previous explanation from Mark Eggers is more likely to be the problem. (and my suggestion won't help, because it's still a network drive, and the LocalSystem account does not have access to Windows network resources (like network drives and printers e.g.)). You should try starting Tomcat under your own user-id, in a command window, using the startup.bat script, and then see if it can connect. If it can then, then your problem is the LocalSystem account. If it still can't, then it may be the UNC path notation. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Access dbf files outside context/docbase
On 12/16/2011 6:03 AM, André Warnier wrote: André Warnier wrote: David Kerber wrote: On 12/15/2011 4:47 PM, Pid wrote: On 15/12/2011 20:56, David kerber wrote: I am trying to figure out how to access .dbf files that are on a networked drive from my TC 5.5.xx server. I have no trouble with the coding; it all works fine from my Eclipse dev environment. I believe the issue is tomcat's contexts on the production server. I've seen plenty of suggestions for just reading and streaming files from outside the docbase, but nothing for accessing them for database purposes. I'm using the Microsoft DBF driver. ... Are you sure that the driver understands UNC path notation ? What if you map that path to a device letter on the local system, and try to connect using that local path ? Addendum : but if your are indeed running Tomcat as a Service, then the previous explanation from Mark Eggers is more likely to be the problem. (and my suggestion won't help, because it's still a network drive, and the LocalSystem account does not have access to Windows network resources (like network drives and printers e.g.)). I already knew that, and should have mentioned it in my original post (sorry for the lack of details). I'm running TC as a service on Windows server 2008, as a user that does have permissions for the network and the drive where the db is located, not as Local system. You should try starting Tomcat under your own user-id, in a command window, using the startup.bat script, and then see if it can connect. If it can then, then your problem is the LocalSystem account. If it still can't, then it may be the UNC path notation. Hmm, good idea; I hadn't thought that it just may not like UNC notation. I hope that's not the problem, because if I have to have a drive letter, then I think I'll have to have the user actually logged onto the server. D - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Access dbf files outside context/docbase
David kerber wrote: On 12/16/2011 6:03 AM, André Warnier wrote: André Warnier wrote: David Kerber wrote: On 12/15/2011 4:47 PM, Pid wrote: On 15/12/2011 20:56, David kerber wrote: I am trying to figure out how to access .dbf files that are on a networked drive from my TC 5.5.xx server. I have no trouble with the coding; it all works fine from my Eclipse dev environment. I believe the issue is tomcat's contexts on the production server. I've seen plenty of suggestions for just reading and streaming files from outside the docbase, but nothing for accessing them for database purposes. I'm using the Microsoft DBF driver. ... Are you sure that the driver understands UNC path notation ? What if you map that path to a device letter on the local system, and try to connect using that local path ? Addendum : but if your are indeed running Tomcat as a Service, then the previous explanation from Mark Eggers is more likely to be the problem. (and my suggestion won't help, because it's still a network drive, and the LocalSystem account does not have access to Windows network resources (like network drives and printers e.g.)). I already knew that, and should have mentioned it in my original post (sorry for the lack of details). I'm running TC as a service on Windows server 2008, as a user that does have permissions for the network and the drive where the db is located, not as Local system. You should try starting Tomcat under your own user-id, in a command window, using the startup.bat script, and then see if it can connect. If it can then, then your problem is the LocalSystem account. If it still can't, then it may be the UNC path notation. Hmm, good idea; I hadn't thought that it just may not like UNC notation. I hope that's not the problem, because if I have to have a drive letter, then I think I'll have to have the user actually logged onto the server. Not necessarily. I have software (in perl, not in Java) which runs as a Windows Service and needs to access network directories. In that software, I execute the O.S. command net use \\server\\share {[password] /USER:\domain\userid} In perl, that's $status = system($command). In Java, I don't know (and I don't know how you would persuade Tomcat to do that before opening your db connection either). What I have noticed sometimes, is that the net use is succesful (as per its exit code), but then the first access to that drive doesn't succeed, but the second and after do. So I also do a dummy dir or something, ignoring the result, right after the net use. I know it's a terrible hack, and I'm just mentioning it here in case that would hit you too, so that you may know to not necessarily give up if it doesn't work right away. There may be more elegant ways to do this under Java, such as Samba's jcifs library. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Access dbf files outside context/docbase
On 12/16/2011 8:54 AM, André Warnier wrote: David kerber wrote: On 12/16/2011 6:03 AM, André Warnier wrote: André Warnier wrote: David Kerber wrote: On 12/15/2011 4:47 PM, Pid wrote: On 15/12/2011 20:56, David kerber wrote: I am trying to figure out how to access .dbf files that are on a networked drive from my TC 5.5.xx server. I have no trouble with the coding; it all works fine from my Eclipse dev environment. I believe the issue is tomcat's contexts on the production server. I've seen plenty of suggestions for just reading and streaming files from outside the docbase, but nothing for accessing them for database purposes. I'm using the Microsoft DBF driver. ... Are you sure that the driver understands UNC path notation ? What if you map that path to a device letter on the local system, and try to connect using that local path ? Addendum : but if your are indeed running Tomcat as a Service, then the previous explanation from Mark Eggers is more likely to be the problem. (and my suggestion won't help, because it's still a network drive, and the LocalSystem account does not have access to Windows network resources (like network drives and printers e.g.)). I already knew that, and should have mentioned it in my original post (sorry for the lack of details). I'm running TC as a service on Windows server 2008, as a user that does have permissions for the network and the drive where the db is located, not as Local system. You should try starting Tomcat under your own user-id, in a command window, using the startup.bat script, and then see if it can connect. If it can then, then your problem is the LocalSystem account. If it still can't, then it may be the UNC path notation. Hmm, good idea; I hadn't thought that it just may not like UNC notation. I hope that's not the problem, because if I have to have a drive letter, then I think I'll have to have the user actually logged onto the server. Not necessarily. I have software (in perl, not in Java) which runs as a Windows Service and needs to access network directories. In that software, I execute the O.S. command net use \\server\\share {[password] /USER:\domain\userid} In perl, that's $status = system($command). In Java, I don't know (and I don't know how you would persuade Tomcat to do that before opening your db connection either). I do all the db connection handling explicitly in my code, rather than letting TC handle it, so that's not an issue. *If* the capability exists to do it in java, I can easily execute it before making the db connection. What I have noticed sometimes, is that the net use is succesful (as per its exit code), but then the first access to that drive doesn't succeed, but the second and after do. So I also do a dummy dir or something, ignoring the result, right after the net use. I know it's a terrible hack, and I'm just mentioning it here in case that would hit you too, so that you may know to not necessarily give up if it doesn't work right away. There may be more elegant ways to do this under Java, such as Samba's jcifs library. Thanks for the suggestions. Another hack I'm considering is copying the dbf to a local drive, or even inside my context path, and accessing it from there. I've got lots of playing to do... D - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Access dbf files outside context/docbase
On 12/15/2011 3:56 PM, David kerber wrote: I am trying to figure out how to access .dbf files that are on a networked drive from my TC 5.5.xx server. I have no trouble with the coding; it all works fine from my Eclipse dev environment. I believe the issue is tomcat's contexts on the production server. I've seen plenty of suggestions for just reading and streaming files from outside the docbase, but nothing for accessing them for database purposes. I'm using the Microsoft DBF driver. As I said above, it all works fine in my dev environment through Eclipse, connection to the dbf files in their real home on the network. However, when I try to do it from my production server, I get the following log entries: 2011-12-15 14:47:53: debugValue = 32: In WraDbfJdbc: Connect params: urlPrefix=jdbc:odbc:DRIVER={Microsoft dBase Driver (*.dbf)};DBQ=, databaseName = //172.17.47.9/dbase/customer/delta Thu Dec 15 14:47:53 EST 2011: Exception in class: com.wra.websira.WraDbfJdbc, Msg: 'Creating database: //172.17.47.9/dbase/customer/delta', Exception: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified I belive that means it can't get to the UNC name listed as the database. Any hints? I've been googling and reading for a couple of hours now, and haven't come up with anything. D FIgured out the cause, though I don't have it fixed yet: I'm running under a 64-bit JRE, and there is no 64-bit dBAse driver installed, just 32-bit. So I have to either find a 64-bit dbase ODBC driver (Hah!), or switch to a 32-bit TC and JRE. To answer various other issues and possibilities that had been mentioned: I verfied that the driver works fine on my dev machine with UNC names, and I changed the user under which the TC is running to the domain administrator, and that didn't help. D - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Access dbf files outside context/docbase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David, Thanks for posting back. On 12/16/11 2:50 PM, David kerber wrote: Figured out the cause, though I don't have it fixed yet: I'm running under a 64-bit JRE, and there is no 64-bit dBAse driver installed, just 32-bit. So I have to either find a 64-bit dbase ODBC driver (Hah!), or switch to a 32-bit TC and JRE. Unless you need a huge heap, running a 32-bit process might be a better idea, anyway. You can probably improve performance a bit, too. Another good idea is probably to upgrade from Access (or are you really using dBase?) to Microsoft SQL Server (or any actual RDBMS for that matter). :) To answer various other issues and possibilities that had been mentioned: I verfied that the driver works fine on my dev machine with UNC names, and I changed the user under which the TC is running to the domain administrator, and that didn't help. I believe Sun's Java started supporting UNC path names somewhere around the late 1.5 or initial 1.6 releases, so it might not have anything to do with the driver itself. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk7rzCEACgkQ9CaO5/Lv0PD5UACfUMMdYdQ4ve6ywhSmosgJNiDa +EsAoK0JpO/eovFKmRu41ZDCngTr/5IA =U4Z/ -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Access dbf files outside context/docbase
On 12/16/2011 5:54 PM, Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David, Thanks for posting back. On 12/16/11 2:50 PM, David kerber wrote: Figured out the cause, though I don't have it fixed yet: I'm running under a 64-bit JRE, and there is no 64-bit dBAse driver installed, just 32-bit. So I have to either find a 64-bit dbase ODBC driver (Hah!), or switch to a 32-bit TC and JRE. Unless you need a huge heap, running a 32-bit process might be a better idea, anyway. You can probably improve performance a bit, too. Another good idea is probably to upgrade from Access (or are you really using dBase?) to Microsoft SQL Server (or any actual RDBMS for that matter). :) Yes, using real .dbf files. They're much more reliable than Access .mdbs are, IME. We're actually using them in parallel with a real SQL backend, for different purposes. It's kind of an awkward architecture the way it's being used in this particular case, but it worked great when it was first implemented, and still does for 98% of our needs. This is the first time we've had to mix the two. The real answer, as I did a bit more digging, is to switch to a java native dbase driver, rather than going through MS's ODBC kludge. Since my app is fairly well modularized, that shouldn't be too tough (famous last words) To answer various other issues and possibilities that had been mentioned: I verfied that the driver works fine on my dev machine with UNC names, and I changed the user under which the TC is running to the domain administrator, and that didn't help. I believe Sun's Java started supporting UNC path names somewhere around the late 1.5 or initial 1.6 releases, so it might not have anything to do with the driver itself. Ok, thanks for that tidbit; I didn't realize they came to the UNC table that late in the game. D - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Access dbf files outside context/docbase
I am trying to figure out how to access .dbf files that are on a networked drive from my TC 5.5.xx server. I have no trouble with the coding; it all works fine from my Eclipse dev environment. I believe the issue is tomcat's contexts on the production server. I've seen plenty of suggestions for just reading and streaming files from outside the docbase, but nothing for accessing them for database purposes. I'm using the Microsoft DBF driver. As I said above, it all works fine in my dev environment through Eclipse, connection to the dbf files in their real home on the network. However, when I try to do it from my production server, I get the following log entries: 2011-12-15 14:47:53: debugValue = 32: In WraDbfJdbc: Connect params: urlPrefix=jdbc:odbc:DRIVER={Microsoft dBase Driver (*.dbf)};DBQ=, databaseName = //172.17.47.9/dbase/customer/delta Thu Dec 15 14:47:53 EST 2011: Exception in class: com.wra.websira.WraDbfJdbc, Msg: 'Creating database: //172.17.47.9/dbase/customer/delta', Exception: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified I belive that means it can't get to the UNC name listed as the database. Any hints? I've been googling and reading for a couple of hours now, and haven't come up with anything. D - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Access dbf files outside context/docbase
On 15/12/2011 20:56, David kerber wrote: I am trying to figure out how to access .dbf files that are on a networked drive from my TC 5.5.xx server. I have no trouble with the coding; it all works fine from my Eclipse dev environment. I believe the issue is tomcat's contexts on the production server. I've seen plenty of suggestions for just reading and streaming files from outside the docbase, but nothing for accessing them for database purposes. I'm using the Microsoft DBF driver. As I said above, it all works fine in my dev environment through Eclipse, connection to the dbf files in their real home on the network. However, when I try to do it from my production server, I get the following log entries: 2011-12-15 14:47:53: debugValue = 32: In WraDbfJdbc: Connect params: urlPrefix=jdbc:odbc:DRIVER={Microsoft dBase Driver (*.dbf)};DBQ=, databaseName = //172.17.47.9/dbase/customer/delta Thu Dec 15 14:47:53 EST 2011: Exception in class: com.wra.websira.WraDbfJdbc, Msg: 'Creating database: //172.17.47.9/dbase/customer/delta', Exception: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified I belive that means it can't get to the UNC name listed as the database. Any hints? I've been googling and reading for a couple of hours now, and haven't come up with anything. Obvious first question: file permissions? p -- [key:62590808] signature.asc Description: OpenPGP digital signature
Re: Access dbf files outside context/docbase
On 12/15/2011 4:47 PM, Pid wrote: On 15/12/2011 20:56, David kerber wrote: I am trying to figure out how to access .dbf files that are on a networked drive from my TC 5.5.xx server. I have no trouble with the coding; it all works fine from my Eclipse dev environment. I believe the issue is tomcat's contexts on the production server. I've seen plenty of suggestions for just reading and streaming files from outside the docbase, but nothing for accessing them for database purposes. I'm using the Microsoft DBF driver. As I said above, it all works fine in my dev environment through Eclipse, connection to the dbf files in their real home on the network. However, when I try to do it from my production server, I get the following log entries: 2011-12-15 14:47:53: debugValue = 32: In WraDbfJdbc: Connect params: urlPrefix=jdbc:odbc:DRIVER={Microsoft dBase Driver (*.dbf)};DBQ=, databaseName = //172.17.47.9/dbase/customer/delta Thu Dec 15 14:47:53 EST 2011: Exception in class: com.wra.websira.WraDbfJdbc, Msg: 'Creating database: //172.17.47.9/dbase/customer/delta', Exception: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified I belive that means it can't get to the UNC name listed as the database. Any hints? I've been googling and reading for a couple of hours now, and haven't come up with anything. Obvious first question: file permissions? p Wide open. And from previous experience, permissions and file-in-use errors give different text in the message. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Access dbf files outside context/docbase
- Original Message - From: Pid p...@pidster.com To: Tomcat Users List users@tomcat.apache.org Cc: Sent: Thursday, December 15, 2011 1:47 PM Subject: Re: Access dbf files outside context/docbase On 15/12/2011 20:56, David kerber wrote: I am trying to figure out how to access .dbf files that are on a networked drive from my TC 5.5.xx server. I have no trouble with the coding; it all works fine from my Eclipse dev environment. I believe the issue is tomcat's contexts on the production server. I've seen plenty of suggestions for just reading and streaming files from outside the docbase, but nothing for accessing them for database purposes. I'm using the Microsoft DBF driver. As I said above, it all works fine in my dev environment through Eclipse, connection to the dbf files in their real home on the network. However, when I try to do it from my production server, I get the following log entries: 2011-12-15 14:47:53: debugValue = 32: In WraDbfJdbc: Connect params: urlPrefix=jdbc:odbc:DRIVER={Microsoft dBase Driver (*.dbf)};DBQ=, databaseName = //172.17.47.9/dbase/customer/delta Thu Dec 15 14:47:53 EST 2011: Exception in class: com.wra.websira.WraDbfJdbc, Msg: 'Creating database: //172.17.47.9/dbase/customer/delta', Exception: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified I belive that means it can't get to the UNC name listed as the database. Any hints? I've been googling and reading for a couple of hours now, and haven't come up with anything. Obvious first question: file permissions? p I'm going to expand on Pid's question and make some assumptions. if you're running this on a Windows server (assumption 1) as a service (assumption 2), using the Service account (assumption 3), you will not have access to UNC paths or network drives. There are several games you can play here. 1. Run the service under an account that has network and UNC privileges. 2. Try some ways to map drives so that a Service account can see them See the following for example: http://stackoverflow.com/questions/182750/how-to-map-a-network-drive-to-be-used-by-a-service Disclaimer - I'm not a Windows person, so it's best to do research before trying any of these suggestions. just my two cents . . . . /mde/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Set docBase in pom.xml for maven tomcat plugin
Hello, Yup that's the correct ml. Did you try with last trunk version from ASF (tomcat6/7 mojos) ? For how to test that: see http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/snapshot-test.html Yup normally warSourceDirectory should do the job. Honestly I test more with cli (and not an eclipse user :-) ). Do you have issues running that with cli ? 2011/11/2 Bin Lan lan...@gmail.com: Hi all, I hope this message reaches the right user group. My question is pretty simple. In maven-tomcat-plugin, how can I set the docBase path? Currently, my project is a Eclipse dynamic web project and all the webapp files are being stored inside ${basedir}/WebContent folder. Whenever I tried mvn tomcat:run, I got an IllegalArgumentException saying that the ${basedir}/src/main/webapp does not exists or is not readable. Is there a way that I can set it inside pom.xml? I tried warSourceDirectory but it is not doing what I want. Thanks in advance. Regards Bin -- Olivier Lamy Talend : http://talend.com http://twitter.com/olamy | http://linkedin.com/in/olamy - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Set docBase in pom.xml for maven tomcat plugin
Hi Olivier, Thank you for you reply. I run maven in cli not in ecclipse. Since the project is a eclipse native dynamc web project, so I gues eclipse has its own way to handle it. But regardless, the warSourceDirectory did not change the docBase for me. Regards Bin On Nov 2, 2011 5:08 AM, Olivier Lamy ol...@apache.org wrote: Hello, Yup that's the correct ml. Did you try with last trunk version from ASF (tomcat6/7 mojos) ? For how to test that: see http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/snapshot-test.html Yup normally warSourceDirectory should do the job. Honestly I test more with cli (and not an eclipse user :-) ). Do you have issues running that with cli ? 2011/11/2 Bin Lan lan...@gmail.com: Hi all, I hope this message reaches the right user group. My question is pretty simple. In maven-tomcat-plugin, how can I set the docBase path? Currently, my project is a Eclipse dynamic web project and all the webapp files are being stored inside ${basedir}/WebContent folder. Whenever I tried mvn tomcat:run, I got an IllegalArgumentException saying that the ${basedir}/src/main/webapp does not exists or is not readable. Is there a way that I can set it inside pom.xml? I tried warSourceDirectory but it is not doing what I want. Thanks in advance. Regards Bin -- Olivier Lamy Talend : http://talend.com http://twitter.com/olamy | http://linkedin.com/in/olamy - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Set docBase in pom.xml for maven tomcat plugin
Forgot to mention that I am using 2.0-snapshot. On Nov 2, 2011 7:20 AM, Bin Lan lan...@gmail.com wrote: Hi Olivier, Thank you for you reply. I run maven in cli not in ecclipse. Since the project is a eclipse native dynamc web project, so I gues eclipse has its own way to handle it. But regardless, the warSourceDirectory did not change the docBase for me. Regards Bin On Nov 2, 2011 5:08 AM, Olivier Lamy ol...@apache.org wrote: Hello, Yup that's the correct ml. Did you try with last trunk version from ASF (tomcat6/7 mojos) ? For how to test that: see http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/snapshot-test.html Yup normally warSourceDirectory should do the job. Honestly I test more with cli (and not an eclipse user :-) ). Do you have issues running that with cli ? 2011/11/2 Bin Lan lan...@gmail.com: Hi all, I hope this message reaches the right user group. My question is pretty simple. In maven-tomcat-plugin, how can I set the docBase path? Currently, my project is a Eclipse dynamic web project and all the webapp files are being stored inside ${basedir}/WebContent folder. Whenever I tried mvn tomcat:run, I got an IllegalArgumentException saying that the ${basedir}/src/main/webapp does not exists or is not readable. Is there a way that I can set it inside pom.xml? I tried warSourceDirectory but it is not doing what I want. Thanks in advance. Regards Bin -- Olivier Lamy Talend : http://talend.com http://twitter.com/olamy | http://linkedin.com/in/olamy - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Set docBase in pom.xml for maven tomcat plugin
Can you try with last changes I have pushed ? You need to build locally from sources. (some network issues for *.apache.org so I cannot deploy snapshots) 2011/11/2 Bin Lan lan...@gmail.com: Forgot to mention that I am using 2.0-snapshot. On Nov 2, 2011 7:20 AM, Bin Lan lan...@gmail.com wrote: Hi Olivier, Thank you for you reply. I run maven in cli not in ecclipse. Since the project is a eclipse native dynamc web project, so I gues eclipse has its own way to handle it. But regardless, the warSourceDirectory did not change the docBase for me. Regards Bin On Nov 2, 2011 5:08 AM, Olivier Lamy ol...@apache.org wrote: Hello, Yup that's the correct ml. Did you try with last trunk version from ASF (tomcat6/7 mojos) ? For how to test that: see http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/snapshot-test.html Yup normally warSourceDirectory should do the job. Honestly I test more with cli (and not an eclipse user :-) ). Do you have issues running that with cli ? 2011/11/2 Bin Lan lan...@gmail.com: Hi all, I hope this message reaches the right user group. My question is pretty simple. In maven-tomcat-plugin, how can I set the docBase path? Currently, my project is a Eclipse dynamic web project and all the webapp files are being stored inside ${basedir}/WebContent folder. Whenever I tried mvn tomcat:run, I got an IllegalArgumentException saying that the ${basedir}/src/main/webapp does not exists or is not readable. Is there a way that I can set it inside pom.xml? I tried warSourceDirectory but it is not doing what I want. Thanks in advance. Regards Bin -- Olivier Lamy Talend : http://talend.com http://twitter.com/olamy | http://linkedin.com/in/olamy - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- Olivier Lamy Talend : http://talend.com http://twitter.com/olamy | http://linkedin.com/in/olamy - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Set docBase in pom.xml for maven tomcat plugin
Hi Olivier, I followed the instruction on http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/snapshot-test.html, and use tomcat6:run instead of tomcat:run and now the plugin is using the path in warSourceDirectory. Quick question, is this gonna be part of the next release? Thank you very much. Regards Bin On Wed, Nov 2, 2011 at 7:32 AM, Olivier Lamy ol...@apache.org wrote: Can you try with last changes I have pushed ? You need to build locally from sources. (some network issues for *.apache.org so I cannot deploy snapshots) 2011/11/2 Bin Lan lan...@gmail.com: Forgot to mention that I am using 2.0-snapshot. On Nov 2, 2011 7:20 AM, Bin Lan lan...@gmail.com wrote: Hi Olivier, Thank you for you reply. I run maven in cli not in ecclipse. Since the project is a eclipse native dynamc web project, so I gues eclipse has its own way to handle it. But regardless, the warSourceDirectory did not change the docBase for me. Regards Bin On Nov 2, 2011 5:08 AM, Olivier Lamy ol...@apache.org wrote: Hello, Yup that's the correct ml. Did you try with last trunk version from ASF (tomcat6/7 mojos) ? For how to test that: see http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/snapshot-test.html Yup normally warSourceDirectory should do the job. Honestly I test more with cli (and not an eclipse user :-) ). Do you have issues running that with cli ? 2011/11/2 Bin Lan lan...@gmail.com: Hi all, I hope this message reaches the right user group. My question is pretty simple. In maven-tomcat-plugin, how can I set the docBase path? Currently, my project is a Eclipse dynamic web project and all the webapp files are being stored inside ${basedir}/WebContent folder. Whenever I tried mvn tomcat:run, I got an IllegalArgumentException saying that the ${basedir}/src/main/webapp does not exists or is not readable. Is there a way that I can set it inside pom.xml? I tried warSourceDirectory but it is not doing what I want. Thanks in advance. Regards Bin -- Olivier Lamy Talend : http://talend.com http://twitter.com/olamy | http://linkedin.com/in/olamy - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- Olivier Lamy Talend : http://talend.com http://twitter.com/olamy | http://linkedin.com/in/olamy - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Set docBase in pom.xml for maven tomcat plugin
2011/11/2 Bin Lan lan...@gmail.com: Hi Olivier, I followed the instruction on http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/snapshot-test.html, and use tomcat6:run instead of tomcat:run and now the plugin is using the path in warSourceDirectory. Quick question, is this gonna be part of the next release? As it's in trunk sure will be in next release :-) Thank you very much. Regards Bin On Wed, Nov 2, 2011 at 7:32 AM, Olivier Lamy ol...@apache.org wrote: Can you try with last changes I have pushed ? You need to build locally from sources. (some network issues for *.apache.org so I cannot deploy snapshots) 2011/11/2 Bin Lan lan...@gmail.com: Forgot to mention that I am using 2.0-snapshot. On Nov 2, 2011 7:20 AM, Bin Lan lan...@gmail.com wrote: Hi Olivier, Thank you for you reply. I run maven in cli not in ecclipse. Since the project is a eclipse native dynamc web project, so I gues eclipse has its own way to handle it. But regardless, the warSourceDirectory did not change the docBase for me. Regards Bin On Nov 2, 2011 5:08 AM, Olivier Lamy ol...@apache.org wrote: Hello, Yup that's the correct ml. Did you try with last trunk version from ASF (tomcat6/7 mojos) ? For how to test that: see http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/snapshot-test.html Yup normally warSourceDirectory should do the job. Honestly I test more with cli (and not an eclipse user :-) ). Do you have issues running that with cli ? 2011/11/2 Bin Lan lan...@gmail.com: Hi all, I hope this message reaches the right user group. My question is pretty simple. In maven-tomcat-plugin, how can I set the docBase path? Currently, my project is a Eclipse dynamic web project and all the webapp files are being stored inside ${basedir}/WebContent folder. Whenever I tried mvn tomcat:run, I got an IllegalArgumentException saying that the ${basedir}/src/main/webapp does not exists or is not readable. Is there a way that I can set it inside pom.xml? I tried warSourceDirectory but it is not doing what I want. Thanks in advance. Regards Bin -- Olivier Lamy Talend : http://talend.com http://twitter.com/olamy | http://linkedin.com/in/olamy - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- Olivier Lamy Talend : http://talend.com http://twitter.com/olamy | http://linkedin.com/in/olamy - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- Olivier Lamy Talend : http://talend.com http://twitter.com/olamy | http://linkedin.com/in/olamy - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Set docBase in pom.xml for maven tomcat plugin
Hi all, I hope this message reaches the right user group. My question is pretty simple. In maven-tomcat-plugin, how can I set the docBase path? Currently, my project is a Eclipse dynamic web project and all the webapp files are being stored inside ${basedir}/WebContent folder. Whenever I tried mvn tomcat:run, I got an IllegalArgumentException saying that the ${basedir}/src/main/webapp does not exists or is not readable. Is there a way that I can set it inside pom.xml? I tried warSourceDirectory but it is not doing what I want. Thanks in advance. Regards Bin
docBase= and Environment/ in server.xml
Hy everibody, in my Tomcat 5.5 instance I'm trying to set a webapp as the root (docBase=) webapp so that when users connect to http://server:port/ will not respond manager webapp. I've done this by adding the tag Context path= docBase=myWebApp / in server.xml, but I can't access this webapp because ResourceLink / defined in context.xml can't access Environment / defined in server.xml. I can I solve this problem? Thanks. Gabriele.
RE: docBase= and Environment/ in server.xml
From: Gianoglio Gabriele [mailto:g.gianog...@eurogroup.it] Subject: docBase= and Environment/ in server.xml in my Tomcat 5.5 instance I'm trying to set a webapp as the root (docBase=) webapp Right there you have a fatal error; docBase must *never* be an empty string. Please read the FAQ entry for making a webapp the default one: http://wiki.apache.org/tomcat/HowTo#How_do_I_make_my_web_application_be_the_Tomcat_default_application.3F The simple way is to not put the Context in server.xml (almost always a bad idea), and name your webapp ROOT (case sensitive). - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: exception fixing docbase [/axis2]
Thank you for the response, we have activated the write permissions for this user and now it works. BR, El 22/12/2010 23:50, Pid * escribió: On 22 Dec 2010, at 10:39, Nuria Sánchez Almodóvarn...@gatv.ssr.upm.es wrote: Good morning, We are trying to run axis2/Apache on Windows 7. If we try to launch Tomcat as Administrator it works fine and the service we have developed is shown as part of the available services for axis2. Apache version? Tomcat version? etc However, if we try the same but with a different user (also with administrator privileges) we got a SEVERE error 'exception fixing docbase [/axis2]' and a list of exceptions because for some reason the axis2.war cannot be correctly unpackaged and consequently the corresponding folder cannot be found, resources cannot be copied, etc. (Attached you can find a screenshot, sorry it is in Spanish) The list strips attachments. Can you post error text online? Please post your server.xml inline, after removing the XML comments and obscuring any passwords. Does the other user have write permission in the directories in which Tomcat is installed? We have tried different options without success. We are not sure about how to modify the initial configuration of Tomcat in order to change the user to run Tomcat or maybe this is not the problem. Are you using the service wrapper or .bat files to start Tomcat? p Any help will be more than welcome! Thank you very much in advance for your kindly support. Best Regards, Nuria -- Nuria S�nchez Almod�var n...@gatv.ssr.upm.es g...@tv - Grupo de Aplicaci�n de Telecomunicaciones Visuales Dpto. Se�ales, Sistemas y Radiocomunicaciones (SSR) Telf: +34 91 336 73 44 E.T.S.I. de Telecomunicaci�n (UPM) Laboratorio C-300 Ciudad Universitaria s/n 28040 - Madrid Espa�a - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org -- Nuria Sánchez Almodóvar n...@gatv.ssr.upm.es g...@tv - Grupo de Aplicación de Telecomunicaciones Visuales Dpto. Señales, Sistemas y Radiocomunicaciones (SSR) Telf: +34 91 336 73 44 E.T.S.I. de Telecomunicación (UPM) Laboratorio C-300 Ciudad Universitaria s/n 28040 - Madrid España - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
exception fixing docbase [/axis2]
Good morning, We are trying to run axis2/Apache on Windows 7. If we try to launch Tomcat as Administrator it works fine and the service we have developed is shown as part of the available services for axis2. However, if we try the same but with a different user (also with administrator privileges) we got a SEVERE error 'exception fixing docbase [/axis2]' and a list of exceptions because for some reason the axis2.war cannot be correctly unpackaged and consequently the corresponding folder cannot be found, resources cannot be copied, etc. (Attached you can find a screenshot, sorry it is in Spanish) We have tried different options without success. We are not sure about how to modify the initial configuration of Tomcat in order to change the user to run Tomcat or maybe this is not the problem. Any help will be more than welcome! Thank you very much in advance for your kindly support. Best Regards, Nuria -- Nuria Sánchez Almodóvar n...@gatv.ssr.upm.es g...@tv - Grupo de Aplicación de Telecomunicaciones Visuales Dpto. Señales, Sistemas y Radiocomunicaciones (SSR) Telf: +34 91 336 73 44 E.T.S.I. de Telecomunicación (UPM) Laboratorio C-300 Ciudad Universitaria s/n 28040 - Madrid España - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: exception fixing docbase [/axis2]
On 22 Dec 2010, at 10:39, Nuria Sánchez Almodóvar n...@gatv.ssr.upm.es wrote: Good morning, We are trying to run axis2/Apache on Windows 7. If we try to launch Tomcat as Administrator it works fine and the service we have developed is shown as part of the available services for axis2. Apache version? Tomcat version? etc However, if we try the same but with a different user (also with administrator privileges) we got a SEVERE error 'exception fixing docbase [/axis2]' and a list of exceptions because for some reason the axis2.war cannot be correctly unpackaged and consequently the corresponding folder cannot be found, resources cannot be copied, etc. (Attached you can find a screenshot, sorry it is in Spanish) The list strips attachments. Can you post error text online? Please post your server.xml inline, after removing the XML comments and obscuring any passwords. Does the other user have write permission in the directories in which Tomcat is installed? We have tried different options without success. We are not sure about how to modify the initial configuration of Tomcat in order to change the user to run Tomcat or maybe this is not the problem. Are you using the service wrapper or .bat files to start Tomcat? p Any help will be more than welcome! Thank you very much in advance for your kindly support. Best Regards, Nuria -- Nuria S�nchez Almod�var n...@gatv.ssr.upm.es g...@tv - Grupo de Aplicaci�n de Telecomunicaciones Visuales Dpto. Se�ales, Sistemas y Radiocomunicaciones (SSR) Telf: +34 91 336 73 44 E.T.S.I. de Telecomunicaci�n (UPM) Laboratorio C-300 Ciudad Universitaria s/n 28040 - Madrid Espa�a - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Docbase inside the host appBasehas been specified, and will be ignored
Hi, I am using tomcat 5.5 and I have deployed a web application that is working fine, but on tomcat start up I have noticed this message. I have googled around but it seems most people see this message and their web app doesn't work, mine does however work fine. Does anybody know why I am seeing this message? I have an xml file called 'LabCatalogue.xml' in 'apache-tomcat-5.5.23\conf\Catalina\localhost' that looks like: Context crossContext=true docBase=c:\\webapps\LabCatalogue path=/LabCatalogue reloadable=true / The web app is set to reloadable because it is currently in development. Thanks, Paul This message may contain confidential information. If you are not the intended recipient please inform the sender that you have received the message in error before deleting it. Please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents: to do so is strictly prohibited and may be unlawful. Thank you for your co-operation. NHSmail is the secure email and directory service available for all NHS staff in England and Scotland NHSmail is approved for exchanging patient data and other sensitive information with NHSmail and GSI recipients NHSmail provides an email address for your career in the NHS and can be accessed anywhere For more information and to find out how you can switch, visit www.connectingforhealth.nhs.uk/nhsmail
Re: Docbase inside the host appBasehas been specified, and will be ignored
On 01/07/2010 09:06, Ockleford Paul (NHS Connecting for Health) wrote: Hi, I am using tomcat 5.5 and I have deployed a web application that is working fine, but on tomcat start up I have noticed this message. I have googled around but it seems most people see this message and their web app doesn't work, mine does however work fine. Does anybody know why I am seeing this message? Because your config is screwy. To use a technical term. I have an xml file called 'LabCatalogue.xml' in 'apache-tomcat-5.5.23\conf\Catalina\localhost' that looks like: Context crossContext=true docBase=c:\\webapps\LabCatalogue path=/LabCatalogue reloadable=true / The web app is set to reloadable because it is currently in development. The appBase on the Host element is where Tomcat looks for apps to deploy. Apps are either a .war or a directory (actually an exploded .war file). For an application placed in the appBase, Tomcat will automatically determine the 'path' it will be deployed at and the 'docBase', so you don't need to specify either attribute. You get the warning if the docBase is present and redundant. As a rule of thumb, setting 'path' or 'docBase' is generally unnecessary - possibly even 'a bad idea'. p Thanks, Paul This message may contain confidential information. If you are not the intended recipient please inform the sender that you have received the message in error before deleting it. Please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents: to do so is strictly prohibited and may be unlawful. Thank you for your co-operation. NHSmail is the secure email and directory service available for all NHS staff in England and Scotland NHSmail is approved for exchanging patient data and other sensitive information with NHSmail and GSI recipients NHSmail provides an email address for your career in the NHS and can be accessed anywhere For more information and to find out how you can switch, visit www.connectingforhealth.nhs.uk/nhsmail signature.asc Description: OpenPGP digital signature
RE: Docbase inside the host appBasehas been specified, and will be ignored
Ok, so if I am just working in development and only using classes outside of a war or a jar file how should I configure the application? If I remove those mappings how would tomcat know that a request for /LabCatalogue should be matched to my code in c:\\webapps\LabCatalogue? -Original Message- From: Pid [mailto:p...@pidster.com] Sent: 01 July 2010 09:21 To: Tomcat Users List Subject: Re: Docbase inside the host appBasehas been specified, and will be ignored On 01/07/2010 09:06, Ockleford Paul (NHS Connecting for Health) wrote: Hi, I am using tomcat 5.5 and I have deployed a web application that is working fine, but on tomcat start up I have noticed this message. I have googled around but it seems most people see this message and their web app doesn't work, mine does however work fine. Does anybody know why I am seeing this message? Because your config is screwy. To use a technical term. I have an xml file called 'LabCatalogue.xml' in 'apache-tomcat-5.5.23\conf\Catalina\localhost' that looks like: Context crossContext=true docBase=c:\\webapps\LabCatalogue path=/LabCatalogue reloadable=true / The web app is set to reloadable because it is currently in development. The appBase on the Host element is where Tomcat looks for apps to deploy. Apps are either a .war or a directory (actually an exploded .war file). For an application placed in the appBase, Tomcat will automatically determine the 'path' it will be deployed at and the 'docBase', so you don't need to specify either attribute. You get the warning if the docBase is present and redundant. As a rule of thumb, setting 'path' or 'docBase' is generally unnecessary - possibly even 'a bad idea'. p Thanks, Paul ** ** This message may contain confidential information. If you are not the intended recipient please inform the sender that you have received the message in error before deleting it. Please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents: to do so is strictly prohibited and may be unlawful. Thank you for your co-operation. NHSmail is the secure email and directory service available for all NHS staff in England and Scotland NHSmail is approved for exchanging patient data and other sensitive information with NHSmail and GSI recipients NHSmail provides an email address for your career in the NHS and can be accessed anywhere For more information and to find out how you can switch, visit www.connectingforhealth.nhs.uk/nhsmail ** ** This message may contain confidential information. If you are not the intended recipient please inform the sender that you have received the message in error before deleting it. Please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents: to do so is strictly prohibited and may be unlawful. Thank you for your co-operation. NHSmail is the secure email and directory service available for all NHS staff in England and Scotland NHSmail is approved for exchanging patient data and other sensitive information with NHSmail and GSI recipients NHSmail provides an email address for your career in the NHS and can be accessed anywhere For more information and to find out how you can switch, visit www.connectingforhealth.nhs.uk/nhsmail - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Docbase inside the host appBasehas been specified, and will be ignored
Ockleford Paul (NHS Connecting for Health) wrote: Ok, so if I am just working in development and only using classes outside of a war or a jar file how should I configure the application? If I remove those mappings how would tomcat know that a request for /LabCatalogue should be matched to my code in c:\\webapps\LabCatalogue? To use another technical term, because. ;-) More technically, because that is the default. Here is a non-authoritative summary explanation. Say a browser requests the URL http://somehost.somedomain.com/somewebapp;. The first part http://somehost.somedomain.com; just tells the browser with which host to make a connection, and to use the HTTP protocol for it. Then the browser, over that connection, sends a request with the rest, like : GET /somewebapp HTTP/1.1 When Tomcat receives a request with that URL /somewebapp, it looks under the directory which is specified as the appBase for that Host (*), for either a directory named somewebapp, or a .war file named somewebapp.war. It will do that /unless/ there is a Context element somewhere which tells it that it should look somewhere else. By default also, under that directory, Tomcat is going to look for a WEB-INF directory, and under that directory, for a directory classes and a directory lib, where it expects to find the .class and .jar files of your application, respectively. (*) by default, there is only one Host named localhost, and its webapps directory is the webapps directory under the Tomcat top installation directory. For a more complete and correct explanation, you should read http://tomcat.apache.org/tomcat-6.0-doc/deployer-howto.html and http://tomcat.apache.org/tomcat-6.0-doc/config/context.html .. and the Servlet Specification. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
What should docbase be set to ?
Hello, I am deploying a single app under the ROOT context. My appbase is c:/ comapany/myapps. So my app is in c:/company/myapps/ROOT. My question is for *both* Tomcat 5.5.23 and 6.0.20, in my context.xml what should my docbase be set to ? Right now I have it set to docbase=. Thanks - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: What should docbase be set to ?
From: Patrick Flaherty [mailto:pflah...@rampageinc.com] Subject: What should docbase be set to ? I am deploying a single app under the ROOT context. My appbase is c:/comapany/myapps. So my app is in c:/company/myapps/ROOT. My question is for *both* Tomcat 5.5.23 and 6.0.20, in my context.xml what should my docbase be set to ? It shouldn't be set at all. Omit the docBase attribute for any webapp located in the Host appBase directory. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Trying to access a directory outside docBase... is it possible ?
Hi, I am new to Tomcat and JEE, but a new job means to learn new things. So right to my problem, wich I am sure is not too unusual, but I couldn't really find a solution (via google) so far. my directory structure looks as follows /opt/document-repository - mounted nfs-disk of an archiving system /opt/Tomcat/webapps/myApp.war - my project deployment file my webapp for now is just a bunch of servlets which, using java.io.File..., have no trouble to read the archiving systems directory structure listing to list all available archived pdf-files. With servlets and some CSS I managed to build a little directory tree in the browser output and linked the pdf-files to get opened (via adobe reader plugin) in an iframe this basically works if the pdf-files I want to open are located in the deployment directory. but what I want to do is to access the pdf-files of the archiving disk. it seems tho while the servlet java code {java.io...} CAN, tomcat CANNOT access the pdf-files, which are stored there. And my projects deployment directory and the archiving systems mount have to be separated, so I can not mount the nfs into the deployment directory nor can I put my application around the nfs-mount-directory I stumbled over a hint about adding a Context docBase=/opt/documents path=/documents/ directive to the web.xml file, but I haven't had any luck with my experiments so far, but then I realized that this would mean that I also have to move my project directory which I can't. So if there is any possibility to get this done (i am using linux incase you haven't guessed already) I would be very glad if anyone could drop a few lines to help me out. Thanks in advance! Ingo Gambin Brilliant Vorsorge GmbH Worringer Str. 2-4 D-40211 Düsseldorf Telefon: +49 (0) 211 / 61793-0 Mobil:+49 (0) 176 / 44 66 66 42 eMail:igam...@brilliant.de PGP-Fingerprint: D316 7343 EA4B 82C7 D96D 6917 3BF3 005A DA46 227F signature.asc Description: Dies ist ein digital signierter Nachrichtenteil
Re: Trying to access a directory outside docBase... is it possible ?
On 15/12/2009 13:46, Ingo Gambin wrote: Hi, I am new to Tomcat and JEE, but a new job means to learn new things. So right to my problem, wich I am sure is not too unusual, but I couldn't really find a solution (via google) so far. my directory structure looks as follows /opt/document-repository- mounted nfs-disk of an archiving system /opt/Tomcat/webapps/myApp.war- my project deployment file my webapp for now is just a bunch of servlets which, using java.io.File..., have no trouble to read the archiving systems directory structure listing to list all available archived pdf-files. With servlets and some CSS I managed to build a little directory tree in the browser output and linked the pdf-files to get opened (via adobe reader plugin) in an iframe this basically works if the pdf-files I want to open are located in the deployment directory. but what I want to do is to access the pdf-files of the archiving disk. it seems tho while the servlet java code {java.io...} CAN, tomcat CANNOT access the pdf-files, which are stored there. And my projects deployment directory and the archiving systems mount have to be separated, so I can not mount the nfs into the deployment directory nor can I put my application around the nfs-mount-directory I stumbled over a hint about adding a Context docBase=/opt/documents path=/documents/ directive to the web.xml file, but I haven't had any luck with my experiments so far, but then I realized that this would mean that I also have to move my project directory which I can't. So if there is any possibility to get this done (i am using linux incase you haven't guessed already) I would be very glad if anyone could drop a few lines to help me out. What actually happens when you try to access the files? Does the Tomcat process have sufficient rights to access that directory? p Thanks in advance! Ingo Gambin Brilliant Vorsorge GmbH Worringer Str. 2-4 D-40211 Düsseldorf Telefon: +49 (0) 211 / 61793-0 Mobil:+49 (0) 176 / 44 66 66 42 eMail:igam...@brilliant.de PGP-Fingerprint: D316 7343 EA4B 82C7 D96D 6917 3BF3 005A DA46 227F - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Trying to access a directory outside docBase... is it possible ?
Am Dienstag, den 15.12.2009, 15:01 + schrieb Pid: o right to my problem, wich I am sure is not too unusual, but I couldn't really find a solution (via google) so far. my directory structure looks as follows /opt/document-repository- mounted nfs-disk of an archiving system /opt/Tomcat/webapps/myApp.war- my project deployment file my webapp for now is just a bunch of servlets which, using java.io.File..., have no trouble to read the archiving systems directory structure listing to list all available archived pdf-files. With servlets and some CSS I managed to build a little directory tree in the browser output and linked the pdf-files to get opened (via adobe reader plugin) in an iframe this basically works if the pdf-files I want to open are located in the deployment directory. but what I want to do is to access the pdf-files of the archiving disk. it seems tho while the servlet java code {java.io...} CAN, tomcat CANNOT access the pdf-files, which are stored there. And my projects deployment directory and the archiving systems mount have to be separated, so I can not mount the nfs into the deployment directory nor can I put my application around the nfs-mount-directory I stumbled over a hint about adding a Context docBase=/opt/documents path=/documents/ directive to the web.xml file, but I haven't had any luck with my experiments so far, but then I realized that this would mean that I also have to move my project directory which I can't. So if there is any possibility to get this done (i am using linux incase you haven't guessed already) I would be very glad if anyone could drop a few lines to help me out. What actually happens when you try to access the files? Does the Tomcat process have sufficient rights to access that directory? http://localhost:8080/myApp/PDFClient - entry servlet and main form http://localhost:8080/myApp/PDFViewer - servlet loaded in IFrame ok when I click on a linked PDF e. g. a href=http://localhost:8080/myApp/PDFViewer?file=document-repository/Folder%202/TestDok4.pdfpage=1; target=viewer-iframefilename/a in the PDFClient the PDFViewer should be loaded in the IFrame, which actually is a blank page that just embeds the PDF-File ...process request-parameters and session-vars... if(pdfFile!=null) { output = embed src=\+pdfFile+#page=+pdfPage +toolbar=0navpanes=0scrollbar=0view=Fit\ width= \550\ height=\550\; } When I call the Viewer with a file 'TestDok1.pdf' which is located in the 'war' file (main directory of the project), it works well, when a pdf-file from a location outside the project directory the generated html looks like it should: html head titlePDFViewer/title /head body embed src=document-repository/TestDok1.pdf#page=1toolbar=0navpanes=0scrollbar=0view=Fit width=550 height=550 /body /html but instead of opening the PDF-File the plugin opens nothing... well at least it reserves the 550x550 pixels for the presentation but all is white nothing is displayed /opt and recursively all contents have rwxrwxrwx... so I would think the access rights should not be the problem... Thx for the quick answer! Ingo signature.asc Description: Dies ist ein digital signierter Nachrichtenteil
Re: Trying to access a directory outside docBase... is it possible ?
On 15/12/2009 15:25, Ingo Gambin wrote: Am Dienstag, den 15.12.2009, 15:01 + schrieb Pid: o right to my problem, wich I am sure is not too unusual, but I couldn't really find a solution (via google) so far. my directory structure looks as follows /opt/document-repository- mounted nfs-disk of an archiving system /opt/Tomcat/webapps/myApp.war- my project deployment file my webapp for now is just a bunch of servlets which, using java.io.File..., have no trouble to read the archiving systems directory structure listing to list all available archived pdf-files. With servlets and some CSS I managed to build a little directory tree in the browser output and linked the pdf-files to get opened (via adobe reader plugin) in an iframe this basically works if the pdf-files I want to open are located in the deployment directory. but what I want to do is to access the pdf-files of the archiving disk. it seems tho while the servlet java code {java.io...} CAN, tomcat CANNOT access the pdf-files, which are stored there. And my projects deployment directory and the archiving systems mount have to be separated, so I can not mount the nfs into the deployment directory nor can I put my application around the nfs-mount-directory I stumbled over a hint about adding a Context docBase=/opt/documents path=/documents/ directive to the web.xml file, but I haven't had any luck with my experiments so far, but then I realized that this would mean that I also have to move my project directory which I can't. So if there is any possibility to get this done (i am using linux incase you haven't guessed already) I would be very glad if anyone could drop a few lines to help me out. What actually happens when you try to access the files? Does the Tomcat process have sufficient rights to access that directory? http://localhost:8080/myApp/PDFClient- entry servlet and main form http://localhost:8080/myApp/PDFViewer- servlet loaded in IFrame snip So what do your app logs say? If the viewer servlet isn't working where does it throw it's errors? p Thx for the quick answer! Ingo - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Trying to access a directory outside docBase... is it possible ?
Ingo Gambin wrote: ... my directory structure looks as follows /opt/document-repository - mounted nfs-disk of an archiving system /opt/Tomcat/webapps/myApp.war - my project deployment file my webapp for now is just a bunch of servlets which, using java.io.File..., have no trouble to read the archiving systems directory structure listing to list all available archived pdf-files. With servlets and some CSS I managed to build a little directory tree in the browser output and linked the pdf-files to get opened (via adobe reader plugin) in an iframe this basically works if the pdf-files I want to open are located in the deployment directory. but what I want to do is to access the pdf-files of the archiving disk. it seems tho while the servlet java code {java.io...} CAN, tomcat CANNOT access the pdf-files, which are stored there. And my projects deployment directory and the archiving systems mount have to be separated, so I can not mount the nfs into the deployment directory nor can I put my application around the nfs-mount-directory But maybe you could just create a link, inside your deployment directory, to the mount ? /opt/Tomcat/webapps/myApp/docs -- /opt/document-repository You would have to make sure that the user-id under which Tomcat runs has read access to that directory and to the documents in it. Otherwise, can you be more precise when you say that tomcat CANNOT access the files ? what URL is the client using, and what exactly happens ? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Trying to access a directory outside docBase... is it possible ?
2009/12/15 André Warnier a...@ice-sa.com But maybe you could just create a link, inside your deployment directory, to the mount ? /opt/Tomcat/webapps/myApp/docs -- /opt/document-repository If you're going to do this, be Very Very Careful. Tomcat doesn't follow symbolic links by default, even on UNIX. This is for a very good reason: if you do this, Tomcat *will* follow the symlink and delete your PDFs when you undeploy your webapp. You probably don't want this to happen. This is a common enough use case (it comes up about once a month on the list) that Someone may have coded a quick serve the content from this directory servlet, probably based on the root webapp. Chris? You're generally the coder with quick hacks already developed... - Peter
Re: Trying to access a directory outside docBase... is it possible ?
On 15/12/2009 16:05, Peter Crowther wrote: 2009/12/15 André Warniera...@ice-sa.com But maybe you could just create a link, inside your deployment directory, to the mount ? /opt/Tomcat/webapps/myApp/docs -- /opt/document-repository If you're going to do this, be Very Very Careful. Tomcat doesn't follow symbolic links by default, even on UNIX. This is for a very good reason: if you do this, Tomcat *will* follow the symlink and delete your PDFs when you undeploy your webapp. You probably don't want this to happen. This is a common enough use case (it comes up about once a month on the list) that Someone may have coded a quick serve the content from this directory servlet, probably based on the root webapp. Chris? You're generally the coder with quick hacks already developed... The OP already has a servlet AFAICT. It's just not working. p - Peter - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Trying to access a directory outside docBase... is it possible ?
2009/12/15 Ingo Gambin igam...@brilliant.de Hi, I am new to Tomcat and JEE, but a new job means to learn new things. So right to my problem, wich I am sure is not too unusual, but I couldn't really find a solution (via google) so far. my directory structure looks as follows /opt/document-repository - mounted nfs-disk of an archiving system /opt/Tomcat/webapps/myApp.war - my project deployment file my webapp for now is just a bunch of servlets which, using java.io.File..., have no trouble to read the archiving systems directory structure listing to list all available archived pdf-files. With servlets and some CSS I managed to build a little directory tree in the browser output and linked the pdf-files to get opened (via adobe reader plugin) in an iframe this basically works if the pdf-files I want to open are located in the deployment directory. but what I want to do is to access the pdf-files of the archiving disk. it seems tho while the servlet java code {java.io...} CAN, tomcat CANNOT access the pdf-files, which are stored there. And my projects deployment directory and the archiving systems mount have to be separated, so I can not mount the nfs into the deployment directory nor can I put my application around the nfs-mount-directory I stumbled over a hint about adding a Context docBase=/opt/documents path=/documents/ directive to the web.xml file, but I haven't had any luck with my experiments so far, but then I realized that this would mean that I also have to move my project directory which I can't. So if there is any possibility to get this done (i am using linux incase you haven't guessed already) I would be very glad if anyone could drop a few lines to help me out. Thanks in advance! Ingo Gambin Brilliant Vorsorge GmbH Worringer Str. 2-4 D-40211 Düsseldorf Telefon: +49 (0) 211 / 61793-0 Mobil:+49 (0) 176 / 44 66 66 42 eMail:igam...@brilliant.de PGP-Fingerprint: D316 7343 EA4B 82C7 D96D 6917 3BF3 005A DA46 227F Context docBase=/opt/documents path=/documents/ You must create documents.xml in conf/Catalina/localhost/ and put there this directive, not in web.xml
Re: Trying to access a directory outside docBase... is it possible ?
Pid wrote: On 15/12/2009 16:05, Peter Crowther wrote: 2009/12/15 André Warniera...@ice-sa.com But maybe you could just create a link, inside your deployment directory, to the mount ? /opt/Tomcat/webapps/myApp/docs -- /opt/document-repository If you're going to do this, be Very Very Careful. Tomcat doesn't follow symbolic links by default, even on UNIX. This is for a very good reason: if you do this, Tomcat *will* follow the symlink and delete your PDFs when you undeploy your webapp. Ooops. (Although I did specify read access for the Tomcat user-id. If it does not have write access to the directory pointed to, it should not be able to delete the files, right ?) You probably don't want this to happen. This is a common enough use case (it comes up about once a month on the list) that Someone may have coded a quick serve the content from this directory servlet, probably based on the root webapp. Chris? You're generally the coder with quick hacks already developed... The OP already has a servlet AFAICT. It's just not working. I think indeed the OP has some kind of servlet, and that one works. But I understood that he wanted Tomcat to serve these documents directly, as files, not going through a servlet. Maybe I got that wrong. OP ? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Trying to access a directory outside docBase... is it possible ?
From: peter.crowth...@googlemail.com [mailto:peter.crowth...@googlemail.com] On Behalf Of Peter Crowther Subject: Re: Trying to access a directory outside docBase... is it possible ? This is a common enough use case (it comes up about once a month on the list) that Someone may have coded a quick serve the content from this directory servlet, probably based on the root webapp. A special servlet is not required - Tomcat's default servlet will do the job. Paolo already gave the correct answer, which is to set up a Context element for a dummy webapp: Context docBase=/opt/documents path=/documents/ You must create documents.xml in conf/Catalina/localhost/ and put there this directive, not in web.xml Although the path attribute must not be used - just the docBase. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Trying to access a directory outside docBase... is it possible ?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Peter, On 12/15/2009 11:05 AM, Peter Crowther wrote: If you're going to do this, be Very Very Careful. Tomcat doesn't follow symbolic links by default, even on UNIX. This is for a very good reason: if you do this, Tomcat *will* follow the symlink and delete your PDFs when you undeploy your webapp. You probably don't want this to happen. +1 :) This is a common enough use case (it comes up about once a month on the list) that Someone may have coded a quick serve the content from this directory servlet, probably based on the root webapp. Chris? You're generally the coder with quick hacks already developed... Uh, file-serving code is pretty simple: set the Content-Type and Content-Length headers, open the file, deliver the bytes. It's so popular that it's already been written and even ships with Tomcat: it's called the DefaultServlet :) Seriously, though, Ingo was very close to a working solution: I stumbled over a hint about adding a Context docBase=/opt/documents path=/documents/ directive to the web.xml file Ohh! So close! That should be added to conf/server.xml (but not really, since that's no longer recommended). Let's do it the right way: Put this into conf/Catalina/localhost/document-repository.xml: Context docBase=/opt/document-repository path=/documents / I think you might have to restart Tomcat for it to pick up that config file, but it will create a new webapp context that serves files directly from that location. Your URLs will no longer look like this: http://localhost:8080/myApp/PDFViewer?file=document-repository/Folder%202/TestDok4.pdfpage=1 Instead, they can look just like this: /documents/Folder%202/TestDok4.pdfpage=1 You can even get rid of your PDFViewer servlet, because it's probably just serving bytes and not doing anything particularly exciting. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAksn2SsACgkQ9CaO5/Lv0PDlQACglU4lGn9398YVUBpjMGtbJP2X beoAn1zI4YyBJe9sr2MYZOSdlyCqXi3o =RPfr -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Trying to access a directory outside docBase... is possible !
Hi, thanks a lot! Using the 'deprecated' way of putting the 'Context docBase...' directive to server.xml worked whereas trying to put it into documents.xml in the localhost directory did not (using Tomcat 5.5). I am using an extra servlet for the viewer because I dont want to reload the whole page but still want to set my session variables to the values sent via the link (file=... page=...), which I can easily do in the viewer servlet. Thanks again for all the ideas and information, I think I did learn a few things by your responses... especially the 'symbolic link'-hint as I was about to try that first thing this morning, good I read mails first. Best regards and CU when I encounter my next problem:-) Ingo Am Dienstag, den 15.12.2009, 13:44 -0500 schrieb Christopher Schultz: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Peter, On 12/15/2009 11:05 AM, Peter Crowther wrote: If you're going to do this, be Very Very Careful. Tomcat doesn't follow symbolic links by default, even on UNIX. This is for a very good reason: if you do this, Tomcat *will* follow the symlink and delete your PDFs when you undeploy your webapp. You probably don't want this to happen. +1 :) This is a common enough use case (it comes up about once a month on the list) that Someone may have coded a quick serve the content from this directory servlet, probably based on the root webapp. Chris? You're generally the coder with quick hacks already developed... Uh, file-serving code is pretty simple: set the Content-Type and Content-Length headers, open the file, deliver the bytes. It's so popular that it's already been written and even ships with Tomcat: it's called the DefaultServlet :) Seriously, though, Ingo was very close to a working solution: I stumbled over a hint about adding a Context docBase=/opt/documents path=/documents/ directive to the web.xml file Ohh! So close! That should be added to conf/server.xml (but not really, since that's no longer recommended). Let's do it the right way: Put this into conf/Catalina/localhost/document-repository.xml: Context docBase=/opt/document-repository path=/documents / I think you might have to restart Tomcat for it to pick up that config file, but it will create a new webapp context that serves files directly from that location. Your URLs will no longer look like this: http://localhost:8080/myApp/PDFViewer?file=document-repository/Folder%202/TestDok4.pdfpage=1 Instead, they can look just like this: /documents/Folder%202/TestDok4.pdfpage=1 You can even get rid of your PDFViewer servlet, because it's probably just serving bytes and not doing anything particularly exciting. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAksn2SsACgkQ9CaO5/Lv0PDlQACglU4lGn9398YVUBpjMGtbJP2X beoAn1zI4YyBJe9sr2MYZOSdlyCqXi3o =RPfr -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org signature.asc Description: Dies ist ein digital signierter Nachrichtenteil
Putting Docbase on network drive. Is it Possible ?
dear Friends, I have mapped drive e: to \\Dell-1710\RSP_DEV\Appl\Web_Dev\Test_Proj\WebContent there it gets latest compiled application through eclipse. I have created a Test-E.xml in C:\Program Files\Tomcat 6.0\conf\Catalina\localhost the contents are Context path=/Test-E docBase=E:/ antiResourceLocking=false allowLinking=true / If I try with http://localhost:8080/Test-E I wont get Error response. But if I copy all contents of e: to c:\Test-C and create Test-C.xml with contents Context path=/Test-C docBase=C:/test-c antiResourceLocking=false allowLinking=true / http://localhost:8080/Test-C it gives index.html I am newbie to Tomcat and would like to know whether docbase on mapped drives are permitted or Not ? or shall I have to take any further actions to get it working. we are putting all our projects at central server and compiling there only. Every time copying contents of webContents to local c: drive is bit troublesome and debugging is also not possible can some experienced programmer give us a way out.(This is our first web project). Urls to howtos, reading material, suggestion of book will be very useful to us so please help us. Thanks and best regards. Raja. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Putting Docbase on network drive. Is it Possible ?
From: R. S. Patil [mailto:kpr.rspa...@gmail.com] Subject: Putting Docbase on network drive. Is it Possible ? I have created a Test-E.xml in C:\Program Files\Tomcat 6.0\conf\Catalina\localhost the contents are Context path=/Test-E docBase=E:/ antiResourceLocking=false allowLinking=true / Take out the path attribute (it's not allowed) and the allowLinking attribute (ineffective on Windows). If I try with http://localhost:8080/Test-E I wont get Error response. Not getting an error response is usually a good thing. What do you get? I am newbie to Tomcat and would like to know whether docbase on mapped drives are permitted or Not ? Works fine for me - as long as I'm running Tomcat via the startup.bat script. If you're running Tomcat as a service, the service has no access to any drive mappings you've made under your userid. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Putting Docbase on network drive. Is it Possible ?
Thanks Chuck Caldarale Context path=/Test-E docBase=E:/ antiResourceLocking=false allowLinking=true / Take out the path attribute (it's not allowed) and the allowLinking attribute (ineffective on Windows). where can I get more info about attributes and deployment xml file ? If I try with http://localhost:8080/Test-E I wont get Error response. Not getting an error response is usually a good thing. What do you get? sorry it's a typo actually it should be I get error response wont is a extra word I am newbie to Tomcat and would like to know whether docbase on mapped drives are permitted or Not ? Works fine for me - as long as I'm running Tomcat via the startup.bat script. If you're running Tomcat as a service, the service has no access to any drive mappings you've made under your userid. Thanks a nice explanation. I am starting tomcat with tomcat monitor. it seems that it starts tomcat as service. I will try with bat file and let u know. If it does then it will save lot of our time and debugging will also be possible. Thanks and best regards Raja - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Putting Docbase on network drive. Is it Possible ?
From: R. S. Patil [mailto:kpr.rspa...@gmail.com] Subject: Re: Putting Docbase on network drive. Is it Possible ? where can I get more info about attributes and deployment xml file ? In the docs: http://tomcat.apache.org/tomcat-6.0-doc/config/context.html - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Putting Docbase on network drive. Is it Possible ?
Thank You very much Chuck Caldarale In the docs: http://tomcat.apache.org/tomcat-6.0-doc/config/context.html I just read that and its a very valuable resource. Thanks and best regards Raja - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Putting Docbase on network drive. Is it Possible ?
Hi Chuck Caldarale Works fine for me - as long as I'm running Tomcat via the startup.bat script. If you're running Tomcat as a service, the service has no access to any drive mappings you've made under your userid. Yes it works with startup.bat script. I just tested it and found mapped drives also work. Thanks for tip. BTW I have a small difficulty. I ran the startup script in a terminal window. The terminal window wont come back to prompt as it does on Linux. For shutting down I have to open another window. Is it Normal or it has any other work around ? Suppose if I have to restart tomcat what I have to do ? simply close startup terminal window and in another terminal window fire startup again ? Thanks and best regards. RAJA - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Putting Docbase on network drive. Is it Possible ?
R. S. Patil wrote: Hi Chuck Caldarale Works fine for me - as long as I'm running Tomcat via the startup.bat script. If you're running Tomcat as a service, the service has no access to any drive mappings you've made under your userid. Yes it works with startup.bat script. I just tested it and found mapped drives also work. Thanks for tip. BTW I have a small difficulty. I ran the startup script in a terminal window. The terminal window wont come back to prompt as it does on Linux. For shutting down I have to open another window. Is it Normal or it has any other work around ? Did you try CTRL-C in the command window ? Suppose if I have to restart tomcat what I have to do ? simply close startup terminal window and in another terminal window fire startup again ? Thanks and best regards. RAJA - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Putting Docbase on network drive. Is it Possible ?
From: R. S. Patil [mailto:kpr.rspa...@gmail.com] Subject: Re: Putting Docbase on network drive. Is it Possible ? I ran the startup script in a terminal window. The terminal window wont come back to prompt as it does on Linux. For shutting down I have to open another window. Is it Normal or it has any other work around ? No, that's not normal. The startup.bat script uses the Windows start command to initiate the Tomcat process in a command window separate from the one the script is running in. The original command window should return a prompt almost immediately after displaying four Using xxx lines. If it doesn't do that, someone has modified - and broken - your startup.bat or catalina.bat scripts. Download a fresh copy of Tomcat and compare what you have with the unmodified copy. As André noted, CTRL-C can be used to cleanly terminate the Tomcat process when you've terminated the original command window. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Putting Docbase on network drive. Is it Possible ?
On Sat, Nov 21, 2009 at 12:56 AM, Caldarale, Charles R chuck.caldar...@unisys.com wrote: From: R. S. Patil [mailto:kpr.rspa...@gmail.com] Subject: Re: Putting Docbase on network drive. Is it Possible ? I ran the startup script in a terminal window. The terminal window wont come back to prompt as it does on Linux. For shutting down I have to open another window. Is it Normal or it has any other work around ? No, that's not normal. The startup.bat script uses the Windows start command to initiate the Tomcat process in a command window separate from the one the script is running in. The original command window should return a prompt almost immediately after displaying four Using xxx lines. If it doesn't do that, someone has modified - and broken - your startup.bat or catalina.bat scripts. Download a fresh copy of Tomcat and compare what you have with the unmodified copy. well the window from which catalina start command has been fired comes to command prompt after showing four lines but it opens another window which shows startup log remains open and if I close that Tomcat terminates. I tried with .zip installation but matter remains the same. Main terminal window comes to prompt and even it is closed tomcat keeps running. But it opens another window which remains open and it contains startup log. If I press ^C in that window tomcat terminates same if I close that window. As André noted, CTRL-C can be used to cleanly terminate the Tomcat process when you've terminated the original command window. raja - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Putting Docbase on network drive. Is it Possible ?
R. S. Patil wrote: well the window from which catalina start command has been fired comes to command prompt after showing four lines but it opens another window which shows startup log remains open and if I close that Tomcat terminates. In the same window where you entered startup.bat to start Tomcat, enter shutdown.bat to terminate the Tomcat running in the other window. Alternatively, entering CTRL-C in the command window where Tomcat itself is running, also shuts down that Tomcat cleanly. Simply closing the window where Tomcat is running, may not do a clean shutdown. Yet another way to shut down Tomcat : - have a look at the file (tomcat_install_dir)/conf/server.xml - there is a tag in it like this : Server port=8005 shutdown=SHUTDOWN It means that if you open a TCP connection to localhost, port 8005, and send the string SHUTDOWN on that connection, Tomcat will shut down. You can change the port and the string to what you prefer, like Server port=8999 shutdown=stopnow As a security, Tomcat will only accept a connection on that shutdown port, if it originates from localhost (the same machine). - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Putting Docbase on network drive. Is it Possible ?
From: R. S. Patil [mailto:kpr.rspa...@gmail.com] Subject: Re: Putting Docbase on network drive. Is it Possible ? well the window from which catalina start command has been fired comes to command prompt after showing four lines but it opens another window which shows startup log remains open and if I close that Tomcat terminates. Exactly as expected and previously described. Closing the Tomcat process window by any means other than CTRL-C or the shutdown.bat script is not recommended, since that will be an abrupt termination rather than an orderly shutdown. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Putting Docbase on network drive. Is it Possible ?
Thanks André Warnier well the window from which catalina start command has been fired comes to command prompt after showing four lines but it opens another window which shows startup log remains open and if I close that Tomcat terminates. In the same window where you entered startup.bat to start Tomcat, enter shutdown.bat to terminate the Tomcat running in the other window. it seems that when startup.bat or catalina run/start is run a separate window or same window remains open, and its a normal behavior. I have already tried catalina stop in window where catalina start was fired and it closes the window showing startup log after showing closing log. Alternatively, entering CTRL-C in the command window where Tomcat itself is running, also shuts down that Tomcat cleanly. Simply closing the window where Tomcat is running, may not do a clean shutdown. yes I tried ^c also in window showing log it closes after showing closing log. Thanks for tip about closing the log window. Yet another way to shut down Tomcat : - have a look at the file (tomcat_install_dir)/conf/server.xml - there is a tag in it like this : Server port=8005 shutdown=SHUTDOWN It means that if you open a TCP connection to localhost, port 8005, and send the string SHUTDOWN on that connection, Tomcat will shut down. You can change the port and the string to what you prefer, like Server port=8999 shutdown=stopnow As a security, Tomcat will only accept a connection on that shutdown port, if it originates from localhost (the same machine). thanks you for this golden information I will keep in this mind and try this also. After couple of weeks struggling with Tomcat on Linux and Windows, Today I have got lot of knowledge about Tomcat basics by very kind ppl. Thanks a lot for that. You have made my day. i have got eclipse working on Linux and windows. Now I will try with some spring examples from the book. Thanks and best regards Raja. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Tomcat 6 Context, docBase and path
Sorry if this is a common question, I didn't find anything like it by Google. In a Tomcat 6, I have a Context declaration in server.xml with a path and a docBase to a war file with a different name than the path: Context path=/jforum docBase=jforum-2.1.8 ... /Context When the webapp is deployed, two directories are created under webapps: webapps/jforum webapps/jforum-2.1.8 I suspect that there is a clever way to avoid this duplication, but cannot find how. -- mogul | nils weinander | hudiksvallsgatan 4 113 30 stockholm sweden | +46 8 4100 6456 | +46 709 78 28 37 | nils.weinan...@mogul.com | skype: nils.weinander | www.mogul.com - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat 6 Context, docBase and path
From: Nils Weinander [mailto:nils.weinan...@mogul.com] Subject: Tomcat 6 Context, docBase and path Sorry if this is a common question, I didn't find anything like it by Google. Reading the actual Tomcat doc and FAQ is probably more productive. In a Tomcat 6, I have a Context declaration in server.xml That's a bad idea right off; there shouldn't be any Context elements in server.xml. with a path and a docBase to a war file with a different name than the path: If you insist on having the webapp name be different than its URI path, you must keep the webapp outside of the Host appBase directory, and place the Context element in conf/Catalina/[host]/[appName].xml. The Context element must include the docBase attribute pointing to the absolute location of the webapp, and the path attribute must *not* be used. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [SPAM] - RE: Tomcat 6 Context, docBase and path - Found word(s) if you received this in error in the Text body
Caldarale, Charles R wrote: From: Nils Weinander [mailto:nils.weinan...@mogul.com] Subject: Tomcat 6 Context, docBase and path Sorry if this is a common question, I didn't find anything like it by Google. Reading the actual Tomcat doc and FAQ is probably more productive. Tried that too... In a Tomcat 6, I have a Context declaration in server.xml That's a bad idea right off; there shouldn't be any Context elements in server.xml. I know, but as I read the docs, that's primarily if you need to modify contexts without restarting Tomcat and this isn't needed here. Any other reasons? with a path and a docBase to a war file with a different name than the path: If you insist on having the webapp name be different than its URI path, you must keep the webapp outside of the Host appBase directory, and place the Context element in conf/Catalina/[host]/[appName].xml. The Context element must include the docBase attribute pointing to the absolute location of the webapp, and the path attribute must *not* be used. Thanks! -- mogul | nils weinander | hudiksvallsgatan 4 113 30 stockholm sweden | +46 8 4100 6456 | +46 709 78 28 37 | nils.weinan...@mogul.com | skype: nils.weinander | www.mogul.com - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat 6 Context, docBase and path
From: Nils Weinander [mailto:nils.weinan...@mogul.com] Subject: Re: [SPAM] - RE: Tomcat 6 Context, docBase and path - Found word(s)if you received this in error in the Text body I know, but as I read the docs, that's primarily if you need to modify contexts without restarting Tomcat and this isn't needed here. Any other reasons? Avoiding double deployments for one, as you have discovered... - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Problem with respecting docBase in context file in TC 6.0.20?
You may have already figured this out, but just in case: 1) The path attribute of a Context element may only be used when the Context element is nested inside a Host element in server.xml - which is strongly discouraged. 2) The docBase attribute of a Context element may only be used when a) the webapp is located outside of the Host appBase directory, *and* b) when the Context element is in conf/Catalina/[host]/[appName].xml or is in server.xml (again, the latter is strongly discouraged). Results are not predictable for any other usage of those attributes. Thanks, Chuck and Mark, for your quick responses to my questions. I imagine this comes up often. It'd be nice if Tomcat would throw a warning when it knows these rules are being violated. Thanks, RP - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Problem with respecting docBase in context file in TC 6.0.20?
Problem: 1) /usr/tomcat/conf/Catalina/localhost/t.xml has: Context path=/t docBase=webapps/a / 2) /usr/tomcat/webapps/a exists. 3) /usr/tomcat/webapps/t does not exist. 4) When tomcat starts, org.apache.catalina.core.StandardContext:resourcesStart() throws java.lang.IllegalArgumentException: Document base /usr/tomcat/webapps/t does not exist or is not a readable directory Since I never gave it a docBase of /usr/tomcat/webapps/t, I presume the problem is that it expects one due to the presense of /usr/tomcat/conf/catalina/localhost/t.xml ? How can I get it to not make such a presumption, and look at the docBase in the t.xml file? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Problem with respecting docBase in context file in TC 6.0.20?
I also tried renaming /usr/tomcat/conf/Catalina/localhost/t.xml to /usr/tomcat/conf/Catalina/localhost/a.xml and now no exception is thrown, and I see via tomcat manager that context /a is created, but whenever I try to access any pages under /t I get error 404. --- On Wed, 8/19/09, Roger Powers prog...@yahoo.com wrote: From: Roger Powers prog...@yahoo.com Subject: Problem with respecting docBase in context file in TC 6.0.20? To: users@tomcat.apache.org Date: Wednesday, August 19, 2009, 3:19 PM Problem: 1) /usr/tomcat/conf/Catalina/localhost/t.xml has: Context path=/t docBase=webapps/a / 2) /usr/tomcat/webapps/a exists. 3) /usr/tomcat/webapps/t does not exist. 4) When tomcat starts, org.apache.catalina.core.StandardContext:resourcesStart() throws java.lang.IllegalArgumentException: Document base /usr/tomcat/webapps/t does not exist or is not a readable directory Since I never gave it a docBase of /usr/tomcat/webapps/t, I presume the problem is that it expects one due to the presense of /usr/tomcat/conf/catalina/localhost/t.xml ? How can I get it to not make such a presumption, and look at the docBase in the t.xml file? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Problem with respecting docBase in context file in TC 6.0.20?
From: Roger Powers [mailto:prog...@yahoo.com] Subject: Problem with respecting docBase in context file in TC 6.0.20? How can I get it to not make such a presumption, and look at the docBase in the t.xml file? You may have already figured this out, but just in case: 1) The path attribute of a Context element may only be used when the Context element is nested inside a Host element in server.xml - which is strongly discouraged. 2) The docBase attribute of a Context element may only be used when a) the webapp is located outside of the Host appBase directory, *and* b) when the Context element is in conf/Catalina/[host]/[appName].xml or is in server.xml (again, the latter is strongly discouraged). Results are not predictable for any other usage of those attributes. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
SEVERE: Exception fixing docBase: {0} on Windows XP
Have a war file that works fine when installed on Windows 2003, Windows 2000, Windows Vista and Windows XP end-user environments. Have a Windows XP user receiving the below message. The war file is installed on the local hard drive. The error is received when: 1) Tomcat is started as a Windows service. The war file was copied to webapps directory prior to start of Tomcat. And if. 2) if the war file is dropped into the webapps directory when the Tomcat Windows service is running. SEVERE: Exception fixing docBase: {0} java.util.zip.ZipException: Access is denied. Any suggestions on how to resolve this issue would be appreciated. Joe -- View this message in context: http://www.nabble.com/SEVERE%3A-Exception-fixing-docBase%3A-%7B0%7D-on-Windows-XP-tp21020509p21020509.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: SEVERE: Exception fixing docBase: {0} on Windows XP
From: joe_77 [mailto:joseph_freema...@yahoo.com] Subject: SEVERE: Exception fixing docBase: {0} on Windows XP SEVERE: Exception fixing docBase: {0} java.util.zip.ZipException: Access is denied. The error message seems pretty descriptive. Have you checked that the account Tomcat is running under has permission to read the .war 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org