Re: Read and write inside WEB-INF
Confirmed. A real pain in the bum... I do not let my folks use unpacked WARs. There were once a bunch of guys that put custom log files in the unpacked WAR directory... shame shame. David Smith wrote: Only works for unpacked web applications. If you attempt getRealPath from inside a packed war file it will return null. --David hanasaki wrote: Hmmm does this work for packed WAR's or only Unpacked... ? Jacob Rhoden wrote: Much Appreciated! Thanks. Edoardo Panfili wrote: Jacob Rhoden ha scritto: what is the correct way to find the location of your WEB-INF directory (or your apps directory for that matter). try with String x = this.getServletContext().getRealPath(WEB-INF); - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat Application Read/Write properties (mk2)
- Original Message - From: Jacob Rhoden [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Sunday, July 15, 2007 7:38 AM Subject: Tomcat Application Read/Write properties (mk2) I am going to re-word the question from the last thread to ask not how to do what I think I should do, but what I should do (: Where I work, ease of configuration and management is an important part of the software selection process. I have seen many tomcat applications provide an install.jsp or setup.jsp that allows you to configure various information including the name of the database. So here is my question. What is the correct/standard/java way of doing this? The database username/password are usually stored in web.xml, should the configuration page write the the web.xml file? I know what technically can be done, but what should be done? Jacob... Changing passwords, and choosing the dB, and thus in effect setting up the dB pool, will never be an easy thing, if possible at all, to do from a JNDI resource, thru a JSP page. Fortunately Tomcat is a lite weight container and thus easy to understand and it lends itself readily to POJO (plain old java object) solutions. I'm going to try explain one way of doing it. There are other very popular db Pools... the one that I use is called DbConnectionBroker (google for it). Of course if you like, you could use DBCP... which is the same one TC uses in JNDI. What I think these guys are doing is setting up the dB pool themselves in the INIT section of the servlet. This is called once at server start up, so it allows one to setup global initialized classes, like db Pools. Now say you wanted to provide the facility to use a different dB from a JSP page the form will submit to the servlet, the servlet will then make a new dB pool, and thereafter new requests will use that one. Conceptually you start to see the problems, because the old connection pool has to be allowed to finish up any work it is doing, before it can be killed. Naturally one doenst have to use a dB pool, and could just use a single connection for a single session, if thats what the program required but if its an admin facility, and you setting up for all future requests it will be something like the above. A side issue is that for something like this to work, they using the MVC model, ie the requests are all coming in thru the servlet and being dispatched to JSP pages, thus the correct dB pool can be passed across in a session object. If you new to tomcat, all this will sound frightening, but its actaully very easy once you get the concept. If you only want to work with JSP pages, then you cant channel through a servlet, and cant pick up the required dB pool, ie you pretty much have to use JNDI, and because that is setup when your webapp starts, you cant really change it. If it doesnt have to be thru a JSP page, and TC can be stopped, and you really just looking for a convenient admin facility, then have a look at JMX in TC. Answering questions like this is always difficult, because there are dozens of frameworks that work on TC, so someone else may say, hey use Spring I like Tomcat because it lends itself to POJO development I'm a POJO junky ;) So if you want to know how to do it in POJO, thats me for example I take the above concept and add persistence to it as well, if you a POJO man then have a look at this http://coolese.100free.com (Pojo Persist)... it does all of the above, and easy persistence, if only to get a feel for using your own dB pool. Maybe a framework person can tell us both whether there is a framework that lets you change the dB pool at runtime I cant think of one. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DataSources and Tomcat (continue thread: Re: How to use connectionpool with tomcat 1.2.9)
Hi How confused do you want to be I started looking at the 4.1 docs as well ... it'll never work I do object to having to download taglibs just to get a simple example working so you can keep all the code from the 4.1 example including the web.xml entry All you really need to change is the server.xml configuration as described in http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html, at least this is what I did and the example seems to work OK. One thing that constantly frustrates me is the apparent ambiguities in the documentation (it's not a criticism before anyone gets upset) the docs state 'Add this in between the /Context tag of the examples context and the /Host tag closing the localhost definition' Well there isn't a Context tag in my distro so I just invented one and it works, of course we are always being advised to put our Context thing in our web apps these days so that's what I'm going to try next. Good Luck Chers Duncan On 7/15/07, Caldarale, Charles R [EMAIL PROTECTED] wrote: From: Ken Bowen [mailto:[EMAIL PROTECTED] Subject: DataSources and Tomcat (continue thread: Re: How to use connectionpool with tomcat 1.2.9) I also want to get the Tomcat DataSource machinery working. I'm using Tomcat 5.5.9. I've slavishly followed the mySQL example in http://tomcat.apache.org/tomcat-4.1-doc/jndi-datasource-examples-howto.h tml If you're using 5.5, why are you spending any time looking at the 4.1 documentation? Try using the correct doc for the level you have: http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.h tml - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
change in local directory deployment behavior between 5.5 and 6
Hi, I have been searching for a solution to this problem for a while, but it's difficult to search on when the keywords match so many general topics. In tomcat 5.5, I was able to use manager to deploy from a directory on the filesystem, and tomcat would use that directory for the source. It would not copy the contents of the directory to its webapps directory. I could stop tomcat, start it again and pick up changes in the class files of the app. This was very quick because no file copying was going on. In tomcat 6, it now copies all of the files to the webapps directory. I can no longer just stop and restart tomcat to pick up the changes in the class files because tomcat has its own copy. I have to undeploy and redeploy at minimum, and it takes quite some time and extra work on my part. Is there a way to configure tomcat 6 get the old tomcat 5.5 behavior back? Thanks for any help. Alice - Moody friends. Drama queens. Your life? Nope! - their life, your story. Play Sims Stories at Yahoo! Games.
Re: DataSources and Tomcat (continue thread: Re: How to use connectionpool with tomcat 1.2.9)
Indeed. Simply swapping the Context given in http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html, in for the Context given in http://tomcat.apache.org/tomcat-4.1-doc/jndi-datasource-examples-howto.html makes the 4.1 example work. This way makes it clear what has changed. Thanks very much. Ken Lyallex wrote: Hi How confused do you want to be I started looking at the 4.1 docs as well ... it'll never work I do object to having to download taglibs just to get a simple example working so you can keep all the code from the 4.1 example including the web.xml entry All you really need to change is the server.xml configuration as described in http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html, at least this is what I did and the example seems to work OK. One thing that constantly frustrates me is the apparent ambiguities in the documentation (it's not a criticism before anyone gets upset) the docs state 'Add this in between the /Context tag of the examples context and the /Host tag closing the localhost definition' Well there isn't a Context tag in my distro so I just invented one and it works, of course we are always being advised to put our Context thing in our web apps these days so that's what I'm going to try next. Good Luck Chers Duncan On 7/15/07, Caldarale, Charles R [EMAIL PROTECTED] wrote: From: Ken Bowen [mailto:[EMAIL PROTECTED] Subject: DataSources and Tomcat (continue thread: Re: How to use connectionpool with tomcat 1.2.9) I also want to get the Tomcat DataSource machinery working. I'm using Tomcat 5.5.9. I've slavishly followed the mySQL example in http://tomcat.apache.org/tomcat-4.1-doc/jndi-datasource-examples-howto.h tml If you're using 5.5, why are you spending any time looking at the 4.1 documentation? Try using the correct doc for the level you have: http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.h tml - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DataSources and Tomcat (continue thread: Re: How to use connectionpool with tomcat 1.2.9)
Lyallex wrote: One thing that constantly frustrates me is the apparent ambiguities in the documentation Then do something constructive about it. You are part of the Tomcat community and the documentation is as much your responsibility as anyone else here. If you find a problem, report it. Better yet, suggest an alternative wording that improves the documentation or ideally, provide a patch. 'Add this in between the /Context tag of the examples context and the /Host tag closing the localhost definition' Well there isn't a Context tag in my distro so I just invented one and it works, of course we are always being advised to put our Context thing in our web apps these days so that's what I'm going to try next. This has been now fixed in the docs 5.5.x and 6.0.x and will be in the next release of each. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Axis 2, POJO, Exceptions and Faults
albert quinn wrote: I've been trying to do something like that but i couldn't make it work . My test Web Service returns a String and the client receives the AxisFault/RemoteException message throwed from the Web Service as it was the returned value from the Web Service !!, so I'd been able to know in the client side if an error happened in the server side. POJO is a plain Java objects that you cannot throw things! I tend to return results wrapped in XML strings containing types (=ok, error, ...) and contents. For clients, any exceptions happened in transport will be captured by try {} catch blocks. Errors occured in POJO servers will be embedded in return strings as XML strings. Note that use of SOAP means that you should live with XML! regards. -- View this message in context: http://www.nabble.com/Axis-2%2C-POJO%2C-Exceptions-and-Faults-tf4080311.html#a11606621 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat6 Manager App HOW-TO
Caldarale, Charles R wrote: From: John Moore [mailto:[EMAIL PROTECTED] Subject: Tomcat6 Manager App HOW-TO It appears that the instruction to add (paths corrected) Context path=/manager privileged=true docBase=/usr/local/tomcat/webapps/manager /Context is wrong (based on message from Charles Caldarale on 5/16/2007) The path attribute is only valid when the Context element is in server.xml, which is strongly discouraged. For other Context uses, the path is derived from the name of war file (or directory) or the name of the .xml file in conf/Catalina/[host]. i.e. Don't follow the directions..G So.. in reading the rest of the instructions I'm finding things are not quite working as documented. Please point out where in the Tomcat 6 doc you're finding discrepancies. Everything I'm asking here comes from the Tomcat6 Manager HOW-TO.. (newly printed from the site) You are basically saying, as I understand it, that it is either wrong or incomplete. (It may, of course, just be that my ignorance is so bad that I can make sense of it all..G) 1) Is the instruction that you add a manager.xml to each $CATALINA_HOME/conf/[enginename]/[hostname] ..folder required? Not for Tomcat 6, since the directory structure has changed. In TC 5.5 and older, the various management applications were located outside of the normal Host appBase (in server/webapps), and therefore required [appname].xml files in conf/Catalina/[host]. For TC 6, the management applications are located under the configured appBase directory, so their Context elements can be found in their respective META-INF directories. If you configure multiple Host elements with differing appBase attributes, you have two choices. Either copy the management applications to each appBase, or keep them in one spot and create [appname].xml files with appropriate docBase attributes in each conf/[engine]/[host], similar to TC 5.5. Great thanks.. That is the missing piece(s) in the docs... Ditto for your following advice.. but can not access the host-manager at: http://localhost:8080/host-manager/html ..I get a 403 (I did try adding a host-manager role to the tomcat-user.xml , but no joy) Look in the WEB-INF/web.xml file for host-manager; you'll see that the required role name is admin, not manager or host-manager. 3) I can not access a virtual host Manager at http://www.domainhere.com:8080/manager/html What appBase did you configure for the www.domainhere.com Host? If you don't have a manager webapp deployed there, you'll need to create a conf/Catalina/www.domainhere.com/manager.xml file that contains a Context element with a docBase attribute that points to the location of the manager webapp.
RE: Tomcat6 Manager App HOW-TO
From: John Moore [mailto:[EMAIL PROTECTED] Subject: Re: Tomcat6 Manager App HOW-TO Everything I'm asking here comes from the Tomcat6 Manager HOW-TO.. (newly printed from the site) You are basically saying, as I understand it, that it is either wrong or incomplete. The only part that I find somewhat misleading is the following: There are two ways to configure the Manager web application Context: * Install the manager.xml context configuration file in the $CATALINA_HOME/conf/[enginename]/[hostname] folder. * Configure the Manager Context within the Host configuration in your Tomcat server.xml configuration. Here is an example: Context path=/manager privileged=true docBase=/usr/local/kinetic/tomcat6/server/webapps/manager /Context The first bullet is really only needed when additional Host elements have been configured, and you want a manager webapp for each. It fails to mention that the manager webapp is automatically set up for the default Host in the standard Tomcat 6 download. The second bullet should probably be eliminated, since it's no longer in keeping with the philosophy of avoiding placing webapp configurations inside the server.xml file. It may be there simply for completeness, but ideally it should at least include a caveat. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
What are you using to monitor the performance of Tomcat?
Hi there. We're currently looking at a third-party product from Adventnet called Application Manager to monitor our Tomcat 5.x servers. Are there other third-party solutions out there that can provide performance and usage statistics? We would like to monitor the performance if the servlets at a url level. - Simon. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat6 Manager App HOW-TO
Caldarale, Charles R wrote: The only part that I find somewhat misleading is the following: There are two ways to configure the Manager web application Context: * Install the manager.xml context configuration file in the $CATALINA_HOME/conf/[enginename]/[hostname] folder. * Configure the Manager Context within the Host configuration in your Tomcat server.xml configuration. Here is an example: Context path=/manager privileged=true docBase=/usr/local/kinetic/tomcat6/server/webapps/manager /Context The first bullet is really only needed when additional Host elements have been configured, and you want a manager webapp for each. It fails to mention that the manager webapp is automatically set up for the default Host in the standard Tomcat 6 download. The second bullet should probably be eliminated, since it's no longer in keeping with the philosophy of avoiding placing webapp configurations inside the server.xml file. It may be there simply for completeness, but ideally it should at least include a caveat. I guess I understood from an earlier post from you that it was a rather strong no-no.. Which made it's presence in the HOW-TO rather odd.. I also gather that you should copy the manager directory into each webapp..??? Thank you for clarifying these issues.. John.. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]