Mark certain contexts inactive?
Hello, On my development machine, I have created quite a few contexts or webapp instances, and due to that fact, the startup time is increasing. I do not want to remove any of the contexts as they all mean something to me, but I would like to be able to mark them so they do not start up. And then be able to turn them on when needed. Is there a clean way of doing this? Thanks, Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Mark certain contexts inactive?
Hi Scott, On 6 Oct 2005 at 13:43, Scott Purcell wrote: On my development machine, I have created quite a few contexts or webapp instances, and due to that fact, the startup time is increasing. I do not want to remove any of the contexts as they all mean something to me, but I would like to be able to mark them so they do not start up. And then be able to turn them on when needed. Is there a clean way of doing this? Not sure that you can do much at the Context level, but have you looked at the deployOnStartup attribute of the Host element in your server.xml file? As I understand it, if that is set to false, it will prevent a Host from being deployed until the server receives a request for that application. I usually create a new Host for each web application rather than adding contexts under the default host. The only functionality I lose this way is automated deployment of a _new_ application, but the benefits outweigh that loss for me. One benefit is the ability to stop an application from loading up on startup. HTH, Rob Hills Western Australia - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
WARNING: Error registering contexts
Dear Tomcat, Operating system: SunOS 5.8 JDK: j2sdk1.4.2_01 Tomcat: 5.0.28 Logged in as root, upon startup, I am getting the following exception from my tomcat container: Sep 20, 2005 1:59:17 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-5028 Sep 20, 2005 1:59:17 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Sep 20, 2005 1:59:17 PM org.apache.coyote.tomcat5.MapperListener init WARNING: Error registering contexts java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(HashMap.java:782) at java.util.HashMap$EntryIterator.next(HashMap.java:824) at java.util.HashMap.putAllForCreate(HashMap.java:424) at java.util.HashMap.clone(HashMap.java:656) at mx4j.server.DefaultMBeanRepository.clone(DefaultMBeanRepository.java:56) at mx4j.server.MBeanServerImpl.findMBeansByPattern(MBeanServerImpl.java:160 3) at mx4j.server.MBeanServerImpl.queryObjectNames(MBeanServerImpl.java:1568) at mx4j.server.MBeanServerImpl.queryMBeans(MBeanServerImpl.java:1512) at org.apache.coyote.tomcat5.MapperListener.init(MapperListener.java:115) at org.apache.coyote.tomcat5.CoyoteConnector.start(CoyoteConnector.java:153 7) at org.apache.catalina.core.StandardService.start(StandardService.java:489) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) at org.apache.catalina.startup.Catalina.start(Catalina.java:556) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425) Sep 20, 2005 1:59:17 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-80 Sep 20, 2005 1:59:17 PM org.apache.coyote.tomcat5.MapperListener init WARNING: Error registering contexts java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(HashMap.java:782) at java.util.HashMap$EntryIterator.next(HashMap.java:824) at java.util.HashMap.putAllForCreate(HashMap.java:424) at java.util.HashMap.clone(HashMap.java:656) at mx4j.server.DefaultMBeanRepository.clone(DefaultMBeanRepository.java:56) at mx4j.server.MBeanServerImpl.findMBeansByPattern(MBeanServerImpl.java:160 3) at mx4j.server.MBeanServerImpl.queryObjectNames(MBeanServerImpl.java:1568) at mx4j.server.MBeanServerImpl.queryMBeans(MBeanServerImpl.java:1512) at org.apache.coyote.tomcat5.MapperListener.init(MapperListener.java:115) at org.apache.coyote.tomcat5.CoyoteConnector.start(CoyoteConnector.java:153 7) at org.apache.catalina.core.StandardService.start(StandardService.java:489) at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) at org.apache.catalina.startup.Catalina.start(Catalina.java:556) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425) Sep 20, 2005 1:59:17 PM org.apache.jk.common.ChannelSocket init INFO: JK2: ajp13 listening on /0.0.0.0:8009 Sep 20, 2005 1:59:17 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=2/74 config=/opt/gsp/tomcat-5.0.28/conf/jk2.properties Sep 20, 2005 1:59:18 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 376219 ms Please help, Dominic
How to define contexts?
Hassan, Well, maybe I misunderstood the original question :-) No, it's just me unfamiliar with the idea of contexts. So far I've figured out that there is a file context.xml that can define extra parameters for an application, but I'm not sure about: 1) Whether it's possible to direct two contexts at the same codebase. I'm looking at Catalina/localhost/manager.xml and host-manager.xml, and they use different codebases. 2) How to tie a particular context to a particular URL, as you indicate below. Currently I have dev and www DNS aliases both pointing to virtual host in apache, and these hosts ProxyPass everything to two different Tomcat applications (/dev and /pro). Ideally, I'd like to have one Tomcat application, but I'm not sure how to list two contexts for one application. Thanks, Simon My presumption was that the same code exists at, say, http://dev.example.com/ and http://www.example.com which are clearly different Contexts, even if they're on the same machine being run as virtual hosts. So each Context has a Resource addressing the appropriate DB. -- Simon (Vsevolod ILyushchenko) [EMAIL PROTECTED] http://www.simonf.com Terrorism is a tactic and so to declare war on terrorism is equivalent to Roosevelt's declaring war on blitzkrieg. Zbigniew Brzezinski, U.S. national security advisor, 1977-81 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Same servlets in 2 contexts. Update 1 of them, not reloaded on context reload
Hi All, I am having a problem with Tomcat. I have a website application that I use over 2 aplications. 1 context I use for testing and the other is meant for vistors (live version). This means that the same application is running over 2 contexts . When I update a servlet in the test context and then reload the test context the update isnt loaded. For example: I have the exact same servlet in the test and live context. I then update the servlet in the test context by adding the following code System.out.println(Updated servlet); to the doGet function of the servlet. I then reload the test context. The situation at this point is that the test context has the updated servlet and that the live context has the older version of the servlet. When the servlet is executed in the test context the text 'Updated servlet' doesnt appear in the catalina.out file. If the servlet had been reloaded correctly then the test context should have printed 'Updated servlet' to the catalina.out file everytime the servlet is executed (Called via the get method). This makes me beleive that there is something very wrong with tomcat, that it cant keep a clear difference between the same servlet (although slightly modified) over different contexts. I am using jakarta-tomcat-5.0.27 and j2sdk1.4.2 on debian sarge. A tomcat restart by the way does solve the problem but thats not a solution for me. Thanks, Martyn - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
wrapping contexts
Hi, this is pretty much a dummy question I think. I'm running Tomcat standalone for several websites. I have several webapps running which I want to share across various websites; an email app, file management app, message board, photo/blog, etc etc. What is the proper way to configure things to be shared, along with look and feel, ie to wrap the various apps inside each website? I don't want to get into a portlet container, but perhaps that's what I need to do? Right now I am using an ugly kluge of IFRAMEs and parameters to markup the look and feel. Many thanks for a primer. pete - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
tc 5.5.x subdirectory contexts?
hihi all, i'm using Tomcat 5.5.9 and i can't figure out how to setup a URL like this: http://localhost:8080/subdirectory/myapp in the $CATALINA_HOME/conf/[enginename]/[hostname] directory i have placed myapp.xml but that only works with the following: http://localhost:8080/myapp i tried setting the path attribute of my context with a value of /subdirectory/myapp but it didn't work. (actually, this path attribute seems to be ignored... the context element filename is what seems to be followed by Tomcat) i also tried creating a $CATALINA_HOME/conf/[enginename]/[hostname]/subdirectory folder and placing myapp.xml there but that doesn't work either. http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html doesn't seem to have info on how to do this. anyone know? thanks in advance, woodchuck __ Yahoo! Mail Stay connected, organized, and protected. Take the tour: http://tour.mail.yahoo.com/mailtour.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
how to unify multiple contexts
We have multiple servlets that i wish to unify under a single context. That is, I want to get rid of the legacy servlets and introduce a dispatcher servlet to handle all the different functions under a single context. The problem is that this will break legacy apps that expect the old contexts. I've considered sending redirect requests to any client using the old contexts but some of the devices connecting to our system may not be fully http capable. Is there anything in tomcat that could be used? Some settings or someway of rewriting requests? thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
multiple contexts
Hi, I am running Tomcat 5.0.28. Our setup is somewhat similar to Virtual hosting company. When a new user signs up, user's site is accessible through localhost.com/user1 and after user registers the domain name site is also available through user1.com. My problem is that it seem to be double the load, each application is deployed twice. 1. Application is deployed by adding a user1.xml file to conf/Catalina/localhost for localhost.com/user1 2. Application is deployed for domain name bu adding user1.xml to conf/Catalina/localhost.com/ and making appropriate changes to server.xml file for a virtual host Is there a better way to do it? to allow user access to a website both ways but having the application deploy only once and somehow having pointers to it? Thank you for the help Oleg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Need help exporting contexts not under webapps/
Not clear what you want. Send me the details Where is your static document ( The directory ) How do want to access it ? ( the URL ) Which version of TOMCAT YOU ARE USING Send me your server.xml Regards Guru -Original Message- From: J. Ryan Earl [mailto:[EMAIL PROTECTED] Sent: 18 April 2005 19:16 To: tomcat-user@jakarta.apache.org Subject: Need help exporting contexts not under webapps/ Hello, I'm in the process of bringing an in-house application up under Tomcat. Previously we were using Jetty as the servlet container, but for various reason I'm trying to get said application running with Tomcat 5.5.9 and Java 1.5.0. The problem I'm having is that there are two directories with a large amount of static files (pictures, videos, documents, and other forms of media) that are mounted outside of the webapps/ home. Under Jetty, there is a configuration directive that I can use to export these directories under a URL path. I'm trying to do that in Tomcat, and the documentation has been somewhat confusing. What I've gathered is that this type of configuration should be put under ${CATALINA_HOME}/conf/context.xml however I have been able to do this successfully. I've tried putting the following in context.xml but it gives me errors: Context path=/DOCS docBase=/mnt/CMFiles/DOCS debug=0 /Context So my question is, in short, given a directory structure of static files, how do you get Tomcat to serve said static content off of an arbitrary URI? Ideas? Thanks in advance, -ryan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Need help exporting contexts not under webapps/
Guru, Earl isn't the only one trying to do this. Here are the details for my attempts which may or may not be similar to his: - Running TC 5.5.8, JVM 1.5.0_02-b09 under Win XP Pro SP2 - I have a set of static pages (starting with index.htm) stored at C:\www\aegean - C:\www\agean\WEB-INF\web.xml contains web-app/ - I wish to access them as http://www.peacham.com/aegean - aegean is just one of many such directories. - It works if I copy it to {TOMCAT_BASE}\webapps\aegean but that creates maintenance headaches by coupling the TC directory structure to the web site directory structure. - I have tried building a webapps/aegean directory with just WEB-INF and adding aegean.xml to {TOMCAT-BASE}\conf\Catalina\localhost containing: ?xml version=1.0 encoding=UTF-8? Context path=/aegean docbase=c:/www/aegean reloadable=true WatchedResourceWEB-INF/web.xml/WatchedResource /Context but all I get is 404 errors and no hint of other errors in the logs. I have tried a couple of variations with equally poor results. Thanks for any help you can give Fritz -Original Message- From: Raghupathy,Gurumoorthy [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 19, 2005 1:10 AM To: 'Tomcat Users List' Subject: RE: Need help exporting contexts not under webapps/ Not clear what you want. Send me the details Where is your static document ( The directory ) How do want to access it ? ( the URL ) Which version of TOMCAT YOU ARE USING Send me your server.xml Regards Guru -Original Message- From: J. Ryan Earl [mailto:[EMAIL PROTECTED] Sent: 18 April 2005 19:16 To: tomcat-user@jakarta.apache.org Subject: Need help exporting contexts not under webapps/ Hello, I'm in the process of bringing an in-house application up under Tomcat. Previously we were using Jetty as the servlet container, but for various reason I'm trying to get said application running with Tomcat 5.5.9 and Java 1.5.0. The problem I'm having is that there are two directories with a large amount of static files (pictures, videos, documents, and other forms of media) that are mounted outside of the webapps/ home. Under Jetty, there is a configuration directive that I can use to export these directories under a URL path. I'm trying to do that in Tomcat, and the documentation has been somewhat confusing. What I've gathered is that this type of configuration should be put under ${CATALINA_HOME}/conf/context.xml however I have been able to do this successfully. I've tried putting the following in context.xml but it gives me errors: Context path=/DOCS docBase=/mnt/CMFiles/DOCS debug=0 /Context So my question is, in short, given a directory structure of static files, how do you get Tomcat to serve said static content off of an arbitrary URI? Ideas? Thanks in advance, -ryan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Need help exporting contexts not under webapps/
Hello, In your aegean.xml try ?xml version=1.0 encoding=UTF-8? Context path=/aegean docbase=c:\www\aegean reloadable=true WatchedResourceWEB-INF/web.xml/WatchedResource /Context and then stop and start tocmat. Go to the manager application and see if you can see the application started ? if not try to start it. If yes then try the link http://www.peacham.com/aegean If it does not look into the logs Regards Guru -Original Message- From: Fritz Schneider [mailto:[EMAIL PROTECTED] Sent: 19 April 2005 13:25 To: 'Tomcat Users List' Subject: RE: Need help exporting contexts not under webapps/ Guru, Earl isn't the only one trying to do this. Here are the details for my attempts which may or may not be similar to his: - Running TC 5.5.8, JVM 1.5.0_02-b09 under Win XP Pro SP2 - I have a set of static pages (starting with index.htm) stored at C:\www\aegean - C:\www\agean\WEB-INF\web.xml contains web-app/ - I wish to access them as http://www.peacham.com/aegean - aegean is just one of many such directories. - It works if I copy it to {TOMCAT_BASE}\webapps\aegean but that creates maintenance headaches by coupling the TC directory structure to the web site directory structure. - I have tried building a webapps/aegean directory with just WEB-INF and adding aegean.xml to {TOMCAT-BASE}\conf\Catalina\localhost containing: ?xml version=1.0 encoding=UTF-8? Context path=/aegean docbase=c:/www/aegean reloadable=true WatchedResourceWEB-INF/web.xml/WatchedResource /Context but all I get is 404 errors and no hint of other errors in the logs. I have tried a couple of variations with equally poor results. Thanks for any help you can give Fritz -Original Message- From: Raghupathy,Gurumoorthy [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 19, 2005 1:10 AM To: 'Tomcat Users List' Subject: RE: Need help exporting contexts not under webapps/ Not clear what you want. Send me the details Where is your static document ( The directory ) How do want to access it ? ( the URL ) Which version of TOMCAT YOU ARE USING Send me your server.xml Regards Guru -Original Message- From: J. Ryan Earl [mailto:[EMAIL PROTECTED] Sent: 18 April 2005 19:16 To: tomcat-user@jakarta.apache.org Subject: Need help exporting contexts not under webapps/ Hello, I'm in the process of bringing an in-house application up under Tomcat. Previously we were using Jetty as the servlet container, but for various reason I'm trying to get said application running with Tomcat 5.5.9 and Java 1.5.0. The problem I'm having is that there are two directories with a large amount of static files (pictures, videos, documents, and other forms of media) that are mounted outside of the webapps/ home. Under Jetty, there is a configuration directive that I can use to export these directories under a URL path. I'm trying to do that in Tomcat, and the documentation has been somewhat confusing. What I've gathered is that this type of configuration should be put under ${CATALINA_HOME}/conf/context.xml however I have been able to do this successfully. I've tried putting the following in context.xml but it gives me errors: Context path=/DOCS docBase=/mnt/CMFiles/DOCS debug=0 /Context So my question is, in short, given a directory structure of static files, how do you get Tomcat to serve said static content off of an arbitrary URI? Ideas? Thanks in advance, -ryan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Need help exporting contexts not under webapps/
Guru, I got it! Forget about aegean.xml! The key us server.xml! I was able to move my ROOT directory by adding the following to my Host container in server.xml: Context path= docBase=c:/www reloadable=true WatchedResourceWEB-INF/web.xml/WatchedResource /Context Then all of my subdirectories under c:\www showed up on the server, including aegean. Other contexts continue to be recognized as deployed apps. Fritz -Original Message- From: Raghupathy,Gurumoorthy [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 19, 2005 5:45 AM To: 'Tomcat Users List' Subject: RE: Need help exporting contexts not under webapps/ Hello, In your aegean.xml try ?xml version=1.0 encoding=UTF-8? Context path=/aegean docbase=c:\www\aegean reloadable=true WatchedResourceWEB-INF/web.xml/WatchedResource /Context and then stop and start tocmat. Go to the manager application and see if you can see the application started ? if not try to start it. If yes then try the link http://www.peacham.com/aegean If it does not look into the logs Regards Guru -Original Message- From: Fritz Schneider [mailto:[EMAIL PROTECTED] Sent: 19 April 2005 13:25 To: 'Tomcat Users List' Subject: RE: Need help exporting contexts not under webapps/ Guru, Earl isn't the only one trying to do this. Here are the details for my attempts which may or may not be similar to his: - Running TC 5.5.8, JVM 1.5.0_02-b09 under Win XP Pro SP2 - I have a set of static pages (starting with index.htm) stored at C:\www\aegean - C:\www\agean\WEB-INF\web.xml contains web-app/ - I wish to access them as http://www.peacham.com/aegean - aegean is just one of many such directories. - It works if I copy it to {TOMCAT_BASE}\webapps\aegean but that creates maintenance headaches by coupling the TC directory structure to the web site directory structure. - I have tried building a webapps/aegean directory with just WEB-INF and adding aegean.xml to {TOMCAT-BASE}\conf\Catalina\localhost containing: ?xml version=1.0 encoding=UTF-8? Context path=/aegean docbase=c:/www/aegean reloadable=true WatchedResourceWEB-INF/web.xml/WatchedResource /Context but all I get is 404 errors and no hint of other errors in the logs. I have tried a couple of variations with equally poor results. Thanks for any help you can give Fritz -Original Message- From: Raghupathy,Gurumoorthy [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 19, 2005 1:10 AM To: 'Tomcat Users List' Subject: RE: Need help exporting contexts not under webapps/ Not clear what you want. Send me the details Where is your static document ( The directory ) How do want to access it ? ( the URL ) Which version of TOMCAT YOU ARE USING Send me your server.xml Regards Guru -Original Message- From: J. Ryan Earl [mailto:[EMAIL PROTECTED] Sent: 18 April 2005 19:16 To: tomcat-user@jakarta.apache.org Subject: Need help exporting contexts not under webapps/ Hello, I'm in the process of bringing an in-house application up under Tomcat. Previously we were using Jetty as the servlet container, but for various reason I'm trying to get said application running with Tomcat 5.5.9 and Java 1.5.0. The problem I'm having is that there are two directories with a large amount of static files (pictures, videos, documents, and other forms of media) that are mounted outside of the webapps/ home. Under Jetty, there is a configuration directive that I can use to export these directories under a URL path. I'm trying to do that in Tomcat, and the documentation has been somewhat confusing. What I've gathered is that this type of configuration should be put under ${CATALINA_HOME}/conf/context.xml however I have been able to do this successfully. I've tried putting the following in context.xml but it gives me errors: Context path=/DOCS docBase=/mnt/CMFiles/DOCS debug=0 /Context So my question is, in short, given a directory structure of static files, how do you get Tomcat to serve said static content off of an arbitrary URI? Ideas? Thanks in advance, -ryan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Need help exporting contexts not under webapps/
Thanks for the reply, I actually figured it a few hours later. I was trying to do 2/ in your list. I added a PICS.xml and a DOCS.xml under the ${CATALINA_HOME}/conf/Catalina/localhost/ directory which gave me the PICS and DOCS contexts. ie: [EMAIL PROTECTED] localhost]$ pwd /home/tomcat/jakarta-tomcat-5.5.9/conf/Catalina/localhost [EMAIL PROTECTED] localhost]$ ls DOCS.xml host-manager.xml manager.xml PICS.xml [EMAIL PROTECTED] localhost]$ cat PICS.xml Context docBase=/mnt/CMFiles/PICS privileged=true antiResourceLocking=false antiJARLocking=false /Context [EMAIL PROTECTED] localhost]$ cat PICS.xml Context docBase=/mnt/CMFiles/PICS privileged=true antiResourceLocking=false antiJARLocking=false /Context [EMAIL PROTECTED] localhost]$ cat PICS.xml DOCS.xml Context docBase=/mnt/CMFiles/PICS privileged=true antiResourceLocking=false antiJARLocking=false /Context Context docBase=/mnt/CMFiles/DOCS privileged=true antiResourceLocking=false antiJARLocking=false /Context -Original Message- From: QM [mailto:[EMAIL PROTECTED] Sent: Monday, April 18, 2005 8:30 PM To: Tomcat Users List Subject: Re: Need help exporting contexts not under webapps/ On Mon, Apr 18, 2005 at 01:16:04PM -0500, J. Ryan Earl wrote: : So my question is, in short, given a directory structure of static files, : how do you get Tomcat to serve said static content off of an arbitrary URI? So, are you trying to 1/ have a Tomcat-run webapp serve content that exists outside of the context path? 2/ setup the static content as its own webapp (context)? For #1, the (portable, spec-friendly) way is to write a servlet or filter to intercept requests for a given URI, open the matching file as an InputStream, and push the data to the client via the Response OutputStream. For #2, I don't remember the exact syntax off the top of my head so I won't waste your time with something that may not work. =) But it's definitely possible for a webapp to not exist under the webapps/ directory. Just make sure said webapp has a WEB-INF directory and a web.xml. Even a web.xml of just web-app/ should do. -QM -- software -- http://www.brandxdev.net/ tech news -- http://www.RoarNetworX.com/ code scan -- http://www.JxRef.org/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need help exporting contexts not under webapps/
Did you manage to get it right ? I would recommend that you use lower case context path name Regards Guru - Original Message - From: J. Ryan Earl [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Tuesday, April 19, 2005 6:56 PM Subject: RE: Need help exporting contexts not under webapps/ Thanks for the reply, I actually figured it a few hours later. I was trying to do 2/ in your list. I added a PICS.xml and a DOCS.xml under the ${CATALINA_HOME}/conf/Catalina/localhost/ directory which gave me the PICS and DOCS contexts. ie: [EMAIL PROTECTED] localhost]$ pwd /home/tomcat/jakarta-tomcat-5.5.9/conf/Catalina/localhost [EMAIL PROTECTED] localhost]$ ls DOCS.xml host-manager.xml manager.xml PICS.xml [EMAIL PROTECTED] localhost]$ cat PICS.xml Context docBase=/mnt/CMFiles/PICS privileged=true antiResourceLocking=false antiJARLocking=false /Context [EMAIL PROTECTED] localhost]$ cat PICS.xml Context docBase=/mnt/CMFiles/PICS privileged=true antiResourceLocking=false antiJARLocking=false /Context [EMAIL PROTECTED] localhost]$ cat PICS.xml DOCS.xml Context docBase=/mnt/CMFiles/PICS privileged=true antiResourceLocking=false antiJARLocking=false /Context Context docBase=/mnt/CMFiles/DOCS privileged=true antiResourceLocking=false antiJARLocking=false /Context -Original Message- From: QM [mailto:[EMAIL PROTECTED] Sent: Monday, April 18, 2005 8:30 PM To: Tomcat Users List Subject: Re: Need help exporting contexts not under webapps/ On Mon, Apr 18, 2005 at 01:16:04PM -0500, J. Ryan Earl wrote: : So my question is, in short, given a directory structure of static files, : how do you get Tomcat to serve said static content off of an arbitrary URI? So, are you trying to 1/ have a Tomcat-run webapp serve content that exists outside of the context path? 2/ setup the static content as its own webapp (context)? For #1, the (portable, spec-friendly) way is to write a servlet or filter to intercept requests for a given URI, open the matching file as an InputStream, and push the data to the client via the Response OutputStream. For #2, I don't remember the exact syntax off the top of my head so I won't waste your time with something that may not work. =) But it's definitely possible for a webapp to not exist under the webapps/ directory. Just make sure said webapp has a WEB-INF directory and a web.xml. Even a web.xml of just web-app/ should do. -QM -- software -- http://www.brandxdev.net/ tech news -- http://www.RoarNetworX.com/ code scan -- http://www.JxRef.org/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Need help exporting contexts not under webapps/
Yea, I accidently hit the send button on the last email before I was done writing it, but it's working. I just had to create two context files under conf/Catalina/localhost/ -ryan -Original Message- From: Gurumoorthy [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 19, 2005 1:33 PM To: Tomcat Users List Subject: Re: Need help exporting contexts not under webapps/ Did you manage to get it right ? I would recommend that you use lower case context path name Regards Guru - Original Message - From: J. Ryan Earl [EMAIL PROTECTED] To: Tomcat Users List tomcat-user@jakarta.apache.org Sent: Tuesday, April 19, 2005 6:56 PM Subject: RE: Need help exporting contexts not under webapps/ Thanks for the reply, I actually figured it a few hours later. I was trying to do 2/ in your list. I added a PICS.xml and a DOCS.xml under the ${CATALINA_HOME}/conf/Catalina/localhost/ directory which gave me the PICS and DOCS contexts. ie: [EMAIL PROTECTED] localhost]$ pwd /home/tomcat/jakarta-tomcat-5.5.9/conf/Catalina/localhost [EMAIL PROTECTED] localhost]$ ls DOCS.xml host-manager.xml manager.xml PICS.xml [EMAIL PROTECTED] localhost]$ cat PICS.xml Context docBase=/mnt/CMFiles/PICS privileged=true antiResourceLocking=false antiJARLocking=false /Context [EMAIL PROTECTED] localhost]$ cat PICS.xml Context docBase=/mnt/CMFiles/PICS privileged=true antiResourceLocking=false antiJARLocking=false /Context [EMAIL PROTECTED] localhost]$ cat PICS.xml DOCS.xml Context docBase=/mnt/CMFiles/PICS privileged=true antiResourceLocking=false antiJARLocking=false /Context Context docBase=/mnt/CMFiles/DOCS privileged=true antiResourceLocking=false antiJARLocking=false /Context -Original Message- From: QM [mailto:[EMAIL PROTECTED] Sent: Monday, April 18, 2005 8:30 PM To: Tomcat Users List Subject: Re: Need help exporting contexts not under webapps/ On Mon, Apr 18, 2005 at 01:16:04PM -0500, J. Ryan Earl wrote: : So my question is, in short, given a directory structure of static files, : how do you get Tomcat to serve said static content off of an arbitrary URI? So, are you trying to 1/ have a Tomcat-run webapp serve content that exists outside of the context path? 2/ setup the static content as its own webapp (context)? For #1, the (portable, spec-friendly) way is to write a servlet or filter to intercept requests for a given URI, open the matching file as an InputStream, and push the data to the client via the Response OutputStream. For #2, I don't remember the exact syntax off the top of my head so I won't waste your time with something that may not work. =) But it's definitely possible for a webapp to not exist under the webapps/ directory. Just make sure said webapp has a WEB-INF directory and a web.xml. Even a web.xml of just web-app/ should do. -QM -- software -- http://www.brandxdev.net/ tech news -- http://www.RoarNetworX.com/ code scan -- http://www.JxRef.org/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Need help exporting contexts not under webapps/
Hello, I'm in the process of bringing an in-house application up under Tomcat. Previously we were using Jetty as the servlet container, but for various reason I'm trying to get said application running with Tomcat 5.5.9 and Java 1.5.0. The problem I'm having is that there are two directories with a large amount of static files (pictures, videos, documents, and other forms of media) that are mounted outside of the webapps/ home. Under Jetty, there is a configuration directive that I can use to export these directories under a URL path. I'm trying to do that in Tomcat, and the documentation has been somewhat confusing. What I've gathered is that this type of configuration should be put under ${CATALINA_HOME}/conf/context.xml however I have been able to do this successfully. I've tried putting the following in context.xml but it gives me errors: Context path=/DOCS docBase=/mnt/CMFiles/DOCS debug=0 /Context So my question is, in short, given a directory structure of static files, how do you get Tomcat to serve said static content off of an arbitrary URI? Ideas? Thanks in advance, -ryan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need help exporting contexts not under webapps/
On Mon, Apr 18, 2005 at 01:16:04PM -0500, J. Ryan Earl wrote: : So my question is, in short, given a directory structure of static files, : how do you get Tomcat to serve said static content off of an arbitrary URI? So, are you trying to 1/ have a Tomcat-run webapp serve content that exists outside of the context path? 2/ setup the static content as its own webapp (context)? For #1, the (portable, spec-friendly) way is to write a servlet or filter to intercept requests for a given URI, open the matching file as an InputStream, and push the data to the client via the Response OutputStream. For #2, I don't remember the exact syntax off the top of my head so I won't waste your time with something that may not work. =) But it's definitely possible for a webapp to not exist under the webapps/ directory. Just make sure said webapp has a WEB-INF directory and a web.xml. Even a web.xml of just web-app/ should do. -QM -- software -- http://www.brandxdev.net/ tech news -- http://www.RoarNetworX.com/ code scan -- http://www.JxRef.org/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
IIS Virtual Hosts and JK 1.2 - Same Contexts to different workers?
Windows/Tomcat 5/IIS/JK 1.2 Connector I am using the JK 1.2 Connector and want to connect two IIS Web sites to different AJP ports, with the same context. Is there a way for workers.properties to specify the incoming Host Header when determining which worker to use? For example: http://website1/mycontext/ should go to one instance of Tomcat with AJP port 8009 http://website2/mycontext should go to a second instance of Tomcat with AJP port 9009 Both Web sites are in the same IIS WWW Server It works with Two hosts in the same Tomcat service (thus same AJP port 8009), but I’d like to isolate them a little more by having them run in different Tomcat instances that I can recycle separately. - thanks David J http://davidwj.com __ Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cannot modify Tomcat Contexts installed at setup
Thanks Sven, I did how you suggested: First I erased the caches: [EMAIL PROTECTED] num]# cd /usr/local/jakarta-tomcat-5.0.12/work/Catalina/localhost [EMAIL PROTECTED] localhost]# rm -rf ./* [EMAIL PROTECTED] localhost]# ll total 0 At this point, I renamed with mv $CATALINA_HOME/webapps/ROOT/index.jsp, to index.jsp.ok: [EMAIL PROTECTED] localhost]# ls $CATALINA_HOME/webapps/ROOT/ index.jsp.ok jakarta-banner.gif RELEASE-NOTES.txt tomcat.gif tomcat-power.gif WEB-INF Then I restarted Tomcat, and checked the cache: [EMAIL PROTECTED] localhost]# ll /usr/local/jakarta-tomcat-5.0.12/work/Catalina/localhost total 36 drwxr-xr-x2 root root 4096 Apr 5 18:58 _ drwxr-xr-x3 root root 4096 Apr 5 18:58 admin drwxr-xr-x2 root root 4096 Apr 5 18:58 cart06 drwxr-xr-x2 root root 4096 Apr 5 18:58 DBTest drwxr-xr-x2 root root 4096 Apr 5 18:58 jsp-examples drwxr-xr-x2 root root 4096 Apr 5 18:58 manager drwxr-xr-x2 root root 4096 Apr 5 18:58 paypal drwxr-xr-x2 root root 4096 Apr 5 18:58 servlets-examples drwxr-xr-x2 root root 4096 Apr 5 18:58 tomcat-docs We can see that the cache was re-created at startup by Tomcat. Now I browse to www.myurl.com:8080, and ... I get the index.jsp file (the one with If you're seeing this page via a web browser, it means you've setup Tomcat successfully. Congratulations!), as if I had not deleted it in Tomcat's ROOT context! I don't get it... All Tomcat Contexts created at install, like ROOT, behave in this way: modifying the jsp files, or erasing them, has no effect at all. Any hint would be highly appreciated. Helena --- sven morales [EMAIL PROTECTED] wrote: Hi, Try clearing the directory tomcat5/work/* and restart tomcat. This should clear up caches. aka_sergio --- helena rato [EMAIL PROTECTED] wrote: I use Tomcat 5.0.27 with apache Apache 2.0.40 and JK2. Just for the purpose of a test, I replace the existing index.jsp file in $CATALINA_HOME/webapps/ROOT/ with another index.jsp file, with following contents: html h1Hello World/h1 /html I re-boot the server, and start Tomcat and Apache. I browse to my URL using www.myurl.com:8080. I still get the 'old' index.jsp! The same happens with any of the Contexts installed during setup, like 'jsp-examples' context (for example, modifying /jsp-examples/num/numguess.jsp seems to have no impact at all, even after rebooting). On the other hand, with Tomcat Contexts created by me, the behavior is normal. I'm sure I am missing something, and would appreciate any clue. Thank-you in advance Helena __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cannot modify Tomcat Contexts installed at setup
The app is pre-compiled. Delete the servlet mapping for /index.jsp in web.xml and then try it. (You might need to restart) Mark helena rato wrote: I use Tomcat 5.0.27 with apache Apache 2.0.40 and JK2. Just for the purpose of a test, I replace the existing index.jsp file in $CATALINA_HOME/webapps/ROOT/ with another index.jsp file, with following contents: html h1Hello World/h1 /html I re-boot the server, and start Tomcat and Apache. I browse to my URL using www.myurl.com:8080. I still get the 'old' index.jsp! The same happens with any of the Contexts installed during setup, like 'jsp-examples' context (for example, modifying /jsp-examples/num/numguess.jsp seems to have no impact at all, even after rebooting). On the other hand, with Tomcat Contexts created by me, the behavior is normal. I'm sure I am missing something, and would appreciate any clue. Thank-you in advance Helena __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Cannot modify Tomcat Contexts installed at setup
I use Tomcat 5.0.27 with apache Apache 2.0.40 and JK2. Just for the purpose of a test, I replace the existing index.jsp file in $CATALINA_HOME/webapps/ROOT/ with another index.jsp file, with following contents: html h1Hello World/h1 /html I re-boot the server, and start Tomcat and Apache. I browse to my URL using www.myurl.com:8080. I still get the 'old' index.jsp! The same happens with any of the Contexts installed during setup, like 'jsp-examples' context (for example, modifying /jsp-examples/num/numguess.jsp seems to have no impact at all, even after rebooting). On the other hand, with Tomcat Contexts created by me, the behavior is normal. I'm sure I am missing something, and would appreciate any clue. Thank-you in advance Helena __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cannot modify Tomcat Contexts installed at setup
Hi, Try clearing the directory tomcat5/work/* and restart tomcat. This should clear up caches. aka_sergio --- helena rato [EMAIL PROTECTED] wrote: I use Tomcat 5.0.27 with apache Apache 2.0.40 and JK2. Just for the purpose of a test, I replace the existing index.jsp file in $CATALINA_HOME/webapps/ROOT/ with another index.jsp file, with following contents: html h1Hello World/h1 /html I re-boot the server, and start Tomcat and Apache. I browse to my URL using www.myurl.com:8080. I still get the 'old' index.jsp! The same happens with any of the Contexts installed during setup, like 'jsp-examples' context (for example, modifying /jsp-examples/num/numguess.jsp seems to have no impact at all, even after rebooting). On the other hand, with Tomcat Contexts created by me, the behavior is normal. I'm sure I am missing something, and would appreciate any clue. Thank-you in advance Helena __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Manager in other webapp subdirectories hosts/contexts
I know I saw the info on this topic somewhere, but for the life of me, I can not relocate it.. (can not come up with the magic search strings...) I have various subdirectories under webapps that are configured as separate hosts and contexts i.e. /webapps/someapp In that directory I have a web application and I want the setup the Manager for stopping and starting this app.. Using the example for the localhost context I saw the alias Alias /usr/local/tomcat/webapps/../server/webapps/manager ..along with all the related settings... Since my webapp is in /usr/local/tomcat/webapps/someapp/ I tried.. Alias /usr/local/tomcat/webapps/someapp/../../server/webapps/manager .. along with related settings... No joy.. it dropped the first ../ and still can not track to that alias directory.. So am I chasing my tail..G And/or can some point me to that phantom discusson on setting up the manager for other host/context/ subdirectories... Thanks... John... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Contexts
I inherited an application recently that uses Tomcat 5.0.16. I know that previous to Tomcat 5, Context elements were in Tomcat's server.xml, but with Tomcat 5 it is recommended that Context elements be in their own .xml files under /conf/Catalina/host/. In this application, however, there are Context elements in BOTH places - when this is the case, does one overwrite the other, do they cancel one another out, what? Thanks! -- Lynn Hollerman. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Include other contexts
Ok, I gave this a test run, so from app1 I called req.getRequestDispatcher(/app2).include(req,res); However, it seems that doing this loops i.e. re-requests app1 rather than passing the request to app2. It this an error with Tomcat or a misunderstanding by me? PJ Peter Johnson wrote: it would seem to be as simple as req.getRequestDispatcher(newuri).include(req,res); PJ Peter Johnson wrote: Thanks for the quick reply QM ... I'd be writing both the parent and child apps. Basically the parent would act as a broker to the child apps and perform the decoration. I guess SiteMesh does a form of automated screen scraping. I would do this so that all child apps may have a common look-n-feel and there would be a global navigation. I will look into RequestDispatcher#include() as it sounds similar to what I'd be after. PJ QM wrote: On Wed, Mar 02, 2005 at 11:53:52AM +1100, Peter Johnson wrote: : I was just wondering if it was possible to pass a request to another : context within the same host and capture the output. If it is, any : suggestions on the best way to do so? You could make a URL call to the app (java.net.URL and other similar implementations). Either that, or RequestDispatcher#include() (Though something tells me that requires an in-context URL. Check the docs to be sure.) It sounds like you're screen scraping, though, in which case you'd be better off trying to find some common data format that app A and app B can share. (If, of course, you have some control or influence over App A.) If app A changes the format of the data (common with websites) then app B has to play catch-up with its parsing. : Basically, I am planning to use SiteMesh for site templating however : would prefer to deploy many of the apps as individual apps. So somehow I : would like to call another context and then have SiteMesh decorate the : response. Are you using this setup for branding, then, or something else? I may have some suggestions, but knowing your end-goal may help. -QM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Include other contexts
It is me ... I wasn't calling the other context rather just a resource within the context Peter Johnson wrote: Ok, I gave this a test run, so from app1 I called req.getRequestDispatcher(/app2).include(req,res); However, it seems that doing this loops i.e. re-requests app1 rather than passing the request to app2. It this an error with Tomcat or a misunderstanding by me? PJ Peter Johnson wrote: it would seem to be as simple as req.getRequestDispatcher(newuri).include(req,res); PJ Peter Johnson wrote: Thanks for the quick reply QM ... I'd be writing both the parent and child apps. Basically the parent would act as a broker to the child apps and perform the decoration. I guess SiteMesh does a form of automated screen scraping. I would do this so that all child apps may have a common look-n-feel and there would be a global navigation. I will look into RequestDispatcher#include() as it sounds similar to what I'd be after. PJ QM wrote: On Wed, Mar 02, 2005 at 11:53:52AM +1100, Peter Johnson wrote: : I was just wondering if it was possible to pass a request to another : context within the same host and capture the output. If it is, any : suggestions on the best way to do so? You could make a URL call to the app (java.net.URL and other similar implementations). Either that, or RequestDispatcher#include() (Though something tells me that requires an in-context URL. Check the docs to be sure.) It sounds like you're screen scraping, though, in which case you'd be better off trying to find some common data format that app A and app B can share. (If, of course, you have some control or influence over App A.) If app A changes the format of the data (common with websites) then app B has to play catch-up with its parsing. : Basically, I am planning to use SiteMesh for site templating however : would prefer to deploy many of the apps as individual apps. So somehow I : would like to call another context and then have SiteMesh decorate the : response. Are you using this setup for branding, then, or something else? I may have some suggestions, but knowing your end-goal may help. -QM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Include other contexts
Tomcat 5.5.7 Hi all, I was just wondering if it was possible to pass a request to another context within the same host and capture the output. If it is, any suggestions on the best way to do so? Basically, I am planning to use SiteMesh for site templating however would prefer to deploy many of the apps as individual apps. So somehow I would like to call another context and then have SiteMesh decorate the response. Any suggestions will be appreciated, thanks in advance. PJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Include other contexts
On Wed, Mar 02, 2005 at 11:53:52AM +1100, Peter Johnson wrote: : I was just wondering if it was possible to pass a request to another : context within the same host and capture the output. If it is, any : suggestions on the best way to do so? You could make a URL call to the app (java.net.URL and other similar implementations). Either that, or RequestDispatcher#include() (Though something tells me that requires an in-context URL. Check the docs to be sure.) It sounds like you're screen scraping, though, in which case you'd be better off trying to find some common data format that app A and app B can share. (If, of course, you have some control or influence over App A.) If app A changes the format of the data (common with websites) then app B has to play catch-up with its parsing. : Basically, I am planning to use SiteMesh for site templating however : would prefer to deploy many of the apps as individual apps. So somehow I : would like to call another context and then have SiteMesh decorate the : response. Are you using this setup for branding, then, or something else? I may have some suggestions, but knowing your end-goal may help. -QM -- software -- http://www.brandxdev.net tech news -- http://www.RoarNetworX.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Include other contexts
Thanks for the quick reply QM ... I'd be writing both the parent and child apps. Basically the parent would act as a broker to the child apps and perform the decoration. I guess SiteMesh does a form of automated screen scraping. I would do this so that all child apps may have a common look-n-feel and there would be a global navigation. I will look into RequestDispatcher#include() as it sounds similar to what I'd be after. PJ QM wrote: On Wed, Mar 02, 2005 at 11:53:52AM +1100, Peter Johnson wrote: : I was just wondering if it was possible to pass a request to another : context within the same host and capture the output. If it is, any : suggestions on the best way to do so? You could make a URL call to the app (java.net.URL and other similar implementations). Either that, or RequestDispatcher#include() (Though something tells me that requires an in-context URL. Check the docs to be sure.) It sounds like you're screen scraping, though, in which case you'd be better off trying to find some common data format that app A and app B can share. (If, of course, you have some control or influence over App A.) If app A changes the format of the data (common with websites) then app B has to play catch-up with its parsing. : Basically, I am planning to use SiteMesh for site templating however : would prefer to deploy many of the apps as individual apps. So somehow I : would like to call another context and then have SiteMesh decorate the : response. Are you using this setup for branding, then, or something else? I may have some suggestions, but knowing your end-goal may help. -QM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Include other contexts
it would seem to be as simple as req.getRequestDispatcher(newuri).include(req,res); PJ Peter Johnson wrote: Thanks for the quick reply QM ... I'd be writing both the parent and child apps. Basically the parent would act as a broker to the child apps and perform the decoration. I guess SiteMesh does a form of automated screen scraping. I would do this so that all child apps may have a common look-n-feel and there would be a global navigation. I will look into RequestDispatcher#include() as it sounds similar to what I'd be after. PJ QM wrote: On Wed, Mar 02, 2005 at 11:53:52AM +1100, Peter Johnson wrote: : I was just wondering if it was possible to pass a request to another : context within the same host and capture the output. If it is, any : suggestions on the best way to do so? You could make a URL call to the app (java.net.URL and other similar implementations). Either that, or RequestDispatcher#include() (Though something tells me that requires an in-context URL. Check the docs to be sure.) It sounds like you're screen scraping, though, in which case you'd be better off trying to find some common data format that app A and app B can share. (If, of course, you have some control or influence over App A.) If app A changes the format of the data (common with websites) then app B has to play catch-up with its parsing. : Basically, I am planning to use SiteMesh for site templating however : would prefer to deploy many of the apps as individual apps. So somehow I : would like to call another context and then have SiteMesh decorate the : response. Are you using this setup for branding, then, or something else? I may have some suggestions, but knowing your end-goal may help. -QM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
In Tomcat 5.x embedded, can't get dynamically created contexts to load
I have been trying to get Tomcat embedded in my application. The problem I am seeing is that when I attach a root context to the host, it doesn't start because of a null class loader. I have been using an example that I found on the web to start embedded Tomcat; my code is below. I have tried this with Tomcat 5.0.28, 5.5.4 (other problems there), and 5.5.6. 5.0.28 and 5.5.6 exhibit the same behavior. I stepped through the Catalina source code from 5.5.6, and this is what I found: When the root context is started (the start method of StandardContext is called), the call to getLoader() returns null. This seems reasonable. An instance of WebappLoader is created and attached to the StandardContext object by calling setLoader. Line 3917 of org/apache/catalina/core/StandardContext.java if (getLoader() == null) { ClassLoader parent = null; if (getPrivileged()) { if (log.isDebugEnabled()) log.debug(Configuring privileged default Loader); parent = this.getClass().getClassLoader(); } else { if (log.isDebugEnabled()) log.debug(Configuring non-privileged default Loader); parent = getParentClassLoader(); } WebappLoader webappLoader = new WebappLoader(parent); webappLoader.setDelegate(getDelegate()); setLoader(webappLoader); Later in the same method, bindThread is called to associate the new class loader with the thread. Line 3970 of org/apache/catalina/core/StandardContext.java ClassLoader oldCCL = bindThread(); The problem I am seeing is that the class loader associated with the WebappLoader object is not created until the start method on the Webapploader object is called, and that method is not called until later in the start method of the StandardContext object. Line 3981 of org/apache/catalina/core/StandardContext.java started = true; // Start our subordinate components, if any if ((loader != null) (loader instanceof Lifecycle)) ((Lifecycle) loader).start(); if ((logger != null) (logger instanceof Lifecycle)) ((Lifecycle) logger).start(); Inside the setLoader method of StandardBase, it looks like the loader is started if the context has been started, but the context hasn't been started yet - it happens after bindThread is called as well. What happens in the bindThread class is the class loader returned from WebappLoader's getClassLoader method is null, causing the context class loader in the current thread to be set to null, causing problems downstream. The error I get is at the bottom of this message. I can work around the problem if I change the getClassLoader method in WebappLoader from public ClassLoader getClassLoader() { return ((ClassLoader) classLoader); } to public ClassLoader getClassLoader() { if (classLoader != null) { return ((ClassLoader) classLoader); } else { return ((ClassLoader)parentClassLoader); } } Is there something I am doing wrong in embedding Tomcat in my application or is there a bug here? Here is my code to start up the Embedded class: _tomcat = new Embedded(); String path = new File(ServerProperties.getTomcatPath()).getAbsolutePath(); _tomcat.setCatalinaHome(path); MemoryRealm memRealm = new MemoryRealm(); _tomcat.setRealm(memRealm); // create an Engine Engine baseEngine = _tomcat.createEngine(); baseEngine.setName(Engine); baseEngine.setDefaultHost(localhost); // create Host Host baseHost = _tomcat.createHost(localhost, path + /webapps); baseEngine.addChild(baseHost); // create root Context Context rootCtx = _tomcat.createContext(, path + /webapps/ROOT); rootCtx.setReloadable(false); rootCtx.addWelcomeFile(index.jsp); baseHost.addChild(rootCtx); // add new Engine to set of Engines for embedded server _tomcat.addEngine(baseEngine); // create Connector Connector httpConnector = _tomcat.createConnector((InetAddress)null, 8080, false); // add new Connector to set of Connectors for embedded server, associated with Engine _tomcat.addConnector(httpConnector); // start operation try { _tomcat.start(); } catch (org.apache.catalina.LifecycleException ex) { // Todo: Handle tomcat exception ex.printStackTrace(); } Here is the exception I get as a result of the null class loader: javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFact ory.java:104) at org.apache.commons.modeler.util.DomUtil.readXml(DomUtil.java:284) at org.apache.commons.modeler.modules.MbeansDescriptorsDOMSource.execute(Mb eansDescriptorsDOMSource.java:130) at
Re: WebDAV-Servlet with Contexts different from FileDirContext
OK, talking to myself as it seems ;) Accept my apologies if no one is interested, but bringing this even further wouldn't it be an option to have the servlet seperated from Tomcat and letting it implement against an API a little bit richter then directory context? Maybe in commons? Such an API could accept settings of properties and even locking. Compared to Slide I really like the servlet as it is pretty obvious and lean in code. I am pretty sure quite some people would be interested in such a solution and would contribute to its compliance to the spec and compatibility to diverse clients. Would that be an option? Oliver On Tue, 16 Nov 2004 00:10:56 +0100, Oliver Zeigermann [EMAIL PROTECTED] wrote: Looking into this further, couldn't proppatch be implemented properly? I know the file dir context does not support setting of attributes, but there are other dir contexts imaginable that do, right? Oliver On Mon, 15 Nov 2004 02:23:49 +0100, Oliver Zeigermann [EMAIL PROTECTED] wrote: Folks, I am just reviewing Tomcat's WebDAV servlet and have even run Slide's WebDAV testsuite against it - many tests work :) I really like the brevity! I understand the default context used is FileDirContext, right? I am no Tomcat expert, so maybe this is a stupid question, but is it actually possible to use a different context possibly accessing a system in a more complicated way? Has anybody tried this already? Thanks in advance, Oliver - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: WebDAV-Servlet with Contexts different from FileDirContext
Not quite talking to yourself but what with timezones and day jobs and all that it isn't always possible to reply quickly. ;) I am not sure of the level of interest in this but people have taken the trouble to write bug reports and it does crop up reasonably often on the lists considering its size. If you want to enhance the webdav servet I would be happy to look at your patches and apply them as appropriate. There is however, one caveat. I don't want the webdav servlet to become a source of bloat so it is important that it remains lean - ideally in a single servlet. Mark -Original Message- From: Oliver Zeigermann [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 16, 2004 5:25 PM To: [EMAIL PROTECTED] Subject: Re: WebDAV-Servlet with Contexts different from FileDirContext OK, talking to myself as it seems ;) Accept my apologies if no one is interested, but bringing this even further wouldn't it be an option to have the servlet seperated from Tomcat and letting it implement against an API a little bit richter then directory context? Maybe in commons? Such an API could accept settings of properties and even locking. Compared to Slide I really like the servlet as it is pretty obvious and lean in code. I am pretty sure quite some people would be interested in such a solution and would contribute to its compliance to the spec and compatibility to diverse clients. Would that be an option? Oliver On Tue, 16 Nov 2004 00:10:56 +0100, Oliver Zeigermann [EMAIL PROTECTED] wrote: Looking into this further, couldn't proppatch be implemented properly? I know the file dir context does not support setting of attributes, but there are other dir contexts imaginable that do, right? Oliver On Mon, 15 Nov 2004 02:23:49 +0100, Oliver Zeigermann [EMAIL PROTECTED] wrote: Folks, I am just reviewing Tomcat's WebDAV servlet and have even run Slide's WebDAV testsuite against it - many tests work :) I really like the brevity! I understand the default context used is FileDirContext, right? I am no Tomcat expert, so maybe this is a stupid question, but is it actually possible to use a different context possibly accessing a system in a more complicated way? Has anybody tried this already? Thanks in advance, Oliver - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WebDAV-Servlet with Contexts different from FileDirContext
On Tue, 16 Nov 2004 21:47:48 -, Mark Thomas [EMAIL PROTECTED] wrote: Not quite talking to yourself but what with timezones and day jobs and all that it isn't always possible to reply quickly. ;) I am not sure of the level of interest in this but people have taken the trouble to write bug reports and it does crop up reasonably often on the lists considering its size. If you want to enhance the webdav servet I would be happy to look at your patches and apply them as appropriate. There is however, one caveat. I don't want the webdav servlet to become a source of bloat so it is important that it remains lean - ideally in a single servlet. I like it a lot better as a simple servlet, actually ;) About the no-propatch: the idea is that the filesystem support for this would require some extra complexity, which I ruled out. Since most people would use the filesystem, the feature becomes sort of bloat. -- x Rémy Maucherat Developer Consultant JBoss Group (Europe) SàRL x - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WebDAV-Servlet with Contexts different from FileDirContext
Mark, Remy, thanks for your attention. Did not want to complain about missing responses, I was just honestly wondering if anyone was interested. Obviously, someone is :) I understand you are not interested in making this servlet available to a broader scope of people, are you? If so I would completely understand that as I have learned about the drawbacks of too general solutions. Oliver On Tue, 16 Nov 2004 23:18:48 +0100, Remy Maucherat [EMAIL PROTECTED] wrote: On Tue, 16 Nov 2004 21:47:48 -, Mark Thomas [EMAIL PROTECTED] wrote: Not quite talking to yourself but what with timezones and day jobs and all that it isn't always possible to reply quickly. ;) I am not sure of the level of interest in this but people have taken the trouble to write bug reports and it does crop up reasonably often on the lists considering its size. If you want to enhance the webdav servet I would be happy to look at your patches and apply them as appropriate. There is however, one caveat. I don't want the webdav servlet to become a source of bloat so it is important that it remains lean - ideally in a single servlet. I like it a lot better as a simple servlet, actually ;) About the no-propatch: the idea is that the filesystem support for this would require some extra complexity, which I ruled out. Since most people would use the filesystem, the feature becomes sort of bloat. -- x Rémy Maucherat Developer Consultant JBoss Group (Europe) SàRL x - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WebDAV-Servlet with Contexts different from FileDirContext
Looking into this further, couldn't proppatch be implemented properly? I know the file dir context does not support setting of attributes, but there are other dir contexts imaginable that do, right? Oliver On Mon, 15 Nov 2004 02:23:49 +0100, Oliver Zeigermann [EMAIL PROTECTED] wrote: Folks, I am just reviewing Tomcat's WebDAV servlet and have even run Slide's WebDAV testsuite against it - many tests work :) I really like the brevity! I understand the default context used is FileDirContext, right? I am no Tomcat expert, so maybe this is a stupid question, but is it actually possible to use a different context possibly accessing a system in a more complicated way? Has anybody tried this already? Thanks in advance, Oliver - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
WebDAV-Servlet with Contexts different from FileDirContext
Folks, I am just reviewing Tomcat's WebDAV servlet and have even run Slide's WebDAV testsuite against it - many tests work :) I really like the brevity! I understand the default context used is FileDirContext, right? I am no Tomcat expert, so maybe this is a stupid question, but is it actually possible to use a different context possibly accessing a system in a more complicated way? Has anybody tried this already? Thanks in advance, Oliver - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How Are Default Contexts Created?
This question is about contexts that are created by default, not the DefaultContext element in service.xml. Even though I don't have any Contexts defined in my xml files, they seem to get created automatically, at least for running the Default servlet and the Status servlet. How are they created? I was having problems with 5.0.26 on Windows where sometimes the contexts would be created and others not. So far I can't reproduce the problem in 5.0.28 on Windows, but I can on the proprietary OS we are trying to run JBoss 3.2.6 on. I am running Tomcat by running JBoss 3.2.6 (was RC1v3 for Tomcat 5.0.26, now 3.2.6 Final for 5.0.28). I made a diagnostic patch to the 5.0.26 Mapper class, internalMap method, that showed that sometimes the context list in the host is null. I see the following in the init() method of MapperListener, is this related? // Query contexts onStr = *:j2eeType=WebModule,*; objectName = new ObjectName(onStr); set = mBeanServer.queryMBeans(objectName, null); iterator = set.iterator(); while (iterator.hasNext()) { ObjectInstance oi = (ObjectInstance) iterator.next(); registerContext(oi.getObjectName()); } -Mitchell Fisher - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Can Tomcat Contexts have class naming collisions?
We have Tomcat 4.1.30 in Win2000 using JDK 1.4.2_05. We are having a problem where ONE of our classes will not load. The class name is Marketplace.class (package com.marketplace.core) Our Tomcat webapp (Context) is named 'marketplace'. Code works fine except when you try to reference the 'Marketplace' class. (with and without the fqdn) You get a NoClassDefFoundError. If I rename the class to something else, it works fine. We tried other 1.4 java versions, and they do not effect the problem. If your context is named 'marketplace', will Tomcat have trouble with a class named 'Marketplace'? (this is the effect we are seeing) Thanks for any help/advice you can offer. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can Tomcat Contexts have class naming collisions?
Hi, If your context is named 'marketplace', will Tomcat have trouble with a class named 'Marketplace'? (this is the effect we are seeing) No, Tomcat won't have this kind of trouble. Have you considered the difference between a ClassNotFoundException and a NoClassDefFoundError? Your message said the latter is what you're getting, not the former. Search your runtime classpath (e.g. common/lib, shared/lib, WEB-INF/classes, WEB-INF/lib) to ensure there's only one version of Marketplace.class in the classpath, and that version is the one expected by the calling code. Yoav This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Preventing contexts from being loaded twice
Hi List, I'm installing a context using the new Tomcat 5 Catalina/localhost/.xml method. $TOMCAT_HOME/conf/Catalina/localhost/myapp.xml Context path=/jsp/myapp docBase=myapp debug=0 reloadabl e=true snip The problem: The context is being loaded twice, also being installed at /myapp since it's located at $TOMCAT_HOME/webapps/myapp. If I browse myhost:8080/jsp/myapp/, or myhost:8080/myapp/, it works. I'd like only the former to work. I'm using the default server.xml Any help? Thanks! E.P. Frederick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Preventing contexts from being loaded twice
Hi, Dude, RTFM ;) Set autoDeploy=false for your Host in server.xml. Yoav Shapira http://www.yoavshapira.com -Original Message- From: E.P. Frederick [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 27, 2004 2:23 PM To: [EMAIL PROTECTED] Subject: Preventing contexts from being loaded twice Hi List, I'm installing a context using the new Tomcat 5 Catalina/localhost/.xml method. $TOMCAT_HOME/conf/Catalina/localhost/myapp.xml Context path=/jsp/myapp docBase=myapp debug=0 reloadabl e=true snip The problem: The context is being loaded twice, also being installed at /myapp since it's located at $TOMCAT_HOME/webapps/myapp. If I browse myhost:8080/jsp/myapp/, or myhost:8080/myapp/, it works. I'd like only the former to work. I'm using the default server.xml Any help? Thanks! E.P. Frederick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 5.0 contexts
Is something wrong with my logger declaration? It does not seem to be creating the logs that I specified. -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Thursday, September 23, 2004 4:26 PM To: Tomcat Users List Subject: RE: Tomcat 5.0 contexts Hi, Tomcat 5.0 supports putting Contexts in server.xml just like Tomcat 4.x did. In addition, you can put them in the $CATALINA_HOME/conf/[engine name]/[host name] directory for the engine and host where you want your app deployed. You can also put a META-INF/context.xml file in a WAR and deploy that WAR without any of the above context declarations. All of those should work. Yoav Shapira Millennium Research Informatics -Original Message- From: Luc Foisy [mailto:[EMAIL PROTECTED] Sent: Thursday, September 23, 2004 4:19 PM To: Tomcat User List (E-mail) Subject: Tomcat 5.0 contexts I just put 5.0.28 on to my box, I was working with 4.x branch. I am not quite sure how to define my contexts any more. I do not see context entries in conf/server.xml, even the documentation make reference to contexts being in this file. I did find conf/Catalina/localhost driectory. I thought I would create a context in there, to see what happens. It didn't seem to take that context entry. I then tried to put the context entry into server.xml and it did not seem to take it either (both after tomcat restart) I created a directory in webapps called qbs, and put all the required files and directories in there. This is the contents of the qbs.xml file I created in conf/Catalina/localhost and its contents were what I used in server.xml Context path=/qbs docBase=qbs debug=0 privileged=false reloadable=true Logger className=org.apache.catalina.logger.FileLogger debug=0 directory=logs prefix=qbs_log. suffix=.txt timestamp=true verbosity=1/ /Context To note, this context was already automatically being deployed, just because it existed in the webapps directory, but I would like to override some details. What I am not seeing is the qbs_log.txt file being created, perhaps that is the only thing that is wrong here.. This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 5.0 contexts
Hi, Is something wrong with my logger declaration? It does not seem to be creating the logs that I specified. Ahh, I didn't even look at that. I think it looks fine. Try specifying a known absolute directory rather than a relative one (logs) to see if that makes a difference. Heads-up -- don't spend much time on Logger configuration unless you have to. If you're already using log4j, JDK 1.4 logging, or commons-logging, stick to those and don't use a Tomcat Logger. If you're not already using one of these packages, consider starting ;) Yoav This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 5.0 contexts
Thank you. I did get my context to load from Catalina/localhost/qbs.xml INFO: Processing Context configuration file URL file:/home/tomcat/conf/Catalina/localhost/qbs.xml It does not seem to be honoring the logger, even when I use an absolute directory. If it matters, Using RedHat 9.0, jdk 1.4.2_05, tomcat 5.0.28. I have never used one of those logging mechanisms, I have only used the tomcat logger. I will look at those others, since I can't seem to get the Tomcat logger to work at all, which is odd considering the default logger (in server.xml) for all contexts on host seems to be working fine, as well as the logger for the admin context -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Friday, September 24, 2004 9:29 AM To: Tomcat Users List Subject: RE: Tomcat 5.0 contexts Hi, Is something wrong with my logger declaration? It does not seem to be creating the logs that I specified. Ahh, I didn't even look at that. I think it looks fine. Try specifying a known absolute directory rather than a relative one (logs) to see if that makes a difference. Heads-up -- don't spend much time on Logger configuration unless you have to. If you're already using log4j, JDK 1.4 logging, or commons-logging, stick to those and don't use a Tomcat Logger. If you're not already using one of these packages, consider starting ;) Yoav - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.0 contexts
On Fri, Sep 24, 2004 at 10:37:51AM -0400, Luc Foisy wrote: : I did get my context to load from Catalina/localhost/qbs.xml : INFO: Processing Context configuration file URL : file:/home/tomcat/conf/Catalina/localhost/qbs.xml Did you edit that file (qbs.xml) or the one in your WAR file's META-INF/context.xml? Tomcat doesn't overwrite the file in conf/{engine}/{host} with the one in the WAR file, even if the WAR file is newer. -QM -- software -- http://www.brandxdev.net tech news -- http://www.RoarNetworX.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 5.0 contexts
I edited that file. I do not have a WAR. I just put the directory in the webapps directory. There is not a context.xml file in that context directory. -Original Message- From: QM [mailto:[EMAIL PROTECTED] Sent: Friday, September 24, 2004 11:38 AM To: Tomcat Users List Subject: Re: Tomcat 5.0 contexts On Fri, Sep 24, 2004 at 10:37:51AM -0400, Luc Foisy wrote: : I did get my context to load from Catalina/localhost/qbs.xml : INFO: Processing Context configuration file URL : file:/home/tomcat/conf/Catalina/localhost/qbs.xml Did you edit that file (qbs.xml) or the one in your WAR file's META-INF/context.xml? Tomcat doesn't overwrite the file in conf/{engine}/{host} with the one in the WAR file, even if the WAR file is newer. -QM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 5.0 contexts
You need to specify swallowOutput=true on your context tag to get a separate Tomcat log, eg: Context docBase=/webapps/printerparts path=/printerparts reloadable=true swallowOutput=true Regards, John [EMAIL PROTECTED] Ph (09) 372-5010 |-+--- | | Luc Foisy | | | [EMAIL PROTECTED]| | | -magic.com | | | | | | 25/09/2004 02:37 AM | | | Please respond to | | | Tomcat Users List | | | | |-+--- --| | | | To: Tomcat Users List [EMAIL PROTECTED] | | cc: | | Subject: RE: Tomcat 5.0 contexts | --| Thank you. I did get my context to load from Catalina/localhost/qbs.xml INFO: Processing Context configuration file URL file:/home/tomcat/conf/Catalina/localhost/qbs.xml It does not seem to be honoring the logger, even when I use an absolute directory. If it matters, Using RedHat 9.0, jdk 1.4.2_05, tomcat 5.0.28. I have never used one of those logging mechanisms, I have only used the tomcat logger. I will look at those others, since I can't seem to get the Tomcat logger to work at all, which is odd considering the default logger (in server.xml) for all contexts on host seems to be working fine, as well as the logger for the admin context -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Friday, September 24, 2004 9:29 AM To: Tomcat Users List Subject: RE: Tomcat 5.0 contexts Hi, Is something wrong with my logger declaration? It does not seem to be creating the logs that I specified. Ahh, I didn't even look at that. I think it looks fine. Try specifying a known absolute directory rather than a relative one (logs) to see if that makes a difference. Heads-up -- don't spend much time on Logger configuration unless you have to. If you're already using log4j, JDK 1.4 logging, or commons-logging, stick to those and don't use a Tomcat Logger. If you're not already using one of these packages, consider starting ;) Yoav - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 5.0 contexts
I just put 5.0.28 on to my box, I was working with 4.x branch. I am not quite sure how to define my contexts any more. I do not see context entries in conf/server.xml, even the documentation make reference to contexts being in this file. I did find conf/Catalina/localhost driectory. I thought I would create a context in there, to see what happens. It didn't seem to take that context entry. I then tried to put the context entry into server.xml and it did not seem to take it either (both after tomcat restart) I created a directory in webapps called qbs, and put all the required files and directories in there. This is the contents of the qbs.xml file I created in conf/Catalina/localhost and its contents were what I used in server.xml Context path=/qbs docBase=qbs debug=0 privileged=false reloadable=true Logger className=org.apache.catalina.logger.FileLogger debug=0 directory=logs prefix=qbs_log. suffix=.txt timestamp=true verbosity=1/ /Context To note, this context was already automatically being deployed, just because it existed in the webapps directory, but I would like to override some details. What I am not seeing is the qbs_log.txt file being created, perhaps that is the only thing that is wrong here..
RE: Tomcat 5.0 contexts
Hi, Tomcat 5.0 supports putting Contexts in server.xml just like Tomcat 4.x did. In addition, you can put them in the $CATALINA_HOME/conf/[engine name]/[host name] directory for the engine and host where you want your app deployed. You can also put a META-INF/context.xml file in a WAR and deploy that WAR without any of the above context declarations. All of those should work. Yoav Shapira Millennium Research Informatics -Original Message- From: Luc Foisy [mailto:[EMAIL PROTECTED] Sent: Thursday, September 23, 2004 4:19 PM To: Tomcat User List (E-mail) Subject: Tomcat 5.0 contexts I just put 5.0.28 on to my box, I was working with 4.x branch. I am not quite sure how to define my contexts any more. I do not see context entries in conf/server.xml, even the documentation make reference to contexts being in this file. I did find conf/Catalina/localhost driectory. I thought I would create a context in there, to see what happens. It didn't seem to take that context entry. I then tried to put the context entry into server.xml and it did not seem to take it either (both after tomcat restart) I created a directory in webapps called qbs, and put all the required files and directories in there. This is the contents of the qbs.xml file I created in conf/Catalina/localhost and its contents were what I used in server.xml Context path=/qbs docBase=qbs debug=0 privileged=false reloadable=true Logger className=org.apache.catalina.logger.FileLogger debug=0 directory=logs prefix=qbs_log. suffix=.txt timestamp=true verbosity=1/ /Context To note, this context was already automatically being deployed, just because it existed in the webapps directory, but I would like to override some details. What I am not seeing is the qbs_log.txt file being created, perhaps that is the only thing that is wrong here.. This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Monitoring different Contexts with JMX MBean
Hi, I try to do my first steps with the java server platform and have chosen Tomcat for this. I wrote a class which is able to Monitor the database pools of a Context when beeing called out of it. I only had to use JNDI to iterate over comp/env/jdbc and cast the DataSource instances to a BasicDataSource. Now I want to implement an MBean which is able to monitor the pools of all Contexts of Tomcat. I even don't know whether this is possible, but hope to get some help. Now my concrete questions: - Can I somehow change the Context my code is executed in? - If not: How do I get instances of all JNDI DataSource for all Contexts ? - Where do I have to put my MBean .class-files? In the webapps dir or somewhere else? - How can I make Tomcat register my MBeans at startup? Thanks a lot in advance, Stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Binding DataSources to Contexts in Tomcat 4.06/4.1
I have a servlet that contains the following code in its init() method: public void init(ServletConfig config) throws ServletException { super.init(config); try { Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); System.out.println(Context loaded: ); ds = (DataSource) envCtx.lookup(ReportsDB); System.out.println(DataSource found: + ds.toString()); con = ds.getConnection(); con1 = ds.getConnection(); } catch(Exception e) { System.err.println(Init Error + e.getMessage()); } System.out.println(Init Complete); } the server.xml file contains: Resource name=ReportsDB auth=Container type=javax.sql.DataSource/ ResourceParams name=ReportsDB parameternamemaxActive/namevalue100/value/parameter parameternamemaxIdle/namevalue10/value/parameter parameternamemaxWait/namevalue1/value/parameter parameternameuser/namevalueuser/value/parameter parameternamepassword/namevaluepassword/value/parameter parameternamedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value/parameter parameternamedriverName/name valuejdbc:oracle:thin:@myhost.edu:1521:LIBR/value/parameter /ResourceParams When I deploy the servlet on my development server (Tomcat 4.06) it runs without error and reports Init Complete in the localhost log. The same code and xml deployed on a test server (tomcat 4.1.12) a naming exception is thrown and the catch block reports Init Error Name ReportsDB is not bound in this Context. Is there a difference between the two releases that would explain this, or are other settings involved in binding that I should be examining? All suggestions gratefully accepted :-) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Binding DataSources to Contexts in Tomcat 4.06/4.1
Hi, Where in server.xml is your Resource declaration? Is there a matching resource-ref in your web.xml? (It's required). You also probably want a factory parameter, as mentioned in the JNDI DataSources how-to. Yoav Shapira Millennium Research Informatics -Original Message- From: Jeffrey Barnett [mailto:[EMAIL PROTECTED] Sent: Thursday, August 19, 2004 2:04 PM To: Tomcat Users List Subject: Binding DataSources to Contexts in Tomcat 4.06/4.1 I have a servlet that contains the following code in its init() method: public void init(ServletConfig config) throws ServletException { super.init(config); try { Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); System.out.println(Context loaded: ); ds = (DataSource) envCtx.lookup(ReportsDB); System.out.println(DataSource found: + ds.toString()); con = ds.getConnection(); con1 = ds.getConnection(); } catch(Exception e) { System.err.println(Init Error + e.getMessage()); } System.out.println(Init Complete); } the server.xml file contains: Resource name=ReportsDB auth=Container type=javax.sql.DataSource/ ResourceParams name=ReportsDB parameternamemaxActive/namevalue100/value/parameter parameternamemaxIdle/namevalue10/value/parameter parameternamemaxWait/namevalue1/value/parameter parameternameuser/namevalueuser/value/parameter parameternamepassword/namevaluepassword/value/parameter parameternamedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value/parameter parameternamedriverName/name valuejdbc:oracle:thin:@myhost.edu:1521:LIBR/value/parameter /ResourceParams When I deploy the servlet on my development server (Tomcat 4.06) it runs without error and reports Init Complete in the localhost log. The same code and xml deployed on a test server (tomcat 4.1.12) a naming exception is thrown and the catch block reports Init Error Name ReportsDB is not bound in this Context. Is there a difference between the two releases that would explain this, or are other settings involved in binding that I should be examining? All suggestions gratefully accepted :-) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Binding DataSources to Contexts in Tomcat 4.06/4.1
In both servers the Resource declarations are in the DefaultContext block. All DataSources are shared by all webapps. I do not have a resource-ref declaration in either web.xml ... I'll go look that up and remedy. What is the purpose of the factory parameter, and what is an appropriate value? thx Shapira, Yoav wrote: Hi, Where in server.xml is your Resource declaration? Is there a matching resource-ref in your web.xml? (It's required). You also probably want a factory parameter, as mentioned in the JNDI DataSources how-to. Yoav Shapira Millennium Research Informatics -Original Message- From: Jeffrey Barnett [mailto:[EMAIL PROTECTED] Sent: Thursday, August 19, 2004 2:04 PM To: Tomcat Users List Subject: Binding DataSources to Contexts in Tomcat 4.06/4.1 I have a servlet that contains the following code in its init() method: public void init(ServletConfig config) throws ServletException { super.init(config); try { Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); System.out.println(Context loaded: ); ds = (DataSource) envCtx.lookup(ReportsDB); System.out.println(DataSource found: + ds.toString()); con = ds.getConnection(); con1 = ds.getConnection(); } catch(Exception e) { System.err.println(Init Error + e.getMessage()); } System.out.println(Init Complete); } the server.xml file contains: Resource name=ReportsDB auth=Container type=javax.sql.DataSource/ ResourceParams name=ReportsDB parameternamemaxActive/namevalue100/value/parameter parameternamemaxIdle/namevalue10/value/parameter parameternamemaxWait/namevalue1/value/parameter parameternameuser/namevalueuser/value/parameter parameternamepassword/namevaluepassword/value/parameter parameternamedriverClassName/name valueoracle.jdbc.driver.OracleDriver/value/parameter parameternamedriverName/name valuejdbc:oracle:thin:@myhost.edu:1521:LIBR/value/parameter /ResourceParams When I deploy the servlet on my development server (Tomcat 4.06) it runs without error and reports Init Complete in the localhost log. The same code and xml deployed on a test server (tomcat 4.1.12) a naming exception is thrown and the catch block reports Init Error Name ReportsDB is not bound in this Context. Is there a difference between the two releases that would explain this, or are other settings involved in binding that I should be examining? All suggestions gratefully accepted :-) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Binding DataSources to Contexts in Tomcat 4.06/4.1
Hi, In both servers the Resource declarations are in the DefaultContext block. All DataSources are shared by all webapps. You realize that by placing a Resource in DefaultContext you ensure that a separate copy is created for each Context, right? That means if you configure for 10 max connections and have 5 Contexts, you will have 5 DataSources with 50 total max connections possible. Unless this is really what you want, consider having the DataSource defined in the actual Context element instead of DefaultContext. I do not have a resource-ref declaration in either web.xml ... I'll go look that up and remedy. OK -- it's required. What is the purpose of the factory parameter, and what is an appropriate value? To specify a factory for pooling connections. The default value for DBCP is parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter This is documented on the JNDI DataSources How-To page. I suggest you read it if you haven't already: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples -howto.html. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Binding DataSources to Contexts in Tomcat 4.06/4.1
I'm sure your explanation as well as a (re) reading of the How To will allow me to correct the problem. Thanks very much! I'd like a little more explanation however about your advice on using DefaultContext. In addition to the advantage of having a single place to add, remove, and change resources and resource parameters (e.g. passwords), I THOUGHT I was sharing a single copy of the resources. I understand now that a separate copy is created for every application. But what I don't understand is how putting every resource in every actual context is better. If I have 5 applications, each of whose actual context contain 10 connections, won't I still have 50 connections? Shapira, Yoav wrote: You realize that by placing a Resource in DefaultContext you ensure that a separate copy is created for each Context, right? That means if you configure for 10 max connections and have 5 Contexts, you will have 5 DataSources with 50 total max connections possible. Unless this is really what you want, consider having the DataSource defined in the actual Context element instead of DefaultContext. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Binding DataSources to Contexts in Tomcat 4.06/4.1
Hi, passwords), I THOUGHT I was sharing a single copy of the resources. I understand now that a separate copy is created for every application. But what I don't understand is how putting every resource in every actual context is better. If I have 5 applications, each of whose actual context contain 10 connections, won't I still have 50 connections? This is what GlobalNamingResources (and then you need an associated ResourceLink inside the Context element) is for: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/globalresources.h tml. Yoav This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Multiple contexts mapped to single docbase
Hi, You can have as many Contexts as you want mapped to the same docBase, but the path has to be different. Path usually starts with a / by the way, except for the default (ROOT) webapp whose path is . Yoav Shapira Millennium Research Informatics -Original Message- From: Robert Hunt [mailto:[EMAIL PROTECTED] Sent: Sunday, August 01, 2004 3:33 PM To: [EMAIL PROTECTED] Subject: Re: Multiple contexts mapped to single docbase This seems to work: [server.xml excerpted] --- !-- uses standard web.xml as deployment descriptor -- Context path=myWWW docBase=appXyz ... / !-- uses webdav.xml as deployment descriptor -- Context path=myWebDav docBase=appXyz defaultWebXml=full pathspec\WEB-INF\webdav.xml ... / --- where webdav.xml contains the standard webdav servlet definitions and necessary security constraints. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Multiple contexts mapped to single docbase
Re: multiple mappings; not exactly the point and I apologize for not specifying that 'docBase=appXyz' (in both Context/ descriptors) should be an absolute reference. The point was to have multiple contexts mapped to the same docbase, BUT, with each context having its OWN web.xml deployment descriptor. Using the undocumented (you don't see it listed in most texts) defaultWebXml feature achieves this purpose. But, as it is undocumented, I'm wondering if there's a better/more-robust (read: supported) method. -- RH - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple contexts mapped to single docbase
This seems to work: [server.xml excerpted] --- !-- uses standard web.xml as deployment descriptor -- Context path=myWWW docBase=appXyz ... / !-- uses webdav.xml as deployment descriptor -- Context path=myWebDav docBase=appXyz defaultWebXml=full pathspec\WEB-INF\webdav.xml ... / --- where webdav.xml contains the standard webdav servlet definitions and necessary security constraints. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Multiple contexts mapped to single docbase
I'd like two contexts mapped to a single docbase. The first context would use default servlets (and mappings) to serve the site for regular http requests. I'd like the second context to be served by the webdav servlet, so that it could be updatable by authorized users. Both contexts need to rely on the same docbase so that changes made by the webDAV users would be immediately readable by regular web http clients. The problem I'm having is that, to my knowledge, there can be only one WEB-INF/web.xml per Context docBase=abc/ definition, but it's the web.xml file that maps servlets (either the default or webdav servlets) and defines security constraints (or lack thereof). Some other points: -- Tomcat 5.0.25 running on WinXP (NTFS volumes) -- the entire web-app is covered by url-pattern/*/url-pattern, be it servlet mappings or security constraints. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Point Apache at Tomcat Contexts via JkMount
Re: Tomcat Admin Tool - Point taken. :-P Re: jkMount - If I understand correctly jkMount involves pointing Apache Virtual Hosts at specific jk2 workers. The example from the jakarta site shows: # send all requests ending in .jsp to worker1 JkMount /*.jsp worker1 # send all requests jsp requests to files located in /otherworker will go worker2 JkMount /otherworker/*.jsp worker2 so given the example, I would have two workers defined in my worker2.properties file, and it would look something like: [channel.socket:localhost:8009] port=8009 host=127.0.0.1 # define the worker [worker1:localhost:8009] channel=channel.socket:localhost:8009 [channel.socket:localhost:8010] port=8010 host=127.0.0.1 # define the worker [worker2:localhost:8010] channel=channel.socket:localhost:8010 What i have now is two Apache Virtual Hosts, pointing to 2 different jk2 workers, who are in turn pointing to 2 different instances of Tomcat running on the same machine, but different ports. At first blush, this solves my problem. Although it's not what I original had in mind. Changes to the Tomcat server.xml of 1 virtual host will cause that instance of Tomcat to be restarted, and other virtual hosts running tomcat on my server are unaffected. but, a few questions remain: 1. is this how it is done? I understand that there is no single answer, but I would get some feeling of comfort knowing that this is how most people solve this problem. 2. what can i expect in terms of memory requirements? If I have 12 virtual hosts running 12 instances of Tomcat . . .? is this model scalable? at what point does it stop being scalable? (20 hosts? 50? 500?) 3. what's the catch? :-) there's always a catch! Thanks for your continued time and patience with this thread. Sincerely, Matthew Mamet From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Tue 7/27/2004 10:37 AM To: Tomcat Users List Subject: RE: Point Apache at Tomcat Contexts Hi, The Tomcat Admin tool is hardly production-grade, I think we can all agree, but the Tomcat Manager Tool allows addition and removal of contexts without restarting Tomcat. We'd like to hang our hopes on that :-) Patches and any other contributions are always welcome ;) I think you can point configure Apache/mod_jk to point at specific Tomcat contexts using the jkMount directive. There are examples at http://jakarta.apache.org/tomcat/connectors-doc/jk2/jk/aphowto.html#mod_ jk%20Directives. Yoav This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Point Apache at Tomcat Contexts via JkMount
Has anyone had time to think on this? Any thoughts or advice is greatly appreciated. Thx From: Matthew Mamet [mailto:[EMAIL PROTECTED] Sent: Wed 7/28/2004 9:10 AM To: Tomcat Users List Subject: RE: Point Apache at Tomcat Contexts via JkMount Re: Tomcat Admin Tool - Point taken. :-P Re: jkMount - If I understand correctly jkMount involves pointing Apache Virtual Hosts at specific jk2 workers. The example from the jakarta site shows: # send all requests ending in .jsp to worker1 JkMount /*.jsp worker1 # send all requests jsp requests to files located in /otherworker will go worker2 JkMount /otherworker/*.jsp worker2 so given the example, I would have two workers defined in my worker2.properties file, and it would look something like: [channel.socket:localhost:8009] port=8009 host=127.0.0.1 # define the worker [worker1:localhost:8009] channel=channel.socket:localhost:8009 [channel.socket:localhost:8010] port=8010 host=127.0.0.1 # define the worker [worker2:localhost:8010] channel=channel.socket:localhost:8010 What i have now is two Apache Virtual Hosts, pointing to 2 different jk2 workers, who are in turn pointing to 2 different instances of Tomcat running on the same machine, but different ports. At first blush, this solves my problem. Although it's not what I original had in mind. Changes to the Tomcat server.xml of 1 virtual host will cause that instance of Tomcat to be restarted, and other virtual hosts running tomcat on my server are unaffected. but, a few questions remain: 1. is this how it is done? I understand that there is no single answer, but I would get some feeling of comfort knowing that this is how most people solve this problem. 2. what can i expect in terms of memory requirements? If I have 12 virtual hosts running 12 instances of Tomcat . . .? is this model scalable? at what point does it stop being scalable? (20 hosts? 50? 500?) 3. what's the catch? :-) there's always a catch! Thanks for your continued time and patience with this thread. Sincerely, Matthew Mamet From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Tue 7/27/2004 10:37 AM To: Tomcat Users List Subject: RE: Point Apache at Tomcat Contexts Hi, The Tomcat Admin tool is hardly production-grade, I think we can all agree, but the Tomcat Manager Tool allows addition and removal of contexts without restarting Tomcat. We'd like to hang our hopes on that :-) Patches and any other contributions are always welcome ;) I think you can point configure Apache/mod_jk to point at specific Tomcat contexts using the jkMount directive. There are examples at http://jakarta.apache.org/tomcat/connectors-doc/jk2/jk/aphowto.html#mod_ jk%20Directives. Yoav This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Point Apache at Tomcat Contexts
Hi, I'm a developer for a small hosting company. We currently host Java-enabled sites on a windows server. We use IIS, jk2, and Tomcat to serve Java. The problem we have is that every time the Tomcat server.xml is touched (new site, new context, etc), we have to restart Tomcat, and that affects every site we host. We are now trying to replace IIS with Apache (mod_jk2), in the hopes that there might be a way to point Apache Virtual Hosts at Tomcat Contexts, instead of Tomcat Virtual Hosts - although I'm not sure how this could even be done. The Tomcat Admin tool is hardly production-grade, I think we can all agree, but the Tomcat Manager Tool allows addition and removal of contexts without restarting Tomcat. We'd like to hang our hopes on that :-) Any help in this regard, (or suggestions for a different servlet container . . .) would be greatly appreciated.
RE: Point Apache at Tomcat Contexts
Hi, The Tomcat Admin tool is hardly production-grade, I think we can all agree, but the Tomcat Manager Tool allows addition and removal of contexts without restarting Tomcat. We'd like to hang our hopes on that :-) Patches and any other contributions are always welcome ;) I think you can point configure Apache/mod_jk to point at specific Tomcat contexts using the jkMount directive. There are examples at http://jakarta.apache.org/tomcat/connectors-doc/jk2/jk/aphowto.html#mod_ jk%20Directives. Yoav This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Accessing Multiple Contexts
Hi I have 2 web apps configured in a single tomcat 4.1.24 server and each one's docbase is pointing to a .war file. I have two questions. 1. Is it possible to access functionality from one webapp to another one? If yes, how I can I do that. 2. How can I get context paths of all the web apps in my tomcat server? Thanks RK
Saving on Database Pool when having Multiple Contexts
I have multiple apps/contexts that access the same database and uses dbcp. My worry is that on each of my context i will declare the dbcp for the database, can i just declare one dbcp and each context/app can share that??? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Security constraints for different contexts
Just wanted to ask this question again...does anyone have any ideas?? I'm really stuck here, any good tutorials or resources about security constraints would be helpful. All of the ones I've seen online only handle one constraint at a time, I've never seen how they work in terms of best match first or otherwise. Thanks, Rahman At 7/2/2004 11:47 AM, you wrote: Hello, I'm using Tomcat 5.0.25 and I'd like to use container-based security to restrict access to one specific page. The problem is that this page exists in different contexts, but using the same docbase. You can get a better idea by looking at the first snippet included below. You can see that the application itself is installed by default at context /wiki, and there will be additional copies at /wiki/wikione and so on. My goal is to restrict /wiki/Edit.jsp to one role, /wiki/wikione/Edit.jsp to another role, etc. The web.xml I'm using right now doesn't even prompt for authentication at all; the only time I can get it to authorize anything is when I only have one security constraint, for url-pattern /Edit.jsp. Is there an easy to way to achieve this? Thanks... Rahman Server.xml snippet: Context path=/wiki/wikione docBase=wiki debug=0 Parameter name=jspwiki.propertyfile value=C:\tomcat\webapps\wiki\WEB-INF\wikione.properties override=false/ /Context The application's web.xml snippet: security-constraint web-resource-collection web-resource-nameProtected Area/web-resource-name url-pattern/wiki/Edit.jsp/url-pattern http-methodDELETE/http-method http-methodGET/http-method http-methodPOST/http-method http-methodPUT/http-method /web-resource-collection auth-constraint role-namewikiadmin/role-name /auth-constraint /security-constraint security-constraint web-resource-collection web-resource-nameProtected Area/web-resource-name url-pattern/wiki/wikione/Edit.jsp/url-pattern http-methodDELETE/http-method http-methodGET/http-method http-methodPOST/http-method http-methodPUT/http-method /web-resource-collection auth-constraint role-namewikioneadmin/role-name /auth-constraint /security-constraint login-config auth-methodBASIC/auth-method realm-nameJSPWiki Editor/realm-name /login-config - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Security constraints for different contexts
Hello, I'm using Tomcat 5.0.25 and I'd like to use container-based security to restrict access to one specific page. The problem is that this page exists in different contexts, but using the same docbase. You can get a better idea by looking at the first snippet included below. You can see that the application itself is installed by default at context /wiki, and there will be additional copies at /wiki/wikione and so on. My goal is to restrict /wiki/Edit.jsp to one role, /wiki/wikione/Edit.jsp to another role, etc. The web.xml I'm using right now doesn't even prompt for authentication at all; the only time I can get it to authorize anything is when I only have one security constraint, for url-pattern /Edit.jsp. Is there an easy to way to achieve this? Thanks... Rahman Server.xml snippet: Context path=/wiki/wikione docBase=wiki debug=0 Parameter name=jspwiki.propertyfile value=C:\tomcat\webapps\wiki\WEB-INF\wikione.properties override=false/ /Context The application's web.xml snippet: security-constraint web-resource-collection web-resource-nameProtected Area/web-resource-name url-pattern/wiki/Edit.jsp/url-pattern http-methodDELETE/http-method http-methodGET/http-method http-methodPOST/http-method http-methodPUT/http-method /web-resource-collection auth-constraint role-namewikiadmin/role-name /auth-constraint /security-constraint security-constraint web-resource-collection web-resource-nameProtected Area/web-resource-name url-pattern/wiki/wikione/Edit.jsp/url-pattern http-methodDELETE/http-method http-methodGET/http-method http-methodPOST/http-method http-methodPUT/http-method /web-resource-collection auth-constraint role-namewikioneadmin/role-name /auth-constraint /security-constraint login-config auth-methodBASIC/auth-method realm-nameJSPWiki Editor/realm-name /login-config - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Controlling authentication on multiple contexts which point to the same webapp
If you have multiple contexts which point to the same webapp, is there a way of only applying authentication to specified contexts? e.g. something along the lines of; Context path=/webapp1 docBase=/webapps/a_web_app authenticate=true etc... /Context Context path=/webapp2 docBase=/webapps/a_web_app authenticate=false etc... /Context Since the authentication is controlled by the WEB-INF/web.xml file, alternatively is it possible to specify different web.xml files per context. Many Thanks Jason Saunders
Can I create manager/admin contexts in a new host without restart ing Tomcat 5?
Tomcat 5 works well with context creation without shutting down the Tomcat server. However, I need to add admintool and manager contexts to a new host, e.g test.tlg.ca, so that I can reload/start/stop application contexts in test.tlg.ca host. However, it seems that the admintool/manager contexts for test.tlg.ca created using admintool under localhost host don't have privileged=true. Thus these contexts always throw exceptions. I can only manually put privileged=true in them and restart the whole server. Since my application will be deployed remotely and root access for manager.xml/admin.xml files won't be available, is there a workaround? Thank you very much. Best regards, Sheng - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: forwarding across contexts?
Hi, In short, how does one deploy a war file such that it looks for content (/images/whatever.gif) in a configurable location in the file system? Configure the server to serve that WAR file with a context path of (the empty string). This can be done in tomcat in three ways: - Add a Context entry in conf/server.xml whose path= and docBase is your WAR - Add an xml file with the Context tag to conf/[engine name]/[host name] (same path and docBase) - Put same XML file as above in your WAR file's META-INF directory instead of under the conf directory (tomcat 5 only). Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: forwarding across contexts?
Thanks once again. This is very helpful. Now here's what I really want (it never ends, does it): Is there a way, within a single context, to separate out the static content to some other file system location. I'd like to be able to deploy my war file with library jars, configuration info, classes, etc., into the safe location within the jboss deploy directory. But, I'd like to have all of my static content (again, /images/whatever.gif) elsewhere on the file system. I believe that Yoav's suggestion is that I set up the empty path () context for this purpose. However, this is where I started, and Justin argued against this cross-context approach. So is there a way to accomplish this separation within a single context? Many, many thanks. It's amazing how, even with a stack of books and google and jakarta and all, there's no substitute for talking with people. Fred At 07:37 AM 5/11/2004, you wrote: Hi, In short, how does one deploy a war file such that it looks for content (/images/whatever.gif) in a configurable location in the file system? Configure the server to serve that WAR file with a context path of (the empty string). This can be done in tomcat in three ways: - Add a Context entry in conf/server.xml whose path= and docBase is your WAR - Add an xml file with the Context tag to conf/[engine name]/[host name] (same path and docBase) - Put same XML file as above in your WAR file's META-INF directory instead of under the conf directory (tomcat 5 only). Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: forwarding across contexts?
Hi, Is there a way, within a single context, to separate out the static content to some other file system location. Of course, there are many ways, none of them advised. You want to keep your webapp as a whole, that's the whole point of a WAR file. You can symlink (at the filesystem level) or use normal HTTP linking to access your static content. But you can't symlink in a WAR, so... I believe that Yoav's suggestion is that I set up the empty path () context for this purpose. However, this is where I started, and Justin argued against this cross-context approach. And I agree with Justin, just to be clear. I wasn't advocating anything different from what he said, just showing you that it can technically be done. If crossContext forwards are the worst design choices on this list, we'll be in great shape. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: forwarding across contexts?
Yoav, Let me describe a bit about our application, just in case you (or anyone else) have some specific advice. My client is a publisher, and the bulk of the site will be many thousands of published articles and associated content such as figure, tables, etc. The HTML content, however, will be served by tomcat, since it has some dynamic components. This is why it's not practical to bundle everything into a war file. Instead, I need tomcat to point to the file system where many users will be building the site. On the other hand, the war file can easily contain the java infrastructure (struts, velocity, configuration information, etc.). I'd like to be able to keep the small war file, hot deploy, etc., but have the raw content (static and otherwise) live elsewhere. Given that, would you solve it with multiple contexts? Or do you have another suggestion? Thanks again, Fred At 10:08 AM 5/11/2004, you wrote: Hi, Is there a way, within a single context, to separate out the static content to some other file system location. Of course, there are many ways, none of them advised. You want to keep your webapp as a whole, that's the whole point of a WAR file. You can symlink (at the filesystem level) or use normal HTTP linking to access your static content. But you can't symlink in a WAR, so... I believe that Yoav's suggestion is that I set up the empty path () context for this purpose. However, this is where I started, and Justin argued against this cross-context approach. And I agree with Justin, just to be clear. I wasn't advocating anything different from what he said, just showing you that it can technically be done. If crossContext forwards are the worst design choices on this list, we'll be in great shape. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: forwarding across contexts?
Fred, Thanks for the additional info about your app ... it makes it much easier to talk about these things. :) There are many (valid) ways to proceed, many of which vary in the amount of standards they adhere to (how much you want to align yourself with Tomcat). I'll just give you my thoughts. At 09:02 AM 5/11/2004, you wrote: Let me describe a bit about our application, just in case you (or anyone else) have some specific advice. My client is a publisher, and the bulk of the site will be many thousands of published articles and associated content such as figure, tables, etc. The HTML content, however, will be served by tomcat, since it has some dynamic components. The biggest question, then, has to do with your security requirements. Specifically, does this content need to be protected or can it just sit out there for anyone to grab? If it need not be protected, this is, IMHO, a textbook example of when to use Apache. You've got a large collection of static data and a relatively small web application associated with it. You've probably got different groups working on the different parts (the publisher's content and the HTML pages), so it makes sense to separate it out and serve the static content by generating links to your static web server's content from your dynamic HTML. Additionally, you could then put the two pieces on separate machines (one or more with Apache, one or more with Tomcat) to keep them separated even more cleanly. If the content needs to be protected, I would create a separate directory and put the content there. Symlink this to the base of your Tomcat webApp and let Tomcat serve it normally, employing whatever security scheme you're using. You won't be able to deploy the entire thing as a single WAR, but it doesn't sound like you really care to do this anyways. This is why it's not practical to bundle everything into a war file. Instead, I need tomcat to point to the file system where many users will be building the site. On the other hand, the war file can easily contain the java infrastructure (struts, velocity, configuration information, etc.). I'd like to be able to keep the small war file, hot deploy, etc., but have the raw content (static and otherwise) live elsewhere. Given that, would you solve it with multiple contexts? Or do you have another suggestion? Alternately, you could extend the DefaultServlet (if you don't mind tying yourself to Tomcat and your version) with your own custom static content servlet that gets data from an arbitrary directory. If you can't be tied to Tomcat, use the source as a base to write your own default servlet. This solution is more on the slick side of things, so it wouldn't be preferable ... better to stay within the mainstream boundaries. If you can, look into symlinking or Apache. Consider the extend/impl DefaultServlet idea. If you're still not satisfied, having two separate contexts can be made to work. Perhaps others have additional ideas. Fred Good luck, justin At 10:08 AM 5/11/2004, you wrote: Hi, Is there a way, within a single context, to separate out the static content to some other file system location. Of course, there are many ways, none of them advised. You want to keep your webapp as a whole, that's the whole point of a WAR file. You can symlink (at the filesystem level) or use normal HTTP linking to access your static content. But you can't symlink in a WAR, so... I believe that Yoav's suggestion is that I set up the empty path () context for this purpose. However, this is where I started, and Justin argued against this cross-context approach. And I agree with Justin, just to be clear. I wasn't advocating anything different from what he said, just showing you that it can technically be done. If crossContext forwards are the worst design choices on this list, we'll be in great shape. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Justin Ruthenbeck Software Engineer, NextEngine Inc. justinr - AT - nextengine DOT com Confidential. See: http://www.nextengine.com/confidentiality.php __ - To unsubscribe, e
RE: forwarding across contexts?
Justin, Thanks again for taking the time to think about this with me. Alas, my customer's deployment platform is windows. So no symlinks. No Apache (they use IIS). Complicated security model for everything on the site except for decorative gifs. So Tomcat does it all! Thanks, Fred At 03:13 PM 5/11/2004, you wrote: Fred, Thanks for the additional info about your app ... it makes it much easier to talk about these things. :) There are many (valid) ways to proceed, many of which vary in the amount of standards they adhere to (how much you want to align yourself with Tomcat). I'll just give you my thoughts. At 09:02 AM 5/11/2004, you wrote: Let me describe a bit about our application, just in case you (or anyone else) have some specific advice. My client is a publisher, and the bulk of the site will be many thousands of published articles and associated content such as figure, tables, etc. The HTML content, however, will be served by tomcat, since it has some dynamic components. The biggest question, then, has to do with your security requirements. Specifically, does this content need to be protected or can it just sit out there for anyone to grab? If it need not be protected, this is, IMHO, a textbook example of when to use Apache. You've got a large collection of static data and a relatively small web application associated with it. You've probably got different groups working on the different parts (the publisher's content and the HTML pages), so it makes sense to separate it out and serve the static content by generating links to your static web server's content from your dynamic HTML. Additionally, you could then put the two pieces on separate machines (one or more with Apache, one or more with Tomcat) to keep them separated even more cleanly. If the content needs to be protected, I would create a separate directory and put the content there. Symlink this to the base of your Tomcat webApp and let Tomcat serve it normally, employing whatever security scheme you're using. You won't be able to deploy the entire thing as a single WAR, but it doesn't sound like you really care to do this anyways. This is why it's not practical to bundle everything into a war file. Instead, I need tomcat to point to the file system where many users will be building the site. On the other hand, the war file can easily contain the java infrastructure (struts, velocity, configuration information, etc.). I'd like to be able to keep the small war file, hot deploy, etc., but have the raw content (static and otherwise) live elsewhere. Given that, would you solve it with multiple contexts? Or do you have another suggestion? Alternately, you could extend the DefaultServlet (if you don't mind tying yourself to Tomcat and your version) with your own custom static content servlet that gets data from an arbitrary directory. If you can't be tied to Tomcat, use the source as a base to write your own default servlet. This solution is more on the slick side of things, so it wouldn't be preferable ... better to stay within the mainstream boundaries. If you can, look into symlinking or Apache. Consider the extend/impl DefaultServlet idea. If you're still not satisfied, having two separate contexts can be made to work. Perhaps others have additional ideas. Fred Good luck, justin At 10:08 AM 5/11/2004, you wrote: Hi, Is there a way, within a single context, to separate out the static content to some other file system location. Of course, there are many ways, none of them advised. You want to keep your webapp as a whole, that's the whole point of a WAR file. You can symlink (at the filesystem level) or use normal HTTP linking to access your static content. But you can't symlink in a WAR, so... I believe that Yoav's suggestion is that I set up the empty path () context for this purpose. However, this is where I started, and Justin argued against this cross-context approach. And I agree with Justin, just to be clear. I wasn't advocating anything different from what he said, just showing you that it can technically be done. If crossContext forwards are the worst design choices on this list, we'll be in great shape. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
RE: forwarding across contexts?
At 01:04 PM 5/11/2004, you wrote: Justin, Thanks again for taking the time to think about this with me. Alas, my customer's deployment platform is windows. So no symlinks. No Apache (they use IIS). Complicated security model for everything on the site except for decorative gifs. So Tomcat does it all! In that case, I would personally either extend or implement the DefaultServlet to read resources from a designated local location (given by a servlet init param). It seems silly to add a webApp that consists only of static content in this case ... but you know how to do it if you deem that best. Once you decide what you're going to do and implement it, I'd be curious to get your feedback and/or comments on your method. If you remember this conversation when you're done, shoot me/us an email with any observations. Good luck, justin At 03:13 PM 5/11/2004, you wrote: Fred, Thanks for the additional info about your app ... it makes it much easier to talk about these things. :) There are many (valid) ways to proceed, many of which vary in the amount of standards they adhere to (how much you want to align yourself with Tomcat). I'll just give you my thoughts. At 09:02 AM 5/11/2004, you wrote: Let me describe a bit about our application, just in case you (or anyone else) have some specific advice. My client is a publisher, and the bulk of the site will be many thousands of published articles and associated content such as figure, tables, etc. The HTML content, however, will be served by tomcat, since it has some dynamic components. The biggest question, then, has to do with your security requirements. Specifically, does this content need to be protected or can it just sit out there for anyone to grab? If it need not be protected, this is, IMHO, a textbook example of when to use Apache. You've got a large collection of static data and a relatively small web application associated with it. You've probably got different groups working on the different parts (the publisher's content and the HTML pages), so it makes sense to separate it out and serve the static content by generating links to your static web server's content from your dynamic HTML. Additionally, you could then put the two pieces on separate machines (one or more with Apache, one or more with Tomcat) to keep them separated even more cleanly. If the content needs to be protected, I would create a separate directory and put the content there. Symlink this to the base of your Tomcat webApp and let Tomcat serve it normally, employing whatever security scheme you're using. You won't be able to deploy the entire thing as a single WAR, but it doesn't sound like you really care to do this anyways. This is why it's not practical to bundle everything into a war file. Instead, I need tomcat to point to the file system where many users will be building the site. On the other hand, the war file can easily contain the java infrastructure (struts, velocity, configuration information, etc.). I'd like to be able to keep the small war file, hot deploy, etc., but have the raw content (static and otherwise) live elsewhere. Given that, would you solve it with multiple contexts? Or do you have another suggestion? Alternately, you could extend the DefaultServlet (if you don't mind tying yourself to Tomcat and your version) with your own custom static content servlet that gets data from an arbitrary directory. If you can't be tied to Tomcat, use the source as a base to write your own default servlet. This solution is more on the slick side of things, so it wouldn't be preferable ... better to stay within the mainstream boundaries. If you can, look into symlinking or Apache. Consider the extend/impl DefaultServlet idea. If you're still not satisfied, having two separate contexts can be made to work. Perhaps others have additional ideas. Fred Good luck, justin At 10:08 AM 5/11/2004, you wrote: Hi, Is there a way, within a single context, to separate out the static content to some other file system location. Of course, there are many ways, none of them advised. You want to keep your webapp as a whole, that's the whole point of a WAR file. You can symlink (at the filesystem level) or use normal HTTP linking to access your static content. But you can't symlink in a WAR, so... I believe that Yoav's suggestion is that I set up the empty path () context for this purpose. However, this is where I started, and Justin argued against this cross-context approach. And I agree with Justin, just to be clear. I wasn't advocating anything different from what he said, just showing you that it can technically be done. If crossContext forwards are the worst design choices on this list, we'll be in great shape. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed
forwarding across contexts?
Hi, I'm trying to install a filter into the default context that forwards to my application (in another context) and it doesn't seem to want to work. (jboss 3.2.3 with embedded tomcat 4.1.29) In researching this, I've seen various hints that this may in fact be illegal. Can anyone confirm? The REASON I want to do this is that I want to be able to take advantage of simple URLS with the default context, as in /images/whatever.gif, and have them be served by DefaultServlet, which conveniently knows how to handle all that sort of stuff, set mime types, etc. I'm also hoping that DefaultServlet was written by someone more clever than me! But, I also want to capture certain simple URLs and forward these to another context. As in /protected.html needs to be forwarded to /accesscheck/protected.html or similar. Am I on the wrong track here? Is it possible to forward (via RequestDispatcher) from one context to another? If not, how can I take advantage of DefaultServlet in my application? Many thanks, Fred Toth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: forwarding across contexts?
At 07:04 PM 5/10/2004, you wrote: Hi, I'm trying to install a filter into the default context that forwards to my application (in another context) and it doesn't seem to want to work. (jboss 3.2.3 with embedded tomcat 4.1.29) In researching this, I've seen various hints that this may in fact be illegal. Can anyone confirm? It is generally good design practice to limit interactions between your webapps except for strongly defined specific interfaces that promote modularity. Doing something like you're suggesting will likely lead to messy, difficult code to work with ... not because it's a necessarily bad design idea, but rather because the premise behind J2EE is that code bases are designed, coded, deployed, and maintained as independent applications. They're not meant to ineroperate in a fluid way. It's possible to do what you're suggesting, but not recommended. The REASON I want to do this is that I want to be able to take advantage of simple URLS with the default context, as in /images/whatever.gif, and have them be served by DefaultServlet, which conveniently knows how to handle all that sort of stuff, set mime types, etc. I'm also hoping that DefaultServlet was written by someone more clever than me! Resources need not be within the ROOT web application to be served by the DefaultServlet. You'll notice that the DefaultServlet is defined within the global web.xml (I haven't worked with recent versions of jBoss, so I'm not sure exactly where they put this these days), which means that all applications inherit it. This means that resources like /images/whatever.gif and /mywebapp/images/whatever.gif will both be served by the DefaultServlet unless you configure it otherwise. But, I also want to capture certain simple URLs and forward these to another context. As in /protected.html needs to be forwarded to /accesscheck/protected.html or similar. Am I on the wrong track here? Is it possible to forward (via RequestDispatcher) from one context to another? If not, how can I take advantage of DefaultServlet in my application? See ServletContext#getContext(String). Again, I predict you'll find this to be a clunky and frustrating way to do things. Unless you have an over-riding reason to do otherwise, embrace the idea of separate and distinct web applications and let the container do this URL parsing and forwarding for you. Many thanks, Fred Toth Good luck, justin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: forwarding across contexts?
Justin, Thanks very much for your considered reply. You both solved my problem and made me question my approach at the same time. In re-thinking this in terms of separated webapps, I've hit another issue. If I solve this problem within one particular web application, I have to be able to point this webapp to another place in the file system (other than $CATALINA_HOME/webapp). I had figured out how to do that with the ROOT application, but I'm not sure how to do this within a war file. In short, how does one deploy a war file such that it looks for content (/images/whatever.gif) in a configurable location in the file system? If I can figure that out, I think I can abandon the cross-context issue for good! Thanks, Fred At 10:23 PM 5/10/2004, you wrote: At 07:04 PM 5/10/2004, you wrote: Hi, I'm trying to install a filter into the default context that forwards to my application (in another context) and it doesn't seem to want to work. (jboss 3.2.3 with embedded tomcat 4.1.29) In researching this, I've seen various hints that this may in fact be illegal. Can anyone confirm? It is generally good design practice to limit interactions between your webapps except for strongly defined specific interfaces that promote modularity. Doing something like you're suggesting will likely lead to messy, difficult code to work with ... not because it's a necessarily bad design idea, but rather because the premise behind J2EE is that code bases are designed, coded, deployed, and maintained as independent applications. They're not meant to ineroperate in a fluid way. It's possible to do what you're suggesting, but not recommended. The REASON I want to do this is that I want to be able to take advantage of simple URLS with the default context, as in /images/whatever.gif, and have them be served by DefaultServlet, which conveniently knows how to handle all that sort of stuff, set mime types, etc. I'm also hoping that DefaultServlet was written by someone more clever than me! Resources need not be within the ROOT web application to be served by the DefaultServlet. You'll notice that the DefaultServlet is defined within the global web.xml (I haven't worked with recent versions of jBoss, so I'm not sure exactly where they put this these days), which means that all applications inherit it. This means that resources like /images/whatever.gif and /mywebapp/images/whatever.gif will both be served by the DefaultServlet unless you configure it otherwise. But, I also want to capture certain simple URLs and forward these to another context. As in /protected.html needs to be forwarded to /accesscheck/protected.html or similar. Am I on the wrong track here? Is it possible to forward (via RequestDispatcher) from one context to another? If not, how can I take advantage of DefaultServlet in my application? See ServletContext#getContext(String). Again, I predict you'll find this to be a clunky and frustrating way to do things. Unless you have an over-riding reason to do otherwise, embrace the idea of separate and distinct web applications and let the container do this URL parsing and forwarding for you. Many thanks, Fred Toth Good luck, justin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie problem with JSP contexts virtual hosts
Hi, that looks ok to me. You can specify as many servlets as you want to map/handle various type of patterns. But I don't quite understand what you mean by having a new instance of JspServlet with each host is a overhead. Because that's probably something you want anyways. -Yan -Original Message- From: James Bucanek [mailto:[EMAIL PROTECTED] Sent: April 13, 2004 00:07 To: Tomcat Users List Subject: Re: Newbie problem with JSP contexts virtual hosts While I didn't get any suggestions or feedback on my original question, I believe I've found a solution. Now I just need to run it by the group to see if it's Kosher. James Bucanek wrote on Sunday, April 11, 2004: !-- Virtual host: www.hotelmidnight.net -- !-- (jlb 11-April-2004) Added virtual host -- Host name=www.hotelmidnight.net debug=0 appBase=/Users/darkthirty/Sites unpackWARs=false autoDeploy=true !-- Context for the top-level web application -- Context path= docBase=. debug=99 reloadable=true/ /Host clip web-app display-namedarkthirty/display-name descriptiondarkthirty.net artwork application/description !-- Global parameters for this web application -- context-param param-nametest/param-name param-valueSome Value/param-value /context-param /web-app The basic problem with this arrangement is that my JSP pages ran in the context of the 'jsp' servlet that's defined in ${CATALINA_HOME}/conf/web.xml for the default Host, not the Context that I defined in my web-app that I want to run in my virtual Host. So, it occurred to me that I could create may own instance of the JSP engine as my Servlet. Now that I have a Servlet to reference, I can then map all of the *.jsp files in my virtual host to that: web-app display-namedarkthirty/display-name descriptiondarkthirty.net artwork application/description !-- Global parameters available to all web applications -- context-param param-nametest/param-name param-valueSome Value/param-value /context-param servlet servlet-namejsp2/servlet-name servlet-classorg.apache.jasper.servlet.JspServlet/servlet-class init-param param-namelogVerbosityLevel/param-name param-valueINFORMATION/param-value /init-param /servlet !-- The mapping for the JSP servlet -- servlet-mapping servlet-namejsp2/servlet-name url-pattern*.jsp/url-pattern /servlet-mapping /web-app This seems to work just great. The Manager sees my application (by name), and all of the context parameters appear in my JSP pages. As far as I can tell, there doesn't seem to be anything really bad about this solution. Except that I end up with a new instance of the JspServlet for each virtual host, which is probably a tolerable amount of overhead. My question is this: Is this the right way to accomplish this? __ James Bucanek mailto:[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Newbie problem with JSP contexts virtual hosts
While I didn't get any suggestions or feedback on my original question, I believe I've found a solution. Now I just need to run it by the group to see if it's Kosher. James Bucanek wrote on Sunday, April 11, 2004: !-- Virtual host: www.hotelmidnight.net -- !-- (jlb 11-April-2004) Added virtual host -- Host name=www.hotelmidnight.net debug=0 appBase=/Users/darkthirty/Sites unpackWARs=false autoDeploy=true !-- Context for the top-level web application -- Context path= docBase=. debug=99 reloadable=true/ /Host clip web-app display-namedarkthirty/display-name descriptiondarkthirty.net artwork application/description !-- Global parameters for this web application -- context-param param-nametest/param-name param-valueSome Value/param-value /context-param /web-app The basic problem with this arrangement is that my JSP pages ran in the context of the 'jsp' servlet that's defined in ${CATALINA_HOME}/conf/web.xml for the default Host, not the Context that I defined in my web-app that I want to run in my virtual Host. So, it occurred to me that I could create may own instance of the JSP engine as my Servlet. Now that I have a Servlet to reference, I can then map all of the *.jsp files in my virtual host to that: web-app display-namedarkthirty/display-name descriptiondarkthirty.net artwork application/description !-- Global parameters available to all web applications -- context-param param-nametest/param-name param-valueSome Value/param-value /context-param servlet servlet-namejsp2/servlet-name servlet-classorg.apache.jasper.servlet.JspServlet/servlet-class init-param param-namelogVerbosityLevel/param-name param-valueINFORMATION/param-value /init-param /servlet !-- The mapping for the JSP servlet -- servlet-mapping servlet-namejsp2/servlet-name url-pattern*.jsp/url-pattern /servlet-mapping /web-app This seems to work just great. The Manager sees my application (by name), and all of the context parameters appear in my JSP pages. As far as I can tell, there doesn't seem to be anything really bad about this solution. Except that I end up with a new instance of the JspServlet for each virtual host, which is probably a tolerable amount of overhead. My question is this: Is this the right way to accomplish this? __ James Bucanek mailto:[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Newbie problem with JSP contexts virtual hosts
Greetings all, I'm sure this is a newbie problem, but a search of the archives didn't reveal what I was looking for. It's probably easiest if I first describe what I want to accomplish: Mac OS X Server 10.3.3 Apache 1.3.29 Tomcat 4.1.24 (a) Deploy a webapp directory (or .war) that contains Java classes, some JSP pages, and a web.xml file. (b) Have the JSP pages execute in the Context of the above web app. Specifically, access the Java beans contained in the WEB-INF/classes directory and read configuration parameters defined in the WEB-INF/web.xml file. I'm having problems with (b). I've created, what I think is, a valid webapps directory complete with WEB-INF/web.xml file and Java classes. I believe my problem stems from two confounding issues: (1) I'm trying to do this in a virtual host alongside Apache and (2) I'm a little fuzzy on the relationship between JSP pages, the JSP servlet, and web app Contexts. [ Note: I've made a lot of progress since I picked up Tomcat: The Definitive Guide, by Jason Brittain Ian F. Darwin. I was completely lost before I read their book. Now, I'm merely bewildered. ;) ] In my server.xml file, I've defined a virtual host (beyond the default one for 'localhost'): !-- Virtual host: www.hotelmidnight.net -- !-- (jlb 11-April-2004) Added virtual host -- Host name=www.hotelmidnight.net debug=0 appBase=/Users/darkthirty/Sites unpackWARs=false autoDeploy=true !-- this site doesn't use any user authentication -- Logger className=org.apache.catalina.logger.FileLogger directory=logs prefix=darkthirty_log. suffix=.txt timestamp=true/ !-- Context for the top-level web application -- Context path= docBase=. debug=99 reloadable=true/ !-- Let's find out if I can use the manager from a virtual host... -- Context path=/manager docBase=/Library/Tomcat/server/webapps/manager debug=5 privileged=true ResourceLink name=users global=UserDatabase type=org.apache.catalina.UserDatabase/ /Context /Host Also note that I'm using the default mapping of *.jsp to Tomcat (mod_jk) in Apache, and *.jsp is mapped to the 'jsp' servlet in ${catalina_home}/config/web.xml. The web application I want to deploy for this site is in /Users/darkthirty/Sites. I've created a TestBean class in ./WEB-INF/classes. The ./WEB-INF/web.xml file contains the following: web-app display-namedarkthirty/display-name descriptiondarkthirty.net artwork application/description !-- Global parameters for this web application -- context-param param-nametest/param-name param-valueSome Value/param-value /context-param /web-app I then wrote a short test.jsp page to check the installation: %@ page language=java import=java.util.*,net.darkthirty.web.art.jsp.*%html jsp:useBean id=testBean class=net.darkthirty.web.art.jsp.TestBean scope=application/ head titleJSP TEST PAGE/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body pTestBean.getProperty(): %= testBean.getProperty() %/p pnew Date(): %= (new Date()).toString() %/p papplication.getServletContextName(): %= application.getServletContextName() %/p papplication.getInitParameterNames(): % Enumeration e = application.getInitParameterNames(); while (e.hasMoreElements()) { %%= e.nextElement() %, % } %/p papplication.getAttributeNames(): % e = application.getAttributeNames(); while (e.hasMoreElements()) { %%= e.nextElement() %, % } %/p pconfig.getInitParameterNames(): % e = config.getInitParameterNames(); while (e.hasMoreElements()) { %%= e.nextElement() %, % } %/p pcontext-param test: %= application.getInitParameter(test) %/p /body /html The parts that works are thus: - If I load the URL http://www.hotelmidnight.net/test.jsp, the file test.jsp at /Users/darkthirty/Sites/test.jsp gets compiled and executed by the JSP servlet. Here's the output: TestBean.getProperty(): Hello! new Date(): Sun Apr 11 21:23:46 MST 2004 application.getServletContextName(): null application.getInitParameterNames(): application.getAttributeNames(): org.apache.catalina.jsp_classpath, javax.servlet.context.tempdir, org.apache.catalina.resources, testBean, org.apache.catalina.WELCOME_FILES, config.getInitParameterNames(): fork, logVerbosityLevel, context-param test: null - test.jsp successfully references and instantiates the TestBean object from the class contained in ./WEB-INF/classes. So it seems that the class loader for this web app is working. - If I load http://www.hotelmidnight.net:9006/manager/html/ it shows that I'm running two web applications, / and /manager. Loading the test.jsp page causes the number of sessions in the / application to change. But here's the part that doesn't work: - The call to application.getInitParameter(test) doesn't return the value
Same data source config on two contexts, different result
Hi! I'm having difficulties setting up datasources! At the moment I have two contexts that I'm testing this on. The first is this one. It works fine. Context docBase=/home/stig/public_jsp path=/stig Resource name=nutshellTestSource type=javax.sql.DataSource/ ResourceParams name=nutshellTestSource parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value4/value /parameter parameter namepassword/name valuea/value /parameter parameter nameurl/name valuejdbc:mysql://localhost:3306/dev/value /parameter parameter namedriverClassName/name valuecom.mysql.jdbc.Driver/value /parameter parameter namemaxIdle/name value2/value /parameter parameter nameusername/name valuestig/value /parameter /ResourceParams /Context The other one is on another v-host on the same server. However this one doesen't work at all. In the admin-webapp I get an exception when I try to view the datasource saying: javax.servlet.ServletException: Exception retrieving attribute 'driverClassName' Context docBase=ROOT path=/ reloadable=true Resource name=nutshellTestSource type=javax.sql.DataSource/ ResourceParams name=nutshellTestSource parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value4/value /parameter parameter namepassword/name valuehest/value /parameter parameter nameurl/name valuejdbc:mysql://nutshell.vestkant.no:3306/dev/value /parameter parameter namedriverClassName/name valuecom.mysql.jdbc.Driver/value /parameter parameter namemaxIdle/name value2/value /parameter parameter nameusername/name valueflux/value /parameter /ResourceParams /Context This has really been bugging me over the past weeks! -- StSt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Same data source config on two contexts, different result
The differences I can see are in the Context element and the url param value. The question is what difference is significant. I would try making the second config more similar to the first, and see when it starts working. Eg. Is it because the url lookup is failing? Is it because it is no allowed to load the class from that url. Assuming the error message is misleading. Do you have a security policy file? Just a thought Martin -Original Message- From: Stig Stavik [mailto:[EMAIL PROTECTED] Sent: 27 March 2004 09:55 To: [EMAIL PROTECTED] Subject: Same data source config on two contexts, different result Hi! I'm having difficulties setting up datasources! At the moment I have two contexts that I'm testing this on. The first is this one. It works fine. Context docBase=/home/stig/public_jsp path=/stig Resource name=nutshellTestSource type=javax.sql.DataSource/ ResourceParams name=nutshellTestSource parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value4/value /parameter parameter namepassword/name valuea/value /parameter parameter nameurl/name valuejdbc:mysql://localhost:3306/dev/value /parameter parameter namedriverClassName/name valuecom.mysql.jdbc.Driver/value /parameter parameter namemaxIdle/name value2/value /parameter parameter nameusername/name valuestig/value /parameter /ResourceParams /Context The other one is on another v-host on the same server. However this one doesen't work at all. In the admin-webapp I get an exception when I try to view the datasource saying: javax.servlet.ServletException: Exception retrieving attribute 'driverClassName' Context docBase=ROOT path=/ reloadable=true Resource name=nutshellTestSource type=javax.sql.DataSource/ ResourceParams name=nutshellTestSource parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value4/value /parameter parameter namepassword/name valuehest/value /parameter parameter nameurl/name valuejdbc:mysql://nutshell.vestkant.no:3306/dev/value /parameter parameter namedriverClassName/name valuecom.mysql.jdbc.Driver/value /parameter parameter namemaxIdle/name value2/value /parameter parameter nameusername/name valueflux/value /parameter /ResourceParams /Context This has really been bugging me over the past weeks! -- StSt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Same data source config on two contexts, different result
Martin Alley wrote: The differences I can see are in the Context element and the url param value. The question is what difference is significant. The URL have been switched back and forth, but with the same result. This goes for all the other parameters also - but in the end it's always the javax.servlet.ServletException: Exception retrieving attribute 'driverClassName' which is thrown in the admin-webapp. Do you have a security policy file? Nope. -- StSt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Same data source config on two contexts, different result
So you can change any parameter and it still fails? Have you tried playing with the attributes in the context element? -Original Message- From: Stig Stavik [mailto:[EMAIL PROTECTED] Sent: 27 March 2004 10:15 To: Tomcat Users List Subject: Re: Same data source config on two contexts, different result Martin Alley wrote: The differences I can see are in the Context element and the url param value. The question is what difference is significant. The URL have been switched back and forth, but with the same result. This goes for all the other parameters also - but in the end it's always the javax.servlet.ServletException: Exception retrieving attribute 'driverClassName' which is thrown in the admin-webapp. Do you have a security policy file? Nope. -- StSt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Same data source config on two contexts, different result
Martin Alley wrote: So you can change any parameter and it still fails? Have you tried playing with the attributes in the context element? No, I haven't. What sort of playful attributes do you recomend? :) -- StSt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Same data source config on two contexts, different result
Reloadable Docbase Path In that order. Martin -Original Message- From: Stig Stavik [mailto:[EMAIL PROTECTED] Sent: 27 March 2004 10:32 To: Tomcat Users List Subject: Re: Same data source config on two contexts, different result Martin Alley wrote: So you can change any parameter and it still fails? Have you tried playing with the attributes in the context element? No, I haven't. What sort of playful attributes do you recomend? :) -- StSt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Same data source config on two contexts, different result
Furthermore, I'm thinking about the semantics of the driver class and doc base. Do you have the driver class in the right place so it can be found when docroot is ROOT? -Original Message- From: Martin Alley [mailto:[EMAIL PROTECTED] Sent: 27 March 2004 10:37 To: 'Tomcat Users List' Subject: RE: Same data source config on two contexts, different result Reloadable Docbase Path In that order. Martin -Original Message- From: Stig Stavik [mailto:[EMAIL PROTECTED] Sent: 27 March 2004 10:32 To: Tomcat Users List Subject: Re: Same data source config on two contexts, different result Martin Alley wrote: So you can change any parameter and it still fails? Have you tried playing with the attributes in the context element? No, I haven't. What sort of playful attributes do you recomend? :) -- StSt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Same data source config on two contexts, different result
Martin Alley wrote: Do you have the driver class in the right place so it can be found when docroot is ROOT? As long as the connector is to be found in tomcats classpath, it should be ok, shouldn't it? Ok. New approach - total chaos. I removed the v-host and created a new one using the admin-tool. No datasource added this time. When I now press the datasource, I get the same error regarding the driverClassName. However, the logging for the new host works, and here the following is stated: java.lang.IllegalStateException: Context path / is already in use 2004-03-27 11:50:19 StandardHost[www.mydomain.com]: Error deploying application at context path null java.lang.IllegalStateException: Context path / is already in use at org.apache.commons.digester.Digester.createSAXException(Digester.java:2540) . . . In spite of this, the v-host is working, and so does the other default-/ on the server. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Same data source config on two contexts, different result
What version of tomcat are you using? -Original Message- From: Stig Stavik [mailto:[EMAIL PROTECTED] Sent: 27 March 2004 11:23 To: Tomcat Users List Subject: Re: Same data source config on two contexts, different result Martin Alley wrote: Do you have the driver class in the right place so it can be found when docroot is ROOT? As long as the connector is to be found in tomcats classpath, it should be ok, shouldn't it? Ok. New approach - total chaos. I removed the v-host and created a new one using the admin-tool. No datasource added this time. When I now press the datasource, I get the same error regarding the driverClassName. However, the logging for the new host works, and here the following is stated: java.lang.IllegalStateException: Context path / is already in use 2004-03-27 11:50:19 StandardHost[www.mydomain.com]: Error deploying application at context path null java.lang.IllegalStateException: Context path / is already in use at org.apache.commons.digester.Digester.createSAXException(Digester.java:25 40) . . . In spite of this, the v-host is working, and so does the other default-/ on the server. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Same data source config on two contexts, different result
Martin Alley wrote: What version of tomcat are you using? 5.0.16 -- StSt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Same data source config on two contexts, different result
Stig Stavik wrote: Context docBase=ROOT path=/ reloadable=true The path should be an empty String. That's the likely cause of the problems. -- x Rémy Maucherat Developer Consultant JBoss Group (Europe) SàRL x - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Same data source config on two contexts, different result
I believe the driver either needs to be in WEB-INF/lib or $CATALINA_HOME/common/lib Martin -Original Message- From: Stig Stavik [mailto:[EMAIL PROTECTED] Sent: 27 March 2004 11:23 To: Tomcat Users List Subject: Re: Same data source config on two contexts, different result Martin Alley wrote: Do you have the driver class in the right place so it can be found when docroot is ROOT? As long as the connector is to be found in tomcats classpath, it should be ok, shouldn't it? Ok. New approach - total chaos. I removed the v-host and created a new one using the admin-tool. No datasource added this time. When I now press the datasource, I get the same error regarding the driverClassName. However, the logging for the new host works, and here the following is stated: java.lang.IllegalStateException: Context path / is already in use 2004-03-27 11:50:19 StandardHost[www.mydomain.com]: Error deploying application at context path null java.lang.IllegalStateException: Context path / is already in use at org.apache.commons.digester.Digester.createSAXException(Digester.java:25 40) . . . In spite of this, the v-host is working, and so does the other default-/ on the server. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Same data source config on two contexts, different result
Remy Maucherat wrote: Context docBase=ROOT path=/ reloadable=true The path should be an empty String. That's the likely cause of the problems. Thanks. That cleaned up the errorlog, though it made no other difference ... -- StSt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Same data source config on two contexts, different result
Martin Alley wrote: I believe the driver either needs to be in WEB-INF/lib or $CATALINA_HOME/common/lib The driver is in $CATALINA_HOME/common/lib -- StSt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Same data source config on two contexts, different result
Is that where your other context is finding it also? Where else is the driver? If you remove it from $CATALINA_HOME/common/lib does the other context fail in the same way as the /stig context? -Original Message- From: Stig Stavik [mailto:[EMAIL PROTECTED] Sent: 27 March 2004 11:45 To: Tomcat Users List Subject: Re: Same data source config on two contexts, different result Martin Alley wrote: I believe the driver either needs to be in WEB-INF/lib or $CATALINA_HOME/common/lib The driver is in $CATALINA_HOME/common/lib -- StSt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]