Re: embedded Tomcat (5.5.23) application logging (java.util.logging)
--- HARBOR: http://coolharbor.100free.com/index.htm Now Tomcat is also a cool application server --- - Original Message - From: Johnny Kewl [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Saturday, October 13, 2007 7:05 AM Subject: Re: embedded Tomcat (5.5.23) application logging (java.util.logging) - Original Message - From: Filip Hanik - Dev Lists [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Friday, October 12, 2007 9:44 PM Subject: Re: embedded Tomcat (5.5.23) application logging (java.util.logging) this is an example private static org.apache.juli.logging.Log log= org.apache.juli.logging.LogFactory.getLog( IntrospectionUtils.class ); as soon as that statement is executed, the logging gets initialized. as you can see, it is a static field, so when you run Tomcat embedded, before any classes are loaded (that would lead to initialization), you must set those properties. as you can see, the Embedded class also does this public class Embedded extends StandardService implements Lifecycle { private static Log log = LogFactory.getLog(Embedded.class); meaning, if you have references to embedded in your public static void main(String[] args) class, then it's too late to set the system properties at that time Filip Hi Filip... maybe you can help me here... Its actually not that I'm starting TC then doing the System.setProperty I do props first. I'm using the 6.0.13 code and when I search it for java.util.logging.manager ... ie to see where it actualy reads this property, I can find it anywhere. For example in ClassLoaderLogManager... there is the this line for getting the prop to the config file... String configFileStr = System.getProperty(java.util.logging.config.file); BUT there seems to be no similar line to read this property... System.setProperty(java.util.logging.manager, org.apache.juli.ClassLoaderLogManager); So the problem seems to be that nowhere does the TC code read this property?? Its like I got a missing class... or theres a precompiled class that must be included I dont understand this??? I think this is the problem... guessing here This java.util.logging.manager is part of Java, not Tomcat... So on the command line as Java starts it inits this... So I think even if this property is set as the 1st line in your code, its too late. The app has started and so Command line options are missed. TC then calls this Logger.getLogger... and finds no ClassLoaderLogManager set. The console must be set in TC somewhere because that still works... it seems that when ClassLoaderLogManager is not set, no log files will be recorded... I think one has to tell java.util.logging.Logger to use ClassLoaderLogManager directly in the embedded program... Hopefully a Guru helps the original user here... ... and as I said before, all I did in the end was trap the console output, display it in the app and if I want a LOG file, I'll just write it out to one... it just gets too complicated, trying to figure out how TC redirects streams, and manages log options in an embedded app... If it does work then it also redirects standard output, so if you get the logs going then I think you can kiss displaying messages directly to the user, through the app goodbye... I dont know... I just avoid TC's logging. Good Luck Thats my best shot... I officially give up ;) - 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: embedded Tomcat (5.5.23) application logging (java.util.logging)
--- HARBOR: http://coolharbor.100free.com/index.htm Now Tomcat is also a cool application server --- - Original Message - From: Johnny Kewl [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Saturday, October 13, 2007 7:05 AM Subject: Re: embedded Tomcat (5.5.23) application logging (java.util.logging) - Original Message - From: Filip Hanik - Dev Lists [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Friday, October 12, 2007 9:44 PM Subject: Re: embedded Tomcat (5.5.23) application logging (java.util.logging) this is an example private static org.apache.juli.logging.Log log= org.apache.juli.logging.LogFactory.getLog( IntrospectionUtils.class ); as soon as that statement is executed, the logging gets initialized. as you can see, it is a static field, so when you run Tomcat embedded, before any classes are loaded (that would lead to initialization), you must set those properties. as you can see, the Embedded class also does this public class Embedded extends StandardService implements Lifecycle { private static Log log = LogFactory.getLog(Embedded.class); meaning, if you have references to embedded in your public static void main(String[] args) class, then it's too late to set the system properties at that time Filip Hi Filip... maybe you can help me here... Its actually not that I'm starting TC then doing the System.setProperty I do props first. I'm using the 6.0.13 code and when I search it for java.util.logging.manager ... ie to see where it actualy reads this property, I can find it anywhere. For example in ClassLoaderLogManager... there is the this line for getting the prop to the config file... String configFileStr = System.getProperty(java.util.logging.config.file); BUT there seems to be no similar line to read this property... System.setProperty(java.util.logging.manager, org.apache.juli.ClassLoaderLogManager); So the problem seems to be that nowhere does the TC code read this property?? Its like I got a missing class... or theres a precompiled class that must be included I dont understand this??? I think this is the problem... guessing here This java.util.logging.manager is part of Java, not Tomcat... So on the command line as Java starts it inits this... So I think even if this property is set as the 1st line in your code, its too late. The app has started and so Command line options are missed. TC then calls this Logger.getLogger... and finds no ClassLoaderLogManager set. The console must be set in TC somewhere because that still works... it seems that when ClassLoaderLogManager is not set, no log files will be recorded... I think one has to tell java.util.logging.Logger to use ClassLoaderLogManager directly in the embedded program... Hopefully a Guru helps the original user here... ... and as I said before, all I did in the end was trap the console output, display it in the app and if I want a LOG file, I'll just write it out to one... it just gets too complicated, trying to figure out how TC redirects streams, and manages log options in an embedded app... If it does work then it also redirects standard output, so if you get the logs going then I think you can kiss displaying messages directly to the user, through the app goodbye... I dont know... I just avoid TC's logging. Good Luck Thats my best shot... I officially give up ;) Ah... I think I'm onto it... Have a look at this link... http://www.vsj.co.uk/java/display.asp?id=319 Have a look at this section // set default logger and realm FileLogger fileLog = new FileLogger(); fileLog.setDirectory(.); fileLog.setPrefix(vsjMbedTC5); fileLog.setSuffix(.log); fileLog.setTimestamp(true); mbedTC5.setLogger(fileLog); See the guy is setting up a simple logger... which I think does mean the System.setProperty(java.util.logging.manager, org.apache.juli.ClassLoaderLogManager); property is in fact useless in an embedded app Ok now I officially give up ;) - 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: Copying large files around
--- HARBOR: http://coolharbor.100free.com/index.htm Now Tomcat is also a cool application server --- - Original Message - From: David Kerber [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Saturday, October 13, 2007 4:56 AM Subject: Copying large files around What is the most efficient (=fastest) way of copying large ( 1GB [yes, that's a Giga]) files around the network in java when running under tomcat 5.5.x? Do I use a FileInputStream and FileOutputStream with a large byte[] array? Or what? What a cool question I've never had the need to move such big files but this is what I would do... First look at this link http://forum.java.sun.com/thread.jspa?threadID=226413messageID=818728 It will give you the basic streaming model ie a POST on the browser side starts sucking down the file from the servlet... So in effect you do not have to worry about the whole file been buffered... it will move across the wire in say 4k blocks. OK... now if you on a LAN... thats cool, but for the internet this is not good enough... If you have a look at something like the Opera browser's file transfer it does some cool things, like if you shut down the machine, next time you start up again, it will pick up where you stopped it, it doesnt start with the whole 1 gb file again In fact if I built a servlet to do this... I would run the Opera browser download against it and stop and start and see it my servlet is to spec... I think the way to do it is to to modify the code in that link for RANDOM file access... ie the client knows its got 800 MB already and only asks for 800MB onwards so how do they do that. Look at this link. http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html and look at the byte range header spec. I would build the servlet to that. With such large files I think the biggest problem to solve is interruptions ie give the user the ability to close the client and go home... tomorrow it starts where it left off. I think file change headers (almost RSS) type stuff comes into this as well, in case the file is modified before it all downloaded, in which case it MUST start again Nice question I'm surprized I cant find code like this on the web already have a good look around it must be there. You could also add compression to it... and I think GZIP is an option in TC already, or you can just compress the blocks as they go... If its a JPG or GIF dont bother with compression it already is nice little project Good Luck - 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: Copying large files around
--- HARBOR: http://coolharbor.100free.com/index.htm Now Tomcat is also a cool application server --- - Original Message - From: Johnny Kewl [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org; [EMAIL PROTECTED] Sent: Saturday, October 13, 2007 12:41 PM Subject: Re: Copying large files around --- HARBOR: http://coolharbor.100free.com/index.htm Now Tomcat is also a cool application server --- - Original Message - From: David Kerber [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Saturday, October 13, 2007 4:56 AM Subject: Copying large files around What is the most efficient (=fastest) way of copying large ( 1GB [yes, that's a Giga]) files around the network in java when running under tomcat 5.5.x? Do I use a FileInputStream and FileOutputStream with a large byte[] array? Or what? What a cool question I've never had the need to move such big files but this is what I would do... First look at this link http://forum.java.sun.com/thread.jspa?threadID=226413messageID=818728 It will give you the basic streaming model ie a POST on the browser side starts sucking down the file from the servlet... So in effect you do not have to worry about the whole file been buffered... it will move across the wire in say 4k blocks. OK... now if you on a LAN... thats cool, but for the internet this is not good enough... If you have a look at something like the Opera browser's file transfer it does some cool things, like if you shut down the machine, next time you start up again, it will pick up where you stopped it, it doesnt start with the whole 1 gb file again In fact if I built a servlet to do this... I would run the Opera browser download against it and stop and start and see it my servlet is to spec... I think the way to do it is to to modify the code in that link for RANDOM file access... ie the client knows its got 800 MB already and only asks for 800MB onwards so how do they do that. Look at this link. http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html and look at the byte range header spec. I would build the servlet to that. With such large files I think the biggest problem to solve is interruptions ie give the user the ability to close the client and go home... tomorrow it starts where it left off. I think file change headers (almost RSS) type stuff comes into this as well, in case the file is modified before it all downloaded, in which case it MUST start again Nice question I'm surprized I cant find code like this on the web already have a good look around it must be there. You could also add compression to it... and I think GZIP is an option in TC already, or you can just compress the blocks as they go... If its a JPG or GIF dont bother with compression it already is nice little project Good Luck AFTER-THOUGHT You know, these TC guys are frightening clever chaps ;) I would not be surprized at all if the DEFAULT servlet already does all this already. Never tried it but I would test Opera against the DEFAULT servlet (ie you do nothing but put the file in TC no code) If it works but you need to extend that to folders outside of Tomcat steal the DEAFULT servlet and just modify it ;) - 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: Copying large files around
--- HARBOR: http://coolharbor.100free.com/index.htm Now Tomcat is also a cool application server --- - Original Message - From: Johnny Kewl [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Saturday, October 13, 2007 1:11 PM Subject: Re: Copying large files around --- HARBOR: http://coolharbor.100free.com/index.htm Now Tomcat is also a cool application server --- - Original Message - From: Johnny Kewl [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org; [EMAIL PROTECTED] Sent: Saturday, October 13, 2007 12:41 PM Subject: Re: Copying large files around --- HARBOR: http://coolharbor.100free.com/index.htm Now Tomcat is also a cool application server --- - Original Message - From: David Kerber [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Saturday, October 13, 2007 4:56 AM Subject: Copying large files around What is the most efficient (=fastest) way of copying large ( 1GB [yes, that's a Giga]) files around the network in java when running under tomcat 5.5.x? Do I use a FileInputStream and FileOutputStream with a large byte[] array? Or what? What a cool question I've never had the need to move such big files but this is what I would do... First look at this link http://forum.java.sun.com/thread.jspa?threadID=226413messageID=818728 It will give you the basic streaming model ie a POST on the browser side starts sucking down the file from the servlet... So in effect you do not have to worry about the whole file been buffered... it will move across the wire in say 4k blocks. OK... now if you on a LAN... thats cool, but for the internet this is not good enough... If you have a look at something like the Opera browser's file transfer it does some cool things, like if you shut down the machine, next time you start up again, it will pick up where you stopped it, it doesnt start with the whole 1 gb file again In fact if I built a servlet to do this... I would run the Opera browser download against it and stop and start and see it my servlet is to spec... I think the way to do it is to to modify the code in that link for RANDOM file access... ie the client knows its got 800 MB already and only asks for 800MB onwards so how do they do that. Look at this link. http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html and look at the byte range header spec. I would build the servlet to that. With such large files I think the biggest problem to solve is interruptions ie give the user the ability to close the client and go home... tomorrow it starts where it left off. I think file change headers (almost RSS) type stuff comes into this as well, in case the file is modified before it all downloaded, in which case it MUST start again Nice question I'm surprized I cant find code like this on the web already have a good look around it must be there. You could also add compression to it... and I think GZIP is an option in TC already, or you can just compress the blocks as they go... If its a JPG or GIF dont bother with compression it already is nice little project Good Luck AFTER-THOUGHT You know, these TC guys are frightening clever chaps ;) I would not be surprized at all if the DEFAULT servlet already does all this already. Never tried it but I would test Opera against the DEFAULT servlet (ie you do nothing but put the file in TC no code) If it works but you need to extend that to folders outside of Tomcat steal the DEAFULT servlet and just modify it ;) Save you some trouble Yes the DEFAULT servlet already supports Etags and File Offsets... so there you go Thanks Tomcat! At most you need to make the client... or just use Opera ;) - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to get the context path during servlet load?
Hi, I want to make the application contextPath independent. Normally this is not a problem because I can use request.getContextPath() however I need to know the contextPath during startup: servlet servlet-namestartup/servlet-name servlet-class.../servlet-class load-on-startup1/load-on-startup /servlet /servlet How can I do that? Zsolt - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
2 Tomcat
Hi! I would like to put to run two tomcat at the same time ( tomcat 5.5 and tomcat 5.0 jwsdp), Is it possible? I try to change the port of one tomcat (8080 for 8009) but do not working the two tomcat at time. Could someone help me? Thanks very much. -- View this message in context: http://www.nabble.com/2-Tomcat-tf4618234.html#a13189449 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: 2 Tomcat
lissette wrote: I would like to put to run two tomcat at the same time ( tomcat 5.5 and tomcat 5.0 jwsdp), Is it possible? Yes. I try to change the port of one tomcat (8080 for 8009) but do not working the two tomcat at time. You have to make sure that *all* ports are different. Especially, don't forget the shutdown port (by default 8005). Regards mks - 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: How to get the context path during servlet load?
if you mean during the init() method: /* * (non-Javadoc) * @see javax.servlet.GenericServlet#init(javax.servlet.ServletConfig) */ @Override public void init(ServletConfig config) throws ServletException { // ServletContext context = config.getServletContext(); String path = context.getContextPath(); super.init(config); } Zsolt Koppany wrote: Hi, I want to make the application contextPath independent. Normally this is not a problem because I can use request.getContextPath() however I need to know the contextPath during startup: servlet servlet-namestartup/servlet-name servlet-class.../servlet-class load-on-startup1/load-on-startup /servlet /servlet How can I do that? Zsolt - 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: Copying large files around
David Kerber wrote: What is the most efficient (=fastest) way of copying large ( 1GB [yes, that's a Giga]) files around the network in java when running under tomcat 5.5.x? Do I use a FileInputStream and FileOutputStream with a large byte[] array? Or what? I think that the NIO apis were intended to handle speedier transfers of data across network connections. It depends how you wish to move the data. Google provided a wealth of results of mixed tutorials and API explanations for java nio. p D - 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: Second webapp lib folder
Russ, 1. I think that configuring /WEB-INF/lib2 is not possible. The spec has no provision for it. 2. You may place all these jars into shared jars folder in tomcat configuration, and exclude them from your war. In tomcat 5.5.x, the place is ${catalina.base}/shared/lib/ See http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html 3. If you really need it, the location of the /shared/lib folder can be configured. E.g. it can be split into several ones, like ${catalina.base}/common/ is split into several folders. You do this by modifying classloaders configuration in catalina.properties file. Best regards, Konstantin Kolinko - 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: Copying large files around
Pid wrote: David Kerber wrote: What is the most efficient (=fastest) way of copying large ( 1GB [yes, that's a Giga]) files around the network in java when running under tomcat 5.5.x? Do I use a FileInputStream and FileOutputStream with a large byte[] array? Or what? I think that the NIO apis were intended to handle speedier transfers of data across network connections. It depends how you wish to move the data. Google provided a wealth of results of mixed tutorials and API explanations for java nio. p Let me give a bit more detail: I am working on a utility function in my webapp that will periodically copy the database file from the db server to a backup server on the LAN. This particular function does not use the internet, it's strictly copying on the LAN. I don't care what method it uses as long as it's fairly simple to code, and moves fast. I've already got the creation of the backup file handled; that's a database function. It's just the copying to another machine that I'm working on now. D - 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: embedded Tomcat (5.5.23) application logging (java.util.logging)
From: Johnny Kewl [mailto:[EMAIL PROTECTED] Subject: Re: embedded Tomcat (5.5.23) application logging (java.util.logging) This java.util.logging.manager is part of Java, not Tomcat... So on the command line as Java starts it inits this... So I think even if this property is set as the 1st line in your code, its too late. All the above is correct. See the API doc for java.util.logging.LogManager. The static initializer for that class uses either an instanced of itself or an instance of the class named on the aforementioned system property. Thus, you need to set java.util.logging.manager prior to initializing the JVM. Possible solutions: 1) Make sure the system property is set on the command line for the launcher. 2) Write your own launcher that sets the property then initializes a JVM via JNI (thereby sacrificing platform independence). 3) Start the embedded Tomcat in a child JVM, so its system properties can be set beforehand. Use java.lang.ProcessBuilder or java.lang.Runtime#exec. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Copying large files around
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David, David Kerber wrote: Let me give a bit more detail: I am working on a utility function in my webapp that will periodically copy the database file from the db server to a backup server on the LAN. Uh cron and cp, anyone? You can even use cron to initiate the backup, too, instead of scripting it from your webapp. Why doesn't anyone use cron anymore? Sheesh... - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHENq59CaO5/Lv0PARAuicAJ4+JoPzVDN/RS9iAxTRqXYdw1LM0QCeNOf3 70G+J4HF0wYuPZAyJRvRrf0= =c706 -END PGP SIGNATURE- - 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: How to get the context path during servlet load?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Pid, Pid wrote: ServletContext context = config.getServletContext(); String path = context.getContextPath(); I can't remember if this is the same thread (the original message has fallen off my list queue), but I thought the OP was using Servlet API 2.4, which does not have this method. :( - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHENu/9CaO5/Lv0PARAsEOAJ4tqESIpIHpwJKZCj2hcp1ekmA8ygCguvbB twrBApqjtx55+x9G33xi+0M= =041X -END PGP SIGNATURE- - 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: Copying large files around
On 10/13/07, Christopher Schultz [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David, David Kerber wrote: Let me give a bit more detail: I am working on a utility function in my webapp that will periodically copy the database file from the db server to a backup server on the LAN. Uh cron and cp, anyone? You can even use cron to initiate the backup, too, instead of scripting it from your webapp. Or in this case scp (or rcp, or sftp, or ftp) ? - 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: Copying large files around
Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David, David Kerber wrote: Let me give a bit more detail: I am working on a utility function in my webapp that will periodically copy the database file from the db server to a backup server on the LAN. Uh cron and cp, anyone? You can even use cron to initiate the backup, too, instead of scripting it from your webapp. Why doesn't anyone use cron anymore? Sheesh... Does Windows 2003 server have a version of cron? I've never used it. And building it into my webapp lets all the configuration be done from the same interface.. D - 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: Copying large files around
Yes. It has AT (command line) and a scheduler (GUI). You can do a batch file and set it to run at a certain time, day and frequency. I had a client that I setup the dhcp service to stop, copy the database over to a backup directory and then restart the service in a batch file. Then I called it every night before the tape backup ran. AT is a lot lighter than Scheduler so using it is preferable. Doug - Original Message - From: David Kerber [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Saturday, October 13, 2007 11:29 AM Subject: Re: Copying large files around Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David, David Kerber wrote: Let me give a bit more detail: I am working on a utility function in my webapp that will periodically copy the database file from the db server to a backup server on the LAN. Uh cron and cp, anyone? You can even use cron to initiate the backup, too, instead of scripting it from your webapp. Why doesn't anyone use cron anymore? Sheesh... Does Windows 2003 server have a version of cron? I've never used it. And building it into my webapp lets all the configuration be done from the same interface.. D - 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: Copying large files around
--- HARBOR: http://coolharbor.100free.com/index.htm Now Tomcat is also a cool application server --- - Original Message - From: David Kerber [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Saturday, October 13, 2007 5:29 PM Subject: Re: Copying large files around Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David, David Kerber wrote: Let me give a bit more detail: I am working on a utility function in my webapp that will periodically copy the database file from the db server to a backup server on the LAN. Uh cron and cp, anyone? You can even use cron to initiate the backup, too, instead of scripting it from your webapp. Why doesn't anyone use cron anymore? Sheesh... Does Windows 2003 server have a version of cron? I've never used it. And building it into my webapp lets all the configuration be done from the same interface.. No not that I know of... but there are freeware ports to windows. If its windows based, or perhaps windows to Samba and its just an admin function, like a scheduled copy... then have a look at Microsofts attempt at linux type scripting... its called WSH... its a vb or Javascript type language that lets you do things like copy files, and I imagine it will interface with scheduled tasks, services and all the rest of it. Looks like this Set FSO = CreateObject(Scripting.FileSystemObject) If Not FSO.FolderExists(FolderName) Then FSO.CreateFolder(FolderName) End If Have Fun... - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Help with char encodings
Hi , i have a site configured on every possible place to utf8 , when i use it on my computer everything runs ok beside a little problem where i had to use a file uploaded with commons.fileupload , there i used get with windows1255 but everything works on my computer when i uploaded the file to the host it's not working i can see the hebrew when it comes from the DB but when i try to upload a hebrew file and read it or even hebrew in textbox it comes out as jibrish ? any udeas ? - 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: Copying large files around
David Kerber wrote: Pid wrote: David Kerber wrote: What is the most efficient (=fastest) way of copying large ( 1GB [yes, that's a Giga]) files around the network in java when running under tomcat 5.5.x? Do I use a FileInputStream and FileOutputStream with a large byte[] array? Or what? I think that the NIO apis were intended to handle speedier transfers of data across network connections. It depends how you wish to move the data. Google provided a wealth of results of mixed tutorials and API explanations for java nio. p Let me give a bit more detail: I am working on a utility function in my webapp that will periodically copy the database file from the db server to a backup server on the LAN. This particular function does not use the internet, it's strictly copying on the LAN. I don't care what method it uses as long as it's fairly simple to code, and moves fast. I've already got the creation of the backup file handled; that's a database function. It's just the copying to another machine that I'm working on now. Can you not make the second DB a slave of the main one, it'll be permanently up to date that way and it doesn't require any copying. For integrity to be maintained during the copy you'd have to stop the database otherwise, or you could have unpleasant conditions occuring where some database writing occurs while you're copying it. p D - 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: Does mod_jk copy memory b/w apache and tomcat (using linux, ajp13 worker)?
Apache httpd and Tomcat do not share any memory, so there is not any explicit memory-copying going on. How do they share data? For example, when Tomcat creates an HTTP response containing 50k of HTML, I assume that data exists in Tomcat's memory space. How does that data move over to apache's so it can respond to the HTTP request. If the apache and tomcat process don't use any shared buffers (in linux) wouldn't that mean the data is copied form tomcat's memory space to apache's? If the two processes are on the same machine, and are using the localhost NIC, then UNIX is usually smart enough to do memory copies instead of doing all the TCP/IP stuff necessary to send the data to a remote host. I guess that actually answers my question: the data is (probably) copied between tomcat's memory space and apache's (under ajp13). However, would there be room here for an optimization that uses a shared_buffer to communicate b/w apache tomcat on the same machine? This could reduce process to process data copying. However, from my understanding that can also be achieved through the jni mod_jk worker. Do you know of any good documentation on that worker? I noticed that references such as in this page http://tomcat.apache.org/connectors-doc/generic_howto/workers.html use tomcat version 3.3 as a tomcat instance inside apache's mem space. Are there limitations in doing this with newer tomcat's? Again.. my apologies for not trying this out first.. I'm only asking because there seems to be very little in-process documentation out there (that doesn't reference very old tomcat versions). thanks, moran - 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: Copying large files around
Sadly no cron (and sadly no .htaccess file available either) wrap the java %java_opts% -cp %classpath% classname in either a cmd or .bat On a 7 year old wintel box the application is called Task Scheduler where you want to select that cmd/bat Be sure to set sufficient security permissions to execute as well as read/write whatever resources you need (no catalina.policy to reference permissions when running standalone) One more thing- Click on Icon/Settings/Power Management/Dont start if computer is running on batteries! HTH/ Martin-- - Original Message - From: David Kerber [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Saturday, October 13, 2007 11:29 AM Subject: Re: Copying large files around Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David, David Kerber wrote: Let me give a bit more detail: I am working on a utility function in my webapp that will periodically copy the database file from the db server to a backup server on the LAN. Uh cron and cp, anyone? You can even use cron to initiate the backup, too, instead of scripting it from your webapp. Why doesn't anyone use cron anymore? Sheesh... Does Windows 2003 server have a version of cron? I've never used it. And building it into my webapp lets all the configuration be done from the same interface.. D - 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: Copying large files around
Pid wrote: David Kerber wrote: Pid wrote: David Kerber wrote: What is the most efficient (=fastest) way of copying large ( 1GB [yes, that's a Giga]) files around the network in java when running under tomcat 5.5.x? Do I use a FileInputStream and FileOutputStream with a large byte[] array? Or what? I think that the NIO apis were intended to handle speedier transfers of data across network connections. It depends how you wish to move the data. Google provided a wealth of results of mixed tutorials and API explanations for java nio. p Let me give a bit more detail: I am working on a utility function in my webapp that will periodically copy the database file from the db server to a backup server on the LAN. This particular function does not use the internet, it's strictly copying on the LAN. I don't care what method it uses as long as it's fairly simple to code, and moves fast. I've already got the creation of the backup file handled; that's a database function. It's just the copying to another machine that I'm working on now. Can you not make the second DB a slave of the main one, it'll be permanently up to date that way and it doesn't require any copying. For integrity to be maintained during the copy you'd have to stop the database otherwise, or you could have unpleasant conditions occuring where some database writing occurs while you're copying it. No, database mirroring isn't an option for this particular case; it's rather cost-sensitive, and the customer decided that the extra reliability wasn't worth the extra cost. This database has a backup procedure that is specifically designed to handle transactions that occur during the backup without causing trouble. Plus, the full backup is done during the middle of the night when there is normally nothing going on (there is only activity about 18 hours per day in this app). The other backups during the day are incrementals. D - 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: Copying large files around
Martin Gainty wrote: Sadly no cron (and sadly no .htaccess file available either) wrap the java %java_opts% -cp %classpath% classname in either a cmd or .bat On a 7 year old wintel box the application is called Task Scheduler where you want to select that cmd/bat Be sure to set sufficient security permissions to execute as well as read/write whatever resources you need (no catalina.policy to reference permissions when running standalone) One more thing- Click on Icon/Settings/Power Management/Dont start if computer is running on batteries! HTH/ Martin-- Seems like my idea of just writing a TimerTask to do this would be more straightforward, since I'm doing other stuff with java.util.Timer's anyway... D - 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: [OT] mod_jk - no permission to access index file
exactly, that was it. thanks a lot! albert Is there anything interesting in httpd's error.log file? Symbolic link not allowed: /usr/share/tomcat6 There you go. You have Options FollowSymLinks listed for /usr/share/tomcat6/webapps/my_app, but not for either / or /usr/share or something like that. You'll need to enable the FollowSymLinks option further up the directory structure so that /usr/share/tomcat6 (a symlnk) is followable. - 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: Copying large files around
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David, David Kerber wrote: Does Windows 2003 server have a version of cron? Yes, it's called the Microsoft Task Scheduler. I've never used it. :( And building it into my webapp lets all the configuration be done from the same interface.. Fair enough. :( - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHET+A9CaO5/Lv0PARAmstAJ90SYrU6rhvCQtmglr8SGrlPtk2XQCfTjY8 UlGp14bytS4qjwhBw3TqcYc= =GafA -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 5.5.25, SSL and invalid keystore format
Hello, I am trying to setup SSL in my Tomcat 5.5.25 (on Debian Linux) and thus downloaded a binary version of Tomcat from the Tomcat website. Now I tried to create a keystore: # keytool -genkey -v -keyalg RSA The server.xml is as follows: Connector port=8443 maxHttpHeaderSize=8192 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false disableUploadTimeout=true acceptCount=100 scheme=https secure=true clientAuth=false sslProtocol=TLS / The error message in the log I am getting is: SEVERE: Catalina.start: LifecycleException: service.getName(): Catalina; Protocol handler start failed: java.io.IOException: Invalid keystore format at org.apache.catalina.connector.Connector.start(Connector.java:1097) at org.apache.catalina.core.StandardService.start(StandardService.java:457) at org.apache.catalina.core.StandardServer.start(StandardServer.java:700) at org.apache.catalina.startup.Catalina.start(Catalina.java:552) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433) What is causing this problem? Why is the keystore not valid? Has this to do with the APR or something? How would I need to create a keystore then to make it work in Tomcat? I also tried to specify the keystore location and name but that doesn't change anything...any ideas? Thank you. Best regards, Werner. - 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: embedded Tomcat (5.5.23) application logging (java.util.logging)
I really appreciate the timeliness of all the responses and the theory behind how and when logging is configured and initialized has been explained really well. However I'm not so sure I have explained where I actually am very well. I have been able to configure Java logging via the command line and within the app I wrote which utilizes embedded Tomcat and get desired output. The output I am not getting is from the either of the two web applications (which are registered wars). The part I am not following is if I am getting output from the logging (which utilizes java.util.logging ) in the application itself and the hosted web applications are also using java.util.logging, why am I not getting output from these? If the configuration is ignored because the JVM has already been initialized, I would think the configuration set via the Java Control Panel would be utilized. I suspect there's something simple I am not doing when I register these apps. All the above is correct. See the API doc for java.util.logging.LogManager . The static initializer for that class uses either an instanced of itself or an instance of the class named on the aforementioned system property. Thus, you need to set java.util.logging.manager prior to initializing the JVM.
RE: Copying large files around
From: David Kerber [mailto:[EMAIL PROTECTED] What is the most efficient (=fastest) way of copying large ( 1GB [yes, that's a Giga]) files around the network in java when running under tomcat 5.5.x? Do I use a FileInputStream and FileOutputStream with a large byte[] array? Or what? If you *definitely* want efficient, and you're on Windows, then: - Do not use Java, use OS-level tools; - Run the tools on the receiving machine, not the sending machine. You don't have to worry about differences in buffer sizes between the network and whatever chunking you're using on the Java file copy, and I'm pretty sure I've seen copy pre-allocate the entire file space when the target file is local (because it knows it's copying a source file and it knows it has exclusive access, so the size doesn't change). I've never seen that behaviour when copy is running to a network share. The easiest way of doing this on Windows is via the AT command: write yourself an at that runs a couple of minutes in the future (use Java to look up the time :-) ), similar to: at \\targetserver 21:02 c:\jobs\copyFromLive.bat Ugly as sin, but it works and it's fast. - Peter - 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: Copying large files around
Seconding Peter's comments: It is extremely unlikely that you can beat the Windows tools for this sort of thing (been there, done that). Also, if your webapp isn't physically on one or the other boxes (as Peter said, preferably the reciever), then you are pretty much guaranteed to lose. That being said, if you insist on using Java, then use a MappedByteBuffer on the source, and either a transferTo or TransferFrom to send it to the to. On Windows, this makes an order of magnitude difference for 1GB+ files. Peter Crowther [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] From: David Kerber [mailto:[EMAIL PROTECTED] What is the most efficient (=fastest) way of copying large ( 1GB [yes, that's a Giga]) files around the network in java when running under tomcat 5.5.x? Do I use a FileInputStream and FileOutputStream with a large byte[] array? Or what? If you *definitely* want efficient, and you're on Windows, then: - Do not use Java, use OS-level tools; - Run the tools on the receiving machine, not the sending machine. You don't have to worry about differences in buffer sizes between the network and whatever chunking you're using on the Java file copy, and I'm pretty sure I've seen copy pre-allocate the entire file space when the target file is local (because it knows it's copying a source file and it knows it has exclusive access, so the size doesn't change). I've never seen that behaviour when copy is running to a network share. The easiest way of doing this on Windows is via the AT command: write yourself an at that runs a couple of minutes in the future (use Java to look up the time :-) ), similar to: at \\targetserver 21:02 c:\jobs\copyFromLive.bat Ugly as sin, but it works and it's fast. - Peter - 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: Copying large files around
Peter Crowther wrote: From: David Kerber [mailto:[EMAIL PROTECTED] What is the most efficient (=fastest) way of copying large ( 1GB [yes, that's a Giga]) files around the network in java when running under tomcat 5.5.x? Do I use a FileInputStream and FileOutputStream with a large byte[] array? Or what? If you *definitely* want efficient, and you're on Windows, then: - Do not use Java, use OS-level tools; - Run the tools on the receiving machine, not the sending machine. You don't have to worry about differences in buffer sizes between the network and whatever chunking you're using on the Java file copy, and I'm pretty sure I've seen copy pre-allocate the entire file space when the target file is local (because it knows it's copying a source file and it knows it has exclusive access, so the size doesn't change). I've never seen that behaviour when copy is running to a network share. The easiest way of doing this on Windows is via the AT command: write yourself an at that runs a couple of minutes in the future (use Java to look up the time :-) ), similar to: at \\targetserver 21:02 c:\jobs\copyFromLive.bat Ugly as sin, but it works and it's fast. - Peter Thanks for the suggestion! I would never have thought of that. D - 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: Copying large files around
--- HARBOR: http://coolharbor.100free.com/index.htm Now Tomcat is also a cool application server --- - Original Message - From: David Kerber [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Sunday, October 14, 2007 2:56 AM Subject: Re: Copying large files around If it Postgresql you using, a while a go I wrote a replication system for Postgres, and its a TC servlet. So what you could to is make a real time back up, ie as one transaction happens on the main dB its replicated on the other and visa versa dB has to be designed for it, but they always aligned. If you interested, just yell. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]