Re: Tomcat 6 Context not created, deployment fails
Mark Thomas markt at apache.org writes: On 22/03/2011 21:53, Billy Bacon wrote: Awesome Mark, that worked perfectly! I'd like to actually run the app out of the war file without exploding it and I was able to accomplish this by setting unpackWARs=false in the server.xml. It shouldn't be doing that if the WAR is outside the appBase. That loks like a bug. Tomcat 7 was doing this and I fixed that fairly recently. I know this isn't 'preferred' but how would I go about 'hot-patching' let's say a JSP for the webapp in this setup? Typically I do this within the exploded directory and the next time the JSP is requested, it re-compiles and life is good. In that case you'll have to expand your WAR and set the docBase to the expanded directory. Regarding the documentation... I think it's great. I think a concrete example and mentioning (with an example) that the docBase needs to be outside of the 'webapps' directory would have prevented me from mailing the alias. I think I was close with what I originally had using the docs alone but it wasn't clear to me that the docBase needed to be outside of the appBase. The relevant docs are: http://tomcat.apache.org/tomcat-7.0- doc/config/host.html#Automatic%20Application%20Deployment and http://tomcat.apache.org/tomcat-7.0-doc/config/context.html There is certainly scope in there for a sentence or two about deploying a WAR/directory under a context path not related to its name and/or deploying a WAR/directory it multiple times. Drafts welcome. Mark Hi Mark, In regards to your recommendations, the documentation and in line with multiple contexts sharing a single war file: - the situation is like the one above - there are no crushes, Tomcat works fine - 'docBase' is insensitive to both relative and absolute paths - The issue: only one context can be accessed. Specifics: - Tomcat version: 7.0.12 - Context: multiple, different names (i.e. ACon.xml, BCon2.xml, etc.),path - different, everything else - identical, deployed in the same directory (meta- inf) - the name 'context.xml' MUST be present - other context files accepted but ignored - The Manager indicates only one application available, located at the path of the 'context.xml' - Errors generated if there are more then 1 (one) context / file (i.e. context.xml) - the war file: contains all contexts - we are using NetBeans for development and we haven't had any problems with the two integrated platforms We would appreciate if you can have a look at it when you have a minute and let us know. We assume we make some kind of mistake. Best regards, John - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat 6 Context not created, deployment fails
From: John G. [mailto:unfolding...@gmail.com] Subject: Re: Tomcat 6 Context not created, deployment fails In regards to your recommendations, the documentation and in line with multiple contexts sharing a single war file: - the situation is like the one above Not sure what that means. - there are no crushes, Tomcat works fine Glad that nothing is getting squeezed flat. - 'docBase' is insensitive to both relative and absolute paths Not really true; be very, very careful with relative paths, since the directory you're starting from might not be what you think it is. - The issue: only one context can be accessed. Not sure what that means. You need to provide precise specifics: URL(s) used, statuses received, entries in the log file, etc. - Tomcat version: 7.0.12 Thanks for that; many people forget to tell us. - Context: multiple, different names (i.e. ACon.xml, BCon2.xml, etc.),path - different, everything else - identical, deployed in the same directory (meta-inf) None of the above is actually meaningful to anyone who can't read your mind. - the name 'context.xml' MUST be present Where? - other context files accepted but ignored What other context files do you think there could be? - The Manager indicates only one application available, located at the path of the 'context.xml' Which is where? - Errors generated if there are more then 1 (one) context / file (i.e. context.xml) What errors? How can you have multiple context.xml files in the same directory? - the war file: contains all contexts That makes no sense at all. - we are using NetBeans for development and we haven't had any problems with the two integrated platforms No idea what that means or if it's relevant. Unless we can use the Pidster's crystal ball, it's very difficult to be sure what you're trying to do. If you want to have a single .war file deployed under multiple URL paths, do the following: 1) Place the .war file outside of the Host appBase directory. 2) Create one file for each desired URL path in Tomcat's conf/Catalina/[host] directory, using the desired path as the name of the file with a .xml extension. 3) The contents of each of the files from #2 must be a single Context element, with a docBase attribute pointing to the location of the .war file. The path attribute must not be used, but other attributes may. 4) Any META-INF/context.xml file inside the .war will be ignored. - 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 6 Context not created, deployment fails
On 22/03/2011 22:04, Mark Thomas wrote: There is certainly scope in there for a sentence or two about deploying a WAR/directory under a context path not related to its name and/or deploying a WAR/directory it multiple times. Drafts welcome. I added some more info: http://ci.apache.org/projects/tomcat/tomcat7/docs/config/context.html This will be included in 7.0.12 onwards. Patches etc. welcome. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 6 Context not created, deployment fails
On 22/03/2011 20:14, Billy Bacon wrote: Does anyone know what I'm doing wrong? Move the WAR file *outside* of the host's appBase (i.e. not in the webapps directory) and specify the docBase in your context.xml files. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 6 Context not created, deployment fails
Thanks so much for the reply Mark. I did the following and I'm still getting issues. Note I tried 2 things: 1st: - created $CATALINA_HOME/wars and placed the onlinecourses.war file in there - cleaned out all old files from $CATALINA_HOME/work/... $CATALINA_HOME/webapps - removed onlinecourses.war from webapps - added docBase to Context element and set it to onlinecourses Errors occurred like before indicating that /webapps/wars was going to be ignored 2nd: So I then tried using an absolute path for the docBase in the Context. Context docBase=/usr/local/tomcat8081/wars That seemed to get rid of all the Tomcat errors and it appears that it worked but I cannot hit the webapp. I get a 404 from Tomcat when I try to hit: http://localhost:8081/onlinecourses/insight I even looked at Tomcat Manager and it says the webapps is Started just fine. Any ideas? Also, is the way I have things configured right now the preferred approach? Thanks! On Mar 22, 2011, at 2:17 PM, Mark Thomas wrote: On 22/03/2011 20:14, Billy Bacon wrote: Does anyone know what I'm doing wrong? Move the WAR file *outside* of the host's appBase (i.e. not in the webapps directory) and specify the docBase in your context.xml files. Mark - 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: Tomcat 6 Context not created, deployment fails
On 22/03/2011 21:09, Billy Bacon wrote: 2nd: So I then tried using an absolute path for the docBase in the Context. Yes it will need to be absolute. Relative docBases are resolved relative to the Host's appBase. Context docBase=/usr/local/tomcat8081/wars Getting closer. A docBase needs to specify the WAR or directory so you'll need: Context docBase=/usr/local/tomcat8081/wars/onlinecourses.war All of this should be in the docs. If you see any scope for improvement, please let us know. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 6 Context not created, deployment fails
Awesome Mark, that worked perfectly! I'd like to actually run the app out of the war file without exploding it and I was able to accomplish this by setting unpackWARs=false in the server.xml. I know this isn't 'preferred' but how would I go about 'hot-patching' let's say a JSP for the webapp in this setup? Typically I do this within the exploded directory and the next time the JSP is requested, it re-compiles and life is good. Regarding the documentation... I think it's great. I think a concrete example and mentioning (with an example) that the docBase needs to be outside of the 'webapps' directory would have prevented me from mailing the alias. I think I was close with what I originally had using the docs alone but it wasn't clear to me that the docBase needed to be outside of the appBase. Keep in mind I could have overlooked the area where it may clearly state this, it just wasn't apparent to me. It appears that you rarely want to adjust the default 'appBase' (webapps) and I found myself jacking with this value which was probably hosing up my configuration for hours prior to emailing the list. Thanks for all your help on this and please let me know about the unpackWARs configuration. Thanks! On Mar 22, 2011, at 3:14 PM, Mark Thomas wrote: On 22/03/2011 21:09, Billy Bacon wrote: 2nd: So I then tried using an absolute path for the docBase in the Context. Yes it will need to be absolute. Relative docBases are resolved relative to the Host's appBase. Context docBase=/usr/local/tomcat8081/wars Getting closer. A docBase needs to specify the WAR or directory so you'll need: Context docBase=/usr/local/tomcat8081/wars/onlinecourses.war All of this should be in the docs. If you see any scope for improvement, please let us know. Mark - 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: Tomcat 6 Context not created, deployment fails
On 22/03/2011 21:53, Billy Bacon wrote: Awesome Mark, that worked perfectly! I'd like to actually run the app out of the war file without exploding it and I was able to accomplish this by setting unpackWARs=false in the server.xml. It shouldn't be doing that if the WAR is outside the appBase. That loks like a bug. Tomcat 7 was doing this and I fixed that fairly recently. I know this isn't 'preferred' but how would I go about 'hot-patching' let's say a JSP for the webapp in this setup? Typically I do this within the exploded directory and the next time the JSP is requested, it re-compiles and life is good. In that case you'll have to expand your WAR and set the docBase to the expanded directory. Regarding the documentation... I think it's great. I think a concrete example and mentioning (with an example) that the docBase needs to be outside of the 'webapps' directory would have prevented me from mailing the alias. I think I was close with what I originally had using the docs alone but it wasn't clear to me that the docBase needed to be outside of the appBase. The relevant docs are: http://tomcat.apache.org/tomcat-7.0-doc/config/host.html#Automatic%20Application%20Deployment and http://tomcat.apache.org/tomcat-7.0-doc/config/context.html There is certainly scope in there for a sentence or two about deploying a WAR/directory under a context path not related to its name and/or deploying a WAR/directory it multiple times. Drafts welcome. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 6 Context not created, deployment fails
2011/3/23 Mark Thomas ma...@apache.org: On 22/03/2011 21:09, Billy Bacon wrote: 2nd: So I then tried using an absolute path for the docBase in the Context. Yes it will need to be absolute. Relative docBases are resolved relative to the Host's appBase. Context docBase=/usr/local/tomcat8081/wars Getting closer. A docBase needs to specify the WAR or directory so you'll need: Context docBase=/usr/local/tomcat8081/wars/onlinecourses.war If a relative path is needed, you can write Context docBase=${catalina.home}/wars/onlinecourses.war (or with catalina.base if that is relative to $CATALINA_BASE) All of this should be in the docs. If you see any scope for improvement, please let us know. Mark 2011/3/22 Billy Bacon billy.ba...@gmail.com: Tomcat 6.0.26 Java 1.6 OS: Mac OS X and Linux There was a number of fixes between 6.0.26 and the latest 6.0.32... Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org