context.xml in META-INF
Hello: I'm using Tomcat 6.0.23 . Yes, I know it's an old release I would like to use - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: context.xml in META-INF
Please ingnore this. There was a typo in the filename thats why it wasnt working. Thanks On Thu, Oct 9, 2008 at 5:17 PM, Ziggy <[EMAIL PROTECTED]> wrote: > Hi all, > > I have the following datasource definition in my /META-INF/context.xml > >type="javax.sql.DataSource" > driverClassName="oracle.jdbc.driver.OracleDriver" > url="jdbc:oracle:thin:@10.10.10.10:1521:testdb" > username="testuser" password="testuser" maxActive="20" > maxIdle="10" > maxWait="-1"/> > > For some reason the above does not work when i deploy the .war file. > It does however work if i rename the context.xml file into > [applicationname].xml and put it into $TOMCAT_HOME/catalina/localhost/ > > Does anyone know why it doesnt work if in app/META-INF/context.xml? > > I am using tomcat 5.5 > > Thanks >
context.xml in META-INF
Hi all, I have the following datasource definition in my /META-INF/context.xml For some reason the above does not work when i deploy the .war file. It does however work if i rename the context.xml file into [applicationname].xml and put it into $TOMCAT_HOME/catalina/localhost/ Does anyone know why it doesnt work if in app/META-INF/context.xml? I am using tomcat 5.5 Thanks
Re: placing context.xml in META-INF works?
Hello, you are correct on both parts. Thanks for the tip, I will make sure to fix that. Also the method I tried worked just fine. My next test is to see if I can create diffrent context with the same war, then edit the resulting context.xml files to have diffrent db files. this way I can host several of the same apps with diffrent db's on our servers for demo purposes. Mike - Original Message From: Steffen Heil <[EMAIL PROTECTED]> To: Tomcat Users List Sent: Thursday, October 19, 2006 5:45:37 AM Subject: RE: placing context.xml in META-INF works? Hi > 2) User places our clean database file in the "recommended > location on the server machine. i.e c"\databse\ourfile.gdb" A off-topic side note on this: The c and the backslashes suggest you are using windows. The gdb extension suggest you are using firebird or interbase. My recommendation: Change the extension to fdb, as gdb is handled specially by windows system restore and you might end up having clients whose computers back up a copy the the database to system restore on any webapp restart... Se firebird lists for more details. Regards, Steffen
RE: placing context.xml in META-INF works?
Hi > 2) User places our clean database file in the "recommended > location on the server machine. i.e c"\databse\ourfile.gdb" A off-topic side note on this: The c and the backslashes suggest you are using windows. The gdb extension suggest you are using firebird or interbase. My recommendation: Change the extension to fdb, as gdb is handled specially by windows system restore and you might end up having clients whose computers back up a copy the the database to system restore on any webapp restart... Se firebird lists for more details. Regards, Steffen smime.p7s Description: S/MIME cryptographic signature
Re: placing context.xml in META-INF works?
Caldarale, Charles R a écrit : From: Michael Courcy [mailto:[EMAIL PROTECTED] Subject: Re: placing context.xml in META-INF works? How do you manage the problem, if you need to define a Host element whith many Alias ? Hosts are a completely different problem, since they are not subordinate to an app. Can you put the definition of your Host element in %TOMCAT_HOME%/conf/[ENGINE]/[HOST]/myApp.xml, and nest the context definition inside the host definition ? No. Check the doc for the proper hierarchy of elements. You can programmatically add hosts on the fly - the admin app does it. - Chuck Ok thanks.
RE: placing context.xml in META-INF works?
> From: Michael Courcy [mailto:[EMAIL PROTECTED] > Subject: Re: placing context.xml in META-INF works? > > How do you manage the problem, if you need to define a Host element > whith many Alias ? Hosts are a completely different problem, since they are not subordinate to an app. > Can you put the definition of your Host element in > %TOMCAT_HOME%/conf/[ENGINE]/[HOST]/myApp.xml, and nest the context > definition inside the host definition ? No. Check the doc for the proper hierarchy of elements. You can programmatically add hosts on the fly - the admin app does it. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: placing context.xml in META-INF works?
> From: Michael Hencin [mailto:[EMAIL PROTECTED] > Subject: RE: placing context.xml in META-INF works? > > My ideal sequence of events is this. > 1) User installs tomcat > 2) User places our clean database file in the "recommended > location on the server machine. i.e c"\databse\ourfile.gdb" > 3) User drops our war file into the webapps directory. It > expands, copies the context.xml file we pre-configure with > the db file location from step 2. > 4 ) user can then fire up our app. And it connects ok to the db. The copy of context.xml in step 3 is not required for proper deployment - the values in the META-INF/context.xml will still be available to the application. > If we can include a preconfigured contxt.xml, and have it > used when the app is deployed, it would then not require > the user to setup the context JNDI, or a global one. Placing your context.xml in the META-INF directory of your webapp will allow you to do that - no other steps are required. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: placing context.xml in META-INF works?
Because you have to restart Tomcat if you make any changes to server.xml - it's only read during initialization. Consequently, updating the app on the fly when its tag is in server.xml is not possible. To quote from the doc: ok Actually I'm not pretty sure to be ok. How do you manage the problem, if you need to define a Host element whith many Alias ? Can you put the definition of your Host element in %TOMCAT_HOME%/conf/[ENGINE]/[HOST]/myApp.xml, and nest the context definition inside the host definition ? Mic. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: placing context.xml in META-INF works?
Our webapp is given to many discrete clients with their own networks. Often these users do not have tomcat at all. Our application requires it. Therefore the IT guy has to install tomcat when they get our web app. And they are not familiar with the ins and outs of tomcat at all. My ideal sequence of events is this. 1) User installs tomcat 2) User places our clean database file in the "recommended location on the server machine. i.e c"\databse\ourfile.gdb" 3) User drops our war file into the webapps directory. It expands, copies the context.xml file we pre-configure with the db file location from step 2. 4 ) user can then fire up our app. And it connects ok to the db. I would prefer not to instruct the user to create a global JNDI, or a context level JNDI using the tomcat/admin app. Not because they can't but to reduce the number of steps and or sources of user input error. These are our number one source of installation/deployment hiccups. If we can include a preconfigured contxt.xml, and have it used when the app is deployed, it would then not require the user to setup the context JNDI, or a global one. Frankly I don't care if its global or context level. I just want it to work. -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 18, 2006 5:49 PM To: Tomcat Users List Subject: RE: placing context.xml in META-INF works? > From: Christopher Schultz [mailto:[EMAIL PROTECTED] > Subject: Re: placing context.xml in META-INF works? > > I get that, but it sounds like that's exactly what this guy wants: > configuration that is available to all of his webapps, and never > changes. If it smells like a global resource...? I didn't read it that way. My interpretation was that he wanted something accesible to all his _customers_ (each with their own server), not multiple webapps. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: placing context.xml in META-INF works?
Caldarale, Charles R a écrit : From: Michael Courcy [mailto:[EMAIL PROTECTED] Subject: Re: placing context.xml in META-INF works? Take out the path attribute - it's not allowed unless the element is in server.xml, which is strongly discouraged. why ? Because you have to restart Tomcat if you make any changes to server.xml - it's only read during initialization. Consequently, updating the app on the fly when its tag is in server.xml is not possible. To quote from the doc: ok
RE: placing context.xml in META-INF works?
> From: Christopher Schultz [mailto:[EMAIL PROTECTED] > Subject: Re: placing context.xml in META-INF works? > > I get that, but it sounds like that's exactly what this guy wants: > configuration that is available to all of his webapps, and never > changes. If it smells like a global resource...? I didn't read it that way. My interpretation was that he wanted something accesible to all his _customers_ (each with their own server), not multiple webapps. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: placing context.xml in META-INF works?
Chuck, >> Isn't this what conf/server.xml is for? I mean, I'm no Tomcat 5.x >> expert, but that's what I'd do way back here in Tomcat 4.1. > > Things have changed. Global resources should be defined in server.xml, > but app-specific ones belong in the element for that app. > Specifying them globally makes it much more difficult to modify the > resource attributes without bringing down the whole server. I get that, but it sounds like that's exactly what this guy wants: configuration that is available to all of his webapps, and never changes. If it smells like a global resource...? -chris signature.asc Description: OpenPGP digital signature
RE: placing context.xml in META-INF works?
> From: Christopher Schultz [mailto:[EMAIL PROTECTED] > Subject: Re: placing context.xml in META-INF works? > > Isn't this what conf/server.xml is for? I mean, I'm no Tomcat 5.x > expert, but that's what I'd do way back here in Tomcat 4.1. Things have changed. Global resources should be defined in server.xml, but app-specific ones belong in the element for that app. Specifying them globally makes it much more difficult to modify the resource attributes without bringing down the whole server. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: placing context.xml in META-INF works?
> From: Michael Courcy [mailto:[EMAIL PROTECTED] > Subject: Re: placing context.xml in META-INF works? > > > Take out the path attribute - it's not allowed unless the > > element is in server.xml, which is strongly discouraged. > > > why ? Because you have to restart Tomcat if you make any changes to server.xml - it's only read during initialization. Consequently, updating the app on the fly when its tag is in server.xml is not possible. To quote from the doc: "See Automatic Application Deployment for more information. This method allows dynamic reconfiguration of the web application, since the main conf/server.xml file cannot be reloaded without restarting Tomcat. Please note that for tomcat 5, unlike tomcat 4.x, it is NOT recommended to place elements directly in the server.xml file. Instead, put them in the META-INF/context.xml directory of your WAR file or the conf directory as described above." http://tomcat.apache.org/tomcat-5.5-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 start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: placing context.xml in META-INF works?
Michael, > I want to "pre-setup" the configuration. I enter all the parameters, > for the JDNCI info, and then the user only needs to install the > webapp and if they use the default database location setting, it > would work. Isn't this what conf/server.xml is for? I mean, I'm no Tomcat 5.x expert, but that's what I'd do way back here in Tomcat 4.1. What's the difference between a "webapp template" and server-wide configuration. Same thing, right? -chris signature.asc Description: OpenPGP digital signature
Re: placing context.xml in META-INF works?
Take out the path attribute - it's not allowed unless the element is in server.xml, which is strongly discouraged. why ? Mic - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: placing context.xml in META-INF works?
> From: Michael Hencin [mailto:[EMAIL PROTECTED] > Subject: RE: placing context.xml in META-INF works? > > Also my target users are not tomcat savvy. So the less they > need to do, the better. Having a "pre-configured" context > file get deployed the first time, makes it easy. They just > drop our war file, place the db file on the file system in > the location we specify in the "pre-configured" context.xml > and it should work out of the gate. Which will work fine without the context.xml being copied anywhere. I don't see why you're hung up on having it in the conf/[engine]/[host] directory - the parameters and attributes are still in effect when the file is in webapps/[appname]/META-INF/context.xml (or .war equivalent). - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: placing context.xml in META-INF works?
Also my target users are not tomcat savvy. So the less they need to do, the better. Having a "pre-configured" context file get deployed the first time, makes it easy. They just drop our war file, place the db file on the file system in the location we specify in the "pre-configured" context.xml and it should work out of the gate. Mike -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 18, 2006 2:44 PM To: Tomcat Users List Subject: RE: placing context.xml in META-INF works? > From: Michael Hencin [mailto:[EMAIL PROTECTED] > Subject: RE: placing context.xml in META-INF works? > > I want this context file to be copied to the > $CATALINA_HOME/conf/Catalina/localhost/ directory do that > the users can use the default JNDI and env values I enter. Why does the location of the file containing the element have anything to do with what JNDI references your users have access to? - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: placing context.xml in META-INF works?
I want to "pre-setup" the configuration. I enter all the parameters, for the JDNCI info, and then the user only needs to install the webapp and if they use the default database location setting, it would work. Resource auth="Container" name="octane" type="javax.sql.Datasource"/> maxWait 5000 maxActive 20 password pasvallue url jdbc:firebirdsql:localhost/3050:c:/Octane/Database/octane.gdb driverClassName org.firebirdsql.jdbc.FBDriver maxIdle 12 username SYSDBA So I can have a URL value that expect the database file on the local file system. Provided the user places our db file there, then they would not need to modify any other setting in the web app. It would connect. Mike -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 18, 2006 2:44 PM To: Tomcat Users List Subject: RE: placing context.xml in META-INF works? > From: Michael Hencin [mailto:[EMAIL PROTECTED] > Subject: RE: placing context.xml in META-INF works? > > I want this context file to be copied to the > $CATALINA_HOME/conf/Catalina/localhost/ directory do that > the users can use the default JNDI and env values I enter. Why does the location of the file containing the element have anything to do with what JNDI references your users have access to? - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: placing context.xml in META-INF works?
> From: Michael Hencin [mailto:[EMAIL PROTECTED] > Subject: RE: placing context.xml in META-INF works? > > I want this context file to be copied to the > $CATALINA_HOME/conf/Catalina/localhost/ directory do that > the users can use the default JNDI and env values I enter. Why does the location of the file containing the element have anything to do with what JNDI references your users have access to? - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: placing context.xml in META-INF works?
I have a similar need. I have a context file with a JNDI resource, and some env entries. I want this context file to be copied to the $CATALINA_HOME/conf/Catalina/localhost/ directory do that the users can use the default JNDI and env values I enter. My app exisits within the appbase and I want this context file to be copied to the $CATALINA_HOME/conf/Catalina/localhost/ directory when my webapp is deployed. Mike -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 18, 2006 1:28 PM To: Tomcat Users List Subject: RE: placing context.xml in META-INF works? > From: Jason Novotny [mailto:[EMAIL PROTECTED] > Subject: placing context.xml in META-INF works? > > I have a context.xml file that looks basically like this: > > crossContext="true"/> Take out the path attribute - it's not allowed unless the element is in server.xml, which is strongly discouraged. > I was told I could package this in the META-INF directory of > my WAR file and it would get automatically deployed in Tomcat > -- is this correct? Yes - it must be named context.xml when under META-INF. > I tried it but didn't see my context file in the > $CATALINA_HOME/conf/Catalina/localhost/ directory > after starting up... Why do you think you should? It will only be copied there if the webapp resides outside of the declared appBase for the . - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: placing context.xml in META-INF works?
> From: Jason Novotny [mailto:[EMAIL PROTECTED] > Subject: placing context.xml in META-INF works? > > I have a context.xml file that looks basically like this: > > crossContext="true"/> Take out the path attribute - it's not allowed unless the element is in server.xml, which is strongly discouraged. > I was told I could package this in the META-INF directory of > my WAR file and it would get automatically deployed in Tomcat > -- is this correct? Yes - it must be named context.xml when under META-INF. > I tried it but didn't see my context file in the > $CATALINA_HOME/conf/Catalina/localhost/ directory > after starting up... Why do you think you should? It will only be copied there if the webapp resides outside of the declared appBase for the . - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
placing context.xml in META-INF works?
Hi, I have a context.xml file that looks basically like this: In the past using Tomcat 5.5.X I've had to manually copy this file over to $CATALINA_HOME/conf/Catalina/localhost/ and giving it the filename of the context: portal.xml I was told I could package this in the META-INF directory of my WAR file and it would get automatically deployed in Tomcat-- is this correct? I tried it but didn't see my context file in the $CATALINA_HOME/conf/Catalina/localhost/ directory after starting up... Thanks, Jason - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]