Re: add memory
Caldarale, Charles R wrote: From: Alex Mestiashvili [mailto:[EMAIL PROTECTED] Subject: Re: add memory export JAVA_OPTS= -XX:MaxPermSize=256m -Xmx12000m Do you really have enough RAM on your server to make a 12 GB heap viable? - 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] Hi , this server has 16G ,do you think something wrong ? - 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: Question is answered. See Bill Barker-2 answer (update)
Hi Chris! They can upload them using javascript file manager Totally rejecting scripting seems to be more robust solution Christopher Schultz-2 wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Kazukin, kazukin6 wrote: And yes, for us it' not possible to give users to change only parts of jsp's and deny execution of these parts based on some credential assessments executed during some if checkAccess tags How do your users submit updated JSP files? Do you have the opportunity to scan them before installation? If so, why not simply reject anything containing [EMAIL PROTECTED]? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkjQJV4ACgkQ9CaO5/Lv0PCNOACgu+CaPCGqYX+0t1jhPJhDRZ/K b88An1s5lPVnO1xiU2WiBljlYbTC+tZd =AN9/ -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] -- View this message in context: http://www.nabble.com/Disable-java-code-execution-%3C-blabla-%3E-in-jsp%2C-but-permits-tags-tp19415053p19527565.html 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: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing....
Thanks, First I will try to close resources before returning. Although I am sure that the finally blocks are reached, since I use logging in the last finally block and the log is outputted. try { } finally { connection.close(); Data.logConnection(connection); // this is logged } But I'll give it a try anyway. Object object = null; try { } finally { close resources.. } return object; The static methods are not thread-safe you say! So, what exactly does it mean when we say that Tomcat is thread safe for requests. Tomcat creates a new thread for each request, so somehow my static methods are then thread safe (incdirectly, since it is managed by Tomcat). Request A new Thread A using my static method for loadBranches(...) Request B new Thread B using my static method for loadBranches(...) Thread B must wait until Thread A is done. Since threads are managed by tomcat, no thread should be able to use a static method that is used by another thread. Or in fact, you must be right, should I declare them synchronized? public static synchronized loadBranches(...) Thanks, Sinoea From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: Re: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing Date: Tue, 16 Sep 2008 18:58:25 +0200 - Original Message - From: Johnny Kewl [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, September 16, 2008 5:41 PM Subject: Re: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing - Original Message - From: Brantley Hobbs [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, September 16, 2008 5:27 PM Subject: Re: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing return statements do not prevent the finally block from executing: http://java.sun.com/docs/books/tutorial/essential/exceptions/finally.html I stand corrected... Always understood as during exception handling... but you right it seems I just cant bring myself to write code like that... feels un-natural... I would still put return after the close... apologies... Ok sinoea, what I thought was just s little slip turns out to be right... I actually tested it... that finally does run as the method loses scope... I actually wonder how they do that... I imagine a destructor in a C class underneath Java... its interesting, but I got to tell you, you doing the all the good text bokk stuff, but the code makes me feel uncomfortable... Anyway... I think you got a threading problem... You using static class and servlets are multithreaded Rather do something like this... CollectionBranch branches = new BranchData().loadBranches(Data.getDataSource(), 1); and get rid of the static methods in that BranchData class ie make it thread safe... at the moment you have multiple threads in that static method... and with that finally I really dont know... haha and then... results.close(); statement.close(); connection.close(); return branches; Would make me happy... and handle those exceptions } catch (SQLException e) { branch.setErrorMsg(Dear User, you have run out of connections); }finally{ //absolute critical stuff } But that really is just a style thing from the looks of things... although I do think that with just a finally, you will still get a ungly servlet exception... ie you are definitely cleaning up... but you not telling the user why... its style You doing all the good stuff... but more important even if you forget a final or two... is just a nice clean readable flow... I think ;) We have a style clash ;) Anyway thing your problem may go away once its thread safe ;) Thanks... learnt something ;) Will keep guessing till we get it ;) --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Make a mini you and download it into Windows Live Messenger http://clk.atdmt.com/UKM/go/111354029/direct/01/
Re: How do you have your dev environment setup?
Bai Shen wrote: I've been doing a lot of webapp development on tomcat, but currently my process is all manual. I write the code in Eclipse, and then copy the appropriate files over to tomcat. I'd like to automate and standardize my process. So would y'all mind explaining how your dev environment is configured? I'd appreciate the insight. TIA. Unpack Tomcat from zip package, and register it in Eclipse: Window, Preferences, Server, Installed Runtimes. Create new web projects with: File, New, Project, Dynamic web project. Then, make sure that you have server tab opened with: Window, Show view, Other, Server. Drag the project from Projects explorer to Tomcat server in Server tab. Run the server. From that point on, tomcat publishes the files to the server automatically, and warns you when you need to restart the server. Dependant projects are packed to jar files in WEB-INF/lib, and referenced libraries are also copied to the same place. Regards, Ognjen - 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 5.5, JNDI Connection Pooling, Active connections keep increasing....
- Original Message - From: sinoea kaabi [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Wednesday, September 17, 2008 11:31 AM Subject: RE: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing Thanks, First I will try to close resources before returning. Although I am sure that the finally blocks are reached, since I use logging in the last finally block and the log is outputted. try { } finally { connection.close(); Data.logConnection(connection); // this is logged } But I'll give it a try anyway. Object object = null; try { } finally { close resources.. } return object; The static methods are not thread-safe you say! So, what exactly does it mean when we say that Tomcat is thread safe for requests. Tomcat creates a new thread for each request, so somehow my static methods are then thread safe (incdirectly, since it is managed by Tomcat). Request A new Thread A using my static method for loadBranches(...) Request B new Thread B using my static method for loadBranches(...) Thread B must wait until Thread A is done. Since threads are managed by tomcat, no thread should be able to use a static method that is used by another thread. Or in fact, you must be right, should I declare them synchronized? public static synchronized loadBranches(...) Thanks, Sinoea = Yes your finally blocks are working I checked that... the book is right ;) On threading. No just make the class *non* static CollectionBranch branches = *NEW* BranchData().loadBranches(Data.getDataSource(), 1); so now each thread has its own class. I imagine thats tomcats pool is already thread safe... synchronized will work... but its a bottle neck... it will make tomcat Q... and there is a setting in tomcat somewhere where one can make it single threaded... but again it will slow it down... you only use that when a coder has cocked up ;) In threading the thing to watch is those global variables... so without seeing your actual code its difficult to spot problems... Thread safety is more of an art than a science... New should do it because every thread is getting its own class... so a class is isolated, the connection and everything else is inside it... and they cant mess with each other... in theory... if there are no shared globals... So I think whats happening in your static class is something like this... Thread 1 opens connection 1 inside class Thread 2 open connection 2 also inside class Close connection 2 Close connection 2 ie same connection is no closed twice and connection 1 slips out... that wont happen if the class in not static... I think ;) have fun... --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - 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 5.5, JNDI Connection Pooling, Active connections keep increasing....
Sounds reasonable, I will give it a try with non-static methods instead, new Dao() basically. Thanks, Sinoea From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: Re: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing Date: Wed, 17 Sep 2008 12:25:17 +0200 - Original Message - From: sinoea kaabi [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Wednesday, September 17, 2008 11:31 AM Subject: RE: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing Thanks, First I will try to close resources before returning. Although I am sure that the finally blocks are reached, since I use logging in the last finally block and the log is outputted. try { } finally { connection.close(); Data.logConnection(connection); // this is logged } But I'll give it a try anyway. Object object = null; try { } finally { close resources.. } return object; The static methods are not thread-safe you say! So, what exactly does it mean when we say that Tomcat is thread safe for requests. Tomcat creates a new thread for each request, so somehow my static methods are then thread safe (incdirectly, since it is managed by Tomcat). Request A new Thread A using my static method for loadBranches(...) Request B new Thread B using my static method for loadBranches(...) Thread B must wait until Thread A is done. Since threads are managed by tomcat, no thread should be able to use a static method that is used by another thread. Or in fact, you must be right, should I declare them synchronized? public static synchronized loadBranches(...) Thanks, Sinoea = Yes your finally blocks are working I checked that... the book is right ;) On threading. No just make the class *non* static CollectionBranch branches = *NEW* BranchData().loadBranches(Data.getDataSource(), 1); so now each thread has its own class. I imagine thats tomcats pool is already thread safe... synchronized will work... but its a bottle neck... it will make tomcat Q... and there is a setting in tomcat somewhere where one can make it single threaded... but again it will slow it down... you only use that when a coder has cocked up ;) In threading the thing to watch is those global variables... so without seeing your actual code its difficult to spot problems... Thread safety is more of an art than a science... New should do it because every thread is getting its own class... so a class is isolated, the connection and everything else is inside it... and they cant mess with each other... in theory... if there are no shared globals... So I think whats happening in your static class is something like this... Thread 1 opens connection 1 inside class Thread 2 open connection 2 also inside class Close connection 2 Close connection 2 ie same connection is no closed twice and connection 1 slips out... that wont happen if the class in not static... I think ;) have fun... --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Make a mini you and download it into Windows Live Messenger http://clk.atdmt.com/UKM/go/111354029/direct/01/
RE: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing....
Just a question here, I am using a Data class to retrieve the datasource public class Data { /** * Gets a [EMAIL PROTECTED] DataSource} for database connection usage. * @return The datasource for database connection. * @throws SQLException */ public static DataSource getDataSource() throws SQLException { if (ds == null) { DATASOURCE.info(DataSource is NULL ); MANY_CONNECTIONS.info(DataSource is NULL ); try { final Context initContext = new InitialContext(); ds = (BasicDataSource)initContext.lookup(java:/comp/env/jdbc/myDB); initContext.close(); logDataSource(ds); return ds; } catch (final NamingException e) { e.printStackTrace(); throw new RuntimeException(Java naming exception when getting connection from tomcat pool: + e.getMessage()); } } else { logDataSource(ds); return ds; } } } Collection branches = new BranchData().loadBranches(Data.getDataSource(), 1); Can the getDataSource method be static? Thanks, Sinoea From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: Re: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing Date: Wed, 17 Sep 2008 12:25:17 +0200 - Original Message - From: sinoea kaabi To: Tomcat Users List Sent: Wednesday, September 17, 2008 11:31 AM Subject: RE: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing Thanks, First I will try to close resources before returning. Although I am sure that the finally blocks are reached, since I use logging in the last finally block and the log is outputted. try { } finally { connection.close(); Data.logConnection(connection); // this is logged } But I'll give it a try anyway. Object object = null; try { } finally { close resources.. } return object; The static methods are not thread-safe you say! So, what exactly does it mean when we say that Tomcat is thread safe for requests. Tomcat creates a new thread for each request, so somehow my static methods are then thread safe (incdirectly, since it is managed by Tomcat). Request A new Thread A using my static method for loadBranches(...) Request B new Thread B using my static method for loadBranches(...) Thread B must wait until Thread A is done. Since threads are managed by tomcat, no thread should be able to use a static method that is used by another thread. Or in fact, you must be right, should I declare them synchronized? public static synchronized loadBranches(...) Thanks, Sinoea = Yes your finally blocks are working I checked that... the book is right ;) On threading. No just make the class *non* static Collection branches = *NEW* BranchData().loadBranches(Data.getDataSource(), 1); so now each thread has its own class. I imagine thats tomcats pool is already thread safe... synchronized will work... but its a bottle neck... it will make tomcat Q... and there is a setting in tomcat somewhere where one can make it single threaded... but again it will slow it down... you only use that when a coder has cocked up ;) In threading the thing to watch is those global variables... so without seeing your actual code its difficult to spot problems... Thread safety is more of an art than a science... New should do it because every thread is getting its own class... so a class is isolated, the connection and everything else is inside it... and they cant mess with each other... in theory... if there are no shared globals... So I think whats happening in your static class is something like this... Thread 1 opens connection 1 inside class Thread 2 open connection 2 also inside class Close connection 2 Close connection 2 ie same connection is no closed twice and connection 1 slips out... that wont happen if the class in not static... I think ;) have fun... --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
apache and tomcat version
hi i have used yet tomcat 5.0 and tomcat 5.5 i have one confusion , is tomcat 3.2.1 and apache 1.3.27 are both server or ,we have to use both for configure server or anything else please help me - Java/J2EE developer India blogs http://hardik4u.wordpress.com wordpress blog -- View this message in context: http://www.nabble.com/apache-and-tomcat-version-tp19529503p19529503.html 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: Interapp Communications
Darryl Pentz wrote: Hi Johnny, Thanks for your responses. I did read them on the day that you posted them but only got a chance now to respond. Needless to say I have gone with a simple HttpURLConnection solution, as my choice out of other suggestions given to me in other threads, of using numerous other solutions including RMI, HttpInvoker, JMS, etc. Eventually, the simple HttpURLConnection is nice and lightweight for my needs right now. And now that the beast that is the Commons HttpClient is out of the mix things are far more efficient. I bumped into this by accident, and have no idea if it's still valid, but maybe interesting : http://www.javaworld.com/javaworld/jw-03-2001/jw-0323-traps.html?page=2 André - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Browser Limited web application
Hi Spec : TOMCAT 6.0.18 O/s: HP UNIX 11i J2SDK : j2sdk1.6 or jre 1.6 An application deployed on the env as 'XYZ.war' Question 1 : How to implement a Filter in the application for Browsers limitation The web application should be visible only in IE-6 or Fire Fox 2.0 ? Question 2: How to fetch the MAC address (Physical address) of the clients using web application ? Note:- Spent 3 days on Google / yahoo for the same yet no answers. Please suggest me ... With regards Karthik
Re: apache and tomcat version
I did not understand your question but here are some pointers: - Tomcat is a servlet container which can be used to host your servlet / JSPs etc. - Apache 1.3.27 is an HTTP server that can only host static files like html pages, images etc. However you can integrate Tomcat with Apache using mod_jk and then access your servlets / JSPs via Apache Server. See Apache - Tomcat HOWTO doc for more details on how this can be done. If this does not answer your query, plz provide some more details. -Original Message- From: Hardik Shah [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Wed, 17 Sep 2008 4:19 pm Subject: apache and tomcat version hi i have used yet tomcat 5.0 and tomcat 5.5 i have one confusion , is tomcat 3.2.1 and apache 1.3.27 are both server or ,we have to use both for configure server or anything else please help me - Java/J2EE developer India blogs http://hardik4u.wordpress.com wordpress blog -- View this message in context: http://www.nabble.com/apache-and-tomcat-version-tp19529503p19529503.html 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] You are invited to Get a Free AOL Email ID. - http://webmail.aol.in - 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: Browser Limited web application
From: karthikn [mailto:[EMAIL PROTECTED] Question 2: How to fetch the MAC address (Physical address) of the clients using web application ? You can not do this at the server. Some clients may not even have one - a computer with no network card using a dial-up modem to access the Internet has no MAC address. If you look at the OSI 7-layer model, the MAC address exists in some Datalink (layer 2) implementations, but need not exist on all. If you really, *really* need the MAC address, you would have to write a piece of code to download to the client computer and run on the client computer to get it. I suspect most anti-malware programs would recognise that software as spyware and stop it running. - 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: apache and tomcat version
From: Hardik Shah [mailto:[EMAIL PROTECTED] is tomcat 3.2.1 and apache 1.3.27 are both server Tomcat 3.2.1 is a web server. You can use it to serve Web pages or web applications directly. You do not need to use any version of Apache httpd as well. If you want to use Apache httpd as well, you can connect Tomcat to httpd using AJP. It is more difficult to set up the two servers in this way. If possible, I would use a newer version of Tomcat than version 3. - 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: Browser Limited web application
On Wed, Sep 17, 2008 at 6:58 AM, karthikn [EMAIL PROTECTED]wrote: Question 1 : How to implement a Filter in the application for Browsers limitation The web application should be visible only in IE-6 or Fire Fox 2.0 ? You can write deploy a Filter that examines the User-Agent HTTP request header field, though that's far from foolproof -- see 14.43 of: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html Question 2: How to fetch the MAC address (Physical address) of the clients using web application ? Can you map the client IP via the ARP cache? See man arp and: http://en.wikipedia.org/wiki/Address_Resolution_Protocol
Re: Browser Limited web application
For # 1, try this in your filter: if(httpservletrequest.getHeader(User-Agent).indexOf(MSIE 6.0)!= -1) filterchain.doFilter(servletrequest, servletresponse); else httpservletresponse.getWriter().print(This browser version is not supported!!!); This will ensure that your app is only accessible on IE 6. -Original Message- From: karthikn [EMAIL PROTECTED] To: users@tomcat.apache.org users@tomcat.apache.org Sent: Wed, 17 Sep 2008 4:28 pm Subject: Browser Limited web application Hi Spec : TOMCAT 6.0.18 O/s: HP UNIX 11i J2SDK : j2sdk1.6 or jre 1.6 An application deployed on the env as 'XYZ.war' Question 1 : How to implement a Filter in the application for Browsers limitation The web application should be visible only in IE-6 or Fire Fox 2.0 ? Question 2: How to fetch the MAC address (Physical address) of the clients using web application ? Note:- Spent 3 days on Google / yahoo for the same yet no answers. Please suggest me ... With regards Karthik You are invited to Get a Free AOL Email ID. - http://webmail.aol.in - 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 5.5, JNDI Connection Pooling, Active connections keep increasing....
A static method can't have access to class instance variables. You could make it static, but it shouldn't reference any variables it didn't locally declare: /** * Gets a [EMAIL PROTECTED] DataSource} for database connection usage. * @return The datasource for database connection. * @throws SQLException */ public static DataSource getDataSource() throws SQLException { Datasource ds = null ; try { Context initContext = new InitialContext(); ds = (DataSource)initContext.lookup(java:/comp/env/jdbc/myDB); initContext.close(); return ds; } catch (final NamingException e) { e.printStackTrace(); throw new RuntimeException(Java naming exception when getting connection from tomcat pool: + e.getMessage()); } } --David sinoea kaabi wrote: Just a question here, I am using a Data class to retrieve the datasource public class Data { /** * Gets a [EMAIL PROTECTED] DataSource} for database connection usage. * @return The datasource for database connection. * @throws SQLException */ public static DataSource getDataSource() throws SQLException { if (ds == null) { DATASOURCE.info(DataSource is NULL ); MANY_CONNECTIONS.info(DataSource is NULL ); try { final Context initContext = new InitialContext(); ds = (BasicDataSource)initContext.lookup(java:/comp/env/jdbc/myDB); initContext.close(); logDataSource(ds); return ds; } catch (final NamingException e) { e.printStackTrace(); throw new RuntimeException(Java naming exception when getting connection from tomcat pool: + e.getMessage()); } } else { logDataSource(ds); return ds; } } } Collection branches = new BranchData().loadBranches(Data.getDataSource(), 1); Can the getDataSource method be static? Thanks, Sinoea From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: Re: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing Date: Wed, 17 Sep 2008 12:25:17 +0200 - Original Message - From: sinoea kaabi To: Tomcat Users List Sent: Wednesday, September 17, 2008 11:31 AM Subject: RE: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing Thanks, First I will try to close resources before returning. Although I am sure that the finally blocks are reached, since I use logging in the last finally block and the log is outputted. try { } finally { connection.close(); Data.logConnection(connection); // this is logged } But I'll give it a try anyway. Object object = null; try { } finally { close resources.. } return object; The static methods are not thread-safe you say! So, what exactly does it mean when we say that Tomcat is thread safe for requests. Tomcat creates a new thread for each request, so somehow my static methods are then thread safe (incdirectly, since it is managed by Tomcat). Request A new Thread A using my static method for loadBranches(...) Request B new Thread B using my static method for loadBranches(...) Thread B must wait until Thread A is done. Since threads are managed by tomcat, no thread should be able to use a static method that is used by another thread. Or in fact, you must be right, should I declare them synchronized? public static synchronized loadBranches(...) Thanks, Sinoea = Yes your finally blocks are working I checked that... the book is right ;) On threading. No just make the class *non* static Collection branches = *NEW* BranchData().loadBranches(Data.getDataSource(), 1); so now each thread has its own class. I imagine thats tomcats pool is already thread safe... synchronized will work... but its a bottle neck... it will make tomcat Q... and there is a setting in tomcat somewhere where one can make it single threaded... but again it will slow it down... you only use that when a coder has cocked up ;) In threading the thing to watch is those global variables... so without seeing your actual code its difficult to spot problems... Thread safety is more of an art than a science... New should do it because every thread is getting its own class... so a class is isolated, the connection and everything else is inside it... and they cant mess with each other... in theory... if there are no shared globals... So I think whats happening in your static class is something like this... Thread 1 opens connection 1 inside class Thread 2
Re: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing....
- Original Message - From: sinoea kaabi [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Wednesday, September 17, 2008 12:48 PM Subject: RE: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing Just a question here, I am using a Data class to retrieve the datasource public class Data { /** * Gets a [EMAIL PROTECTED] DataSource} for database connection usage. * @return The datasource for database connection. * @throws SQLException */ public static DataSource getDataSource() throws SQLException { if (ds == null) { DATASOURCE.info(DataSource is NULL ); MANY_CONNECTIONS.info(DataSource is NULL ); try { final Context initContext = new InitialContext(); ds = (BasicDataSource)initContext.lookup(java:/comp/env/jdbc/myDB); initContext.close(); logDataSource(ds); return ds; } catch (final NamingException e) { e.printStackTrace(); throw new RuntimeException(Java naming exception when getting connection from tomcat pool: + e.getMessage()); } } else { logDataSource(ds); return ds; } } } = Sineoa, my feeling is dont use static, unless you really want it in a multithreaded environment It pumps all the threads thru one pipe... So yes I would *new* that as well... But note this is where you will better be server by a DBCP user... because we dont use it... ie someone may say that declaring the Context as static is standard practice and saves time... but I dont think so You cant really go wrong by making it new... but you can get nailed by making it static ;) Have fun... --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - 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 5.5, JNDI Connection Pooling, Active connections keep increasing....
Thanks! Date: Wed, 17 Sep 2008 08:01:01 -0400 From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: Re: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing A static method can't have access to class instance variables. You could make it static, but it shouldn't reference any variables it didn't locally declare: /** * Gets a [EMAIL PROTECTED] DataSource} for database connection usage. * @return The datasource for database connection. * @throws SQLException */ public static DataSource getDataSource() throws SQLException { Datasource ds = null ; try { Context initContext = new InitialContext(); ds = (DataSource)initContext.lookup(java:/comp/env/jdbc/myDB); initContext.close(); return ds; } catch (final NamingException e) { e.printStackTrace(); throw new RuntimeException(Java naming exception when getting connection from tomcat pool: + e.getMessage()); } } --David sinoea kaabi wrote: Just a question here, I am using a Data class to retrieve the datasource public class Data { /** * Gets a [EMAIL PROTECTED] DataSource} for database connection usage. * @return The datasource for database connection. * @throws SQLException */ public static DataSource getDataSource() throws SQLException { if (ds == null) { DATASOURCE.info(DataSource is NULL ); MANY_CONNECTIONS.info(DataSource is NULL ); try { final Context initContext = new InitialContext(); ds = (BasicDataSource)initContext.lookup(java:/comp/env/jdbc/myDB); initContext.close(); logDataSource(ds); return ds; } catch (final NamingException e) { e.printStackTrace(); throw new RuntimeException(Java naming exception when getting connection from tomcat pool: + e.getMessage()); } } else { logDataSource(ds); return ds; } } } Collection branches = new BranchData().loadBranches(Data.getDataSource(), 1); Can the getDataSource method be static? Thanks, Sinoea From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: Re: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing Date: Wed, 17 Sep 2008 12:25:17 +0200 - Original Message - From: sinoea kaabi To: Tomcat Users List Sent: Wednesday, September 17, 2008 11:31 AM Subject: RE: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing Thanks, First I will try to close resources before returning. Although I am sure that the finally blocks are reached, since I use logging in the last finally block and the log is outputted. try { } finally { connection.close(); Data.logConnection(connection); // this is logged } But I'll give it a try anyway. Object object = null; try { } finally { close resources.. } return object; The static methods are not thread-safe you say! So, what exactly does it mean when we say that Tomcat is thread safe for requests. Tomcat creates a new thread for each request, so somehow my static methods are then thread safe (incdirectly, since it is managed by Tomcat). Request A new Thread A using my static method for loadBranches(...) Request B new Thread B using my static method for loadBranches(...) Thread B must wait until Thread A is done. Since threads are managed by tomcat, no thread should be able to use a static method that is used by another thread. Or in fact, you must be right, should I declare them synchronized? public static synchronized loadBranches(...) Thanks, Sinoea = Yes your finally blocks are working I checked that... the book is right ;) On threading. No just make the class *non* static Collection branches = *NEW* BranchData().loadBranches(Data.getDataSource(), 1); so now each thread has its own class. I imagine thats tomcats pool is already thread safe... synchronized will work... but its a bottle neck... it will make tomcat Q... and there is a setting in tomcat somewhere where one can make it single threaded... but again it will slow it down... you only use that when a coder has cocked up ;) In threading the thing to watch is those global variables... so without seeing your actual code its difficult to spot problems... Thread safety is more of an art than a science... New should do it because every thread is
Re: Browser Limited web application
Peter Crowther wrote: From: karthikn [mailto:[EMAIL PROTECTED] Question 2: How to fetch the MAC address (Physical address) of the clients using web application ? You can not do this at the server. Some clients may not even have one - a computer with no network card using a dial-up modem to access the Internet has no MAC address. If you look at the OSI 7-layer model, the MAC address exists in some Datalink (layer 2) implementations, but need not exist on all. If you really, *really* need the MAC address, you would have to write a piece of code to download to the client computer and run on the client computer to get it. I suspect most anti-malware programs would recognise that software as spyware and stop it running. In other words, you can only get the mac address from the computers in LAN. Everything that comes outside your LAN does not have mac address. For computers in the local network you could execute ping ip, and then arp -a, and parse the result. Or you could look for an Java ARP implementation, there are some of them on the internet, but are not very simple to use. Regards, Ognjen - 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: add memory
From: Alex Mestiashvili [mailto:[EMAIL PROTECTED] Subject: Re: add memory Hi , this server has 16G ,do you think something wrong ? No, just impressed. Must be about a week between garbage collections :-) - 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: Browser Limited web application
Hi For computers in the local network you could execute ping ip, and then arp -a, and parse the result. Or you could look for an Java ARP implementation, there are some of them on the internet, but are not very simple to use. Correct but HOW via a JSP at run time With regards Karthik -Original Message- From: Ognjen Blagojevic [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2008 5:57 PM To: Tomcat Users List Subject: Re: Browser Limited web application Peter Crowther wrote: From: karthikn [mailto:[EMAIL PROTECTED] Question 2: How to fetch the MAC address (Physical address) of the clients using web application ? You can not do this at the server. Some clients may not even have one - a computer with no network card using a dial-up modem to access the Internet has no MAC address. If you look at the OSI 7-layer model, the MAC address exists in some Datalink (layer 2) implementations, but need not exist on all. If you really, *really* need the MAC address, you would have to write a piece of code to download to the client computer and run on the client computer to get it. I suspect most anti-malware programs would recognise that software as spyware and stop it running. In other words, you can only get the mac address from the computers in LAN. Everything that comes outside your LAN does not have mac address. For computers in the local network you could execute ping ip, and then arp -a, and parse the result. Or you could look for an Java ARP implementation, there are some of them on the internet, but are not very simple to use. Regards, Ognjen - 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]
Tomcat 6 Manager
I am trying to use the deployment of a host directory under the tomcat manager. The context path that I want to use is /webapp/bfc. However whenever I try to deploy the directory it gives me an invalid context path and it fails to deploy. What should I put in the context path to have it deploy to /webapps/bfc? Thanks, Susan BFC Associates, Inc. Helping Save You Money on Warehouse Operations Susan Conger Chapel Hill, NC 630-562-0375 x106 Main Office: 245 W. Roosevelt Rd. #8-51 West Chicago, IL 60185 630.562.0375 630.562.0618 (fax)
RE: Browser Limited web application
Hi Some experimentation was done for the same But some Browsers provide modification of User-Agent Is this fool proof ? With regards Karthik -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2008 5:09 PM To: users@tomcat.apache.org Subject: Re: Browser Limited web application For # 1, try this in your filter: if(httpservletrequest.getHeader(User-Agent).indexOf(MSIE 6.0)!= -1) filterchain.doFilter(servletrequest, servletresponse); else httpservletresponse.getWriter().print(This browser version is not supported!!!); This will ensure that your app is only accessible on IE 6. -Original Message- From: karthikn [EMAIL PROTECTED] To: users@tomcat.apache.org users@tomcat.apache.org Sent: Wed, 17 Sep 2008 4:28 pm Subject: Browser Limited web application Hi Spec : TOMCAT 6.0.18 O/s: HP UNIX 11i J2SDK : j2sdk1.6 or jre 1.6 An application deployed on the env as 'XYZ.war' Question 1 : How to implement a Filter in the application for Browsers limitation The web application should be visible only in IE-6 or Fire Fox 2.0 ? Question 2: How to fetch the MAC address (Physical address) of the clients using web application ? Note:- Spent 3 days on Google / yahoo for the same yet no answers. Please suggest me ... With regards Karthik You are invited to Get a Free AOL Email ID. - http://webmail.aol.in - 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 5.5, JNDI Connection Pooling, Active connections keep increasing....
Johnny -- A properly written static method would be completely stateless and could be executed from any number of threads simultaneously without issue. Think old style function calls in C where stuff is created on the stack and then popped off when execution finishes. The only hazard is if that static method tries to access an object that isn't thread-safe -- then you need sync blocks to protect the object. --David Johnny Kewl wrote: - Original Message - From: sinoea kaabi [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Wednesday, September 17, 2008 12:48 PM Subject: RE: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing Just a question here, I am using a Data class to retrieve the datasource public class Data { /** * Gets a [EMAIL PROTECTED] DataSource} for database connection usage. * @return The datasource for database connection. * @throws SQLException */ public static DataSource getDataSource() throws SQLException { if (ds == null) { DATASOURCE.info(DataSource is NULL ); MANY_CONNECTIONS.info(DataSource is NULL ); try { final Context initContext = new InitialContext(); ds = (BasicDataSource)initContext.lookup(java:/comp/env/jdbc/myDB); initContext.close(); logDataSource(ds); return ds; } catch (final NamingException e) { e.printStackTrace(); throw new RuntimeException(Java naming exception when getting connection from tomcat pool: + e.getMessage()); } } else { logDataSource(ds); return ds; } } } = Sineoa, my feeling is dont use static, unless you really want it in a multithreaded environment It pumps all the threads thru one pipe... So yes I would *new* that as well... But note this is where you will better be server by a DBCP user... because we dont use it... ie someone may say that declaring the Context as static is standard practice and saves time... but I dont think so You cant really go wrong by making it new... but you can get nailed by making it static ;) Have fun... --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - 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]
DBCP Question
Greetings, Firstly i am using Tomcat 5.5 and Java 1.5. I am writing a simple web app but now my problem is the setup for the dbcp. I have set up the app with the resource tag in the context.xml file in the META-INF folder and it all works fine. Now for my problem... I would like to be able to change the username, password, driver class etc from the app itself (in order for people to point to different databases dynamically). My first idea was to do all these settings in a properties file but i cant find a way to get those property values into the context.xml. I am also open to setting up the resource from the code itself but cannot find a way to do this. Does anyone have any suggestions or ideas. I have done allot of Googling with not luck. Many thanks, Paul Selibas
[OT] RE: Browser Limited web application
[Marked off-topic as this now has nothing to do with Tomcat] From: karthikn [mailto:[EMAIL PROTECTED] But some Browsers provide modification of User-Agent Is this fool proof ? No. You have no control over the client; you cannot determine what it really is, only what it says it is. AVG8, for example, can pretend pretty convincingly to be Internet Explorer. The only way to be relatively certain is to send a page to the browser that uses Javascript to check for known bugs or quirks in the browser, and sends back to you a status report. Of course, a hacker has control over the client, so could change the Javascript code you send (or run it under a debugger) to report whatever they wanted... you can never be *certain*. If you told us what you were trying to do, and what is an acceptable level of confidence in the result, we might be able to help more. - 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: Browser Limited web application
karthikn wrote: Hi Some experimentation was done for the same But some Browsers provide modification of User-Agent Is this fool proof ? No. 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: DBCP Question
I think you'll have to have your webapp manage it's own DBCP pool locally. I doubt there's a good way to change pool parameters on tomcat provide database pools on the fly. At minimum, any change to the Resource ... / element config would require your webapp be restarted. --David Paul Selibas wrote: Greetings, Firstly i am using Tomcat 5.5 and Java 1.5. I am writing a simple web app but now my problem is the setup for the dbcp. I have set up the app with the resource tag in the context.xml file in the META-INF folder and it all works fine. Now for my problem... I would like to be able to change the username, password, driver class etc from the app itself (in order for people to point to different databases dynamically). My first idea was to do all these settings in a properties file but i cant find a way to get those property values into the context.xml. I am also open to setting up the resource from the code itself but cannot find a way to do this. Does anyone have any suggestions or ideas. I have done allot of Googling with not luck. Many thanks, Paul Selibas - 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 6 Manager
Susan G. Conger wrote: I am trying to use the deployment of a host directory under the tomcat manager. No sure what you mean by deploy a host directory. The context path that I want to use is /webapp/bfc. However whenever I try to deploy the directory it gives me an invalid context path and it fails to deploy. What should I put in the context path to have it deploy to /webapps/bfc? webapps is usually the host's appBase. I am a little confused. A few questions: - what is the full path to your Tomcat installation? - what is your host configuration in server.xml? - what is the full path to the directory you want to deploy? - what url do you want to use to access this web app? 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: DBCP Question
On Wed, Sep 17, 2008 at 3:03 PM, David Smith [EMAIL PROTECTED] wrote: I think you'll have to have your webapp manage it's own DBCP pool locally. I doubt there's a good way to change pool parameters on tomcat provide database pools on the fly. At minimum, any change to the Resource ... / element config would require your webapp be restarted. Thank you for your response. I don't mind restarting the web app after a DB change. But it appears that i will have to manage the pooling myself or use ibatis or some equivalent.
Re: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing....
So, what exactly does it mean when we say that Tomcat is thread safe for requests. Tomcat creates a new thread for each request, so somehow my static methods are then thread safe (incdirectly, since it is managed by Tomcat). I actually searched all over to try find something for you this looks ok http://www.codestyle.org/java/servlets/faq-Threads.shtml But here my un-scientific way of thinking about it... When tomcat sends a thread into your doGet method... All those local variables in that thread are ok... So I think about it as each thread being a lane on a big freeway/highway... So yes you right in a way... Tomcat isnt allowing those local method variables to get mixed up... but the second you decalare a static method or static variable... you had better be sure its thread safe. What happens to that highway is that all the lanes merge into one, and every car has to go through it... When you add synchronized... your 30 lane high way becomes a single lane and its one car at a time... You dont want to add synchronized because here you have the TC guys gone thru all the hassle of making sure you can have a 30 lane highway... and you bang it into one lane so new is better because each lane gets its own engine... and java is pretty damn good at garbage collecting, that little bit of memory is a blip on the radar screen... You got to really know what your code is doing when its static... you got to know its thread safe, and it can be really hard to see that 30 car pile up coming on the highway ;) My way of thinking about this stuff. mad science - chapter 1 ;) --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - 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: Non-Heap Memory always increasing during deployment for TC 5.5.26/Solaris/JVM 1.5.0_16
Hi Charles We don't have any thing other than the default installation, so nothing on the common/lib. We also don't have any JSP on this app. I've made a small webapp with one class, and I see the number of threads, classes loaded and non-heap memory actually going up, in a very smaller amount, of course, but still, never decreasing. Wouldn't it be a problem with the JVM or tomcat and the plataform? This is really a show stopper for us, and I believe can affect a lot of people as well. regards Emerson 2008/9/17 Caldarale, Charles R [EMAIL PROTECTED]: From: emerson cargnin [mailto:[EMAIL PROTECTED] Subject: Non-Heap Memory always increasing during deployment for TC 5.5.26/Solaris/JVM 1.5.0_16 Every time I hot-deploy an application, the non-heap memory goes up. Some component in your environment is hanging onto object or class references when it shouldn't. Placing logging libraries in a common location rather than with each webapp is a common - but certainly not only - cause. Read the FAQ again: http://wiki.apache.org/tomcat/FAQ/Memory#Q2 In particular, the FAQ links to this article: http://opensource.atlassian.com/confluence/spring/pages/viewpage.action?pageId=2669 - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing....
Comments inline ... Johnny Kewl wrote: So, what exactly does it mean when we say that Tomcat is thread safe for requests. Tomcat creates a new thread for each request, so somehow my static methods are then thread safe (incdirectly, since it is managed by Tomcat). I actually searched all over to try find something for you this looks ok http://www.codestyle.org/java/servlets/faq-Threads.shtml But here my un-scientific way of thinking about it... When tomcat sends a thread into your doGet method... All those local variables in that thread are ok... As long as you mean variables defined inside of the doGet() method. Class instance variables are not cool in servlets. So I think about it as each thread being a lane on a big freeway/highway... But objects are not thread local unless they are setup that way implementing something like ThreadLocal. Only the references to the object are local. So yes you right in a way... Tomcat isnt allowing those local method variables to get mixed up... but the second you decalare a static method or static variable... you had better be sure its thread safe. Let's not confuse static methods and static variables. Static variables should be avoided unless they are true constants. Static methods on the other hand are fine, but need to be careful when those static methods interact with object instances that may not be thread safe. What happens to that highway is that all the lanes merge into one, and every car has to go through it... Now your are talking about a singleton -- a whole different ball of wax. When you add synchronized... your 30 lane high way becomes a single lane and its one car at a time... Still in singleton land with the one lane analogy. Syncs do add a huge performance penalty though, so even outside of singletons, syncs should be avoided as much as possible. You dont want to add synchronized because here you have the TC guys gone thru all the hassle of making sure you can have a 30 lane highway... and you bang it into one lane so new is better because each lane gets its own engine... and java is pretty damn good at garbage collecting, that little bit of memory is a blip on the radar screen... You got to really know what your code is doing when its static... you got to know its thread safe, and it can be really hard to see that 30 car pile up coming on the highway ;) My way of thinking about this stuff. mad science - chapter 1 ;) Johnny -- You might find the java language reference an interesting read. It describes all the rules regarding threading, access, value vs reference variables, etc., ... --David - 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: Non-Heap Memory always increasing during deployment for TC 5.5.26/Solaris/JVM 1.5.0_16
From: emerson cargnin [mailto:[EMAIL PROTECTED] Subject: Re: Non-Heap Memory always increasing during deployment for TC 5.5.26/Solaris/JVM 1.5.0_16 Wouldn't it be a problem with the JVM or tomcat and the plataform? No, it's 99.99% likely to be a problem in your app (or 3rd-party libraries your app happens to be using), assuming it's a problem at all. The PermGen doesn't get collected until it really needs to, so unless you're actually running out of non-heap space, it may be that the JVM just hasn't bothered to run a garbage collection on that area yet. You can use a heap profiler to find out what objects are still alive - and therefore what classes - and see if you have some references that should have been cleared but weren't. - 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: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing....
From: Johnny Kewl [mailto:[EMAIL PROTECTED] Subject: Re: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing Sineoa, my feeling is dont use static, unless you really want it in a multithreaded environment It pumps all the threads thru one pipe... That's completely erroneous. There are only two differences between static and instance methods: 1) Static methods are not associated with any particular object instance of the the class (there is no this reference available to a static method). Static methods do have access to instance fields, if the method can obtain a reference to an instance (passed in as a parameter, static variable, etc.). 2) Static methods are not subject to polymorphism - there's no virtual invocation of them. Consequently, a reference to ClassA.method() will always resolve to ClassA.method(), regardless of any super- or sub-classes that ClassA might have. There's no pipe, narrowing highway, or any other throttling or queueing mechanism, nor should there be. Access to static fields, whether it be from static or instance variables must always be examined carefully for proper synchronization. As far as Tomcat being thread-safe, all that means is that Tomcat internals are guaranteed not to confuse things when multiple threads simultaneously call any of the defined servlet APIs, and that Tomcat will dispatch only one thread to handle a given request/response. - 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: Tomcat 6 Manager
When you go into the Tomcat Manager you get a list of running web applications. Then the next section lets you deploy a host directory or local WAR file. It asks for the following information: Context Path (optional): [I have found this is not optional] XML Configuration file URL: [This appears to be optional] WAR or Directory URL:[Here I enter my host directory path] I don't have anything in my server.xml. Just a generic tomcat 6 install. When I enter anything in the Context path that has a 2 tier specification .i.e. xyz/abc I get an error when I try to deploy the host directory. I have been able to deploy a different directory using just xyx. So basically if I have a unix directory called /mywebapps/xyz that has a web application in it. And I want to deploy it using the Tomcat Manager what would I put in for the Context Path. I know that the WAR or Directory should be /mywebapps/xyz. I want the context path to be xyz/abc. However if I put that in the deployment fails. Does this explain it a little better? Thanks, Susan -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2008 9:07 AM To: Tomcat Users List Subject: Re: Tomcat 6 Manager Susan G. Conger wrote: I am trying to use the deployment of a host directory under the tomcat manager. No sure what you mean by deploy a host directory. The context path that I want to use is /webapp/bfc. However whenever I try to deploy the directory it gives me an invalid context path and it fails to deploy. What should I put in the context path to have it deploy to /webapps/bfc? webapps is usually the host's appBase. I am a little confused. A few questions: - what is the full path to your Tomcat installation? - what is your host configuration in server.xml? - what is the full path to the directory you want to deploy? - what url do you want to use to access this web app? 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] - 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 5.5, JNDI Connection Pooling, Active connections keep increasing....
- Original Message - From: David Smith [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Wednesday, September 17, 2008 3:40 PM Subject: Re: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing Comments inline ... Johnny Kewl wrote: So, what exactly does it mean when we say that Tomcat is thread safe for requests. Tomcat creates a new thread for each request, so somehow my static methods are then thread safe (incdirectly, since it is managed by Tomcat). I actually searched all over to try find something for you this looks ok http://www.codestyle.org/java/servlets/faq-Threads.shtml But here my un-scientific way of thinking about it... When tomcat sends a thread into your doGet method... All those local variables in that thread are ok... As long as you mean variables defined inside of the doGet() method. Class instance variables are not cool in servlets. So I think about it as each thread being a lane on a big freeway/highway... But objects are not thread local unless they are setup that way implementing something like ThreadLocal. Only the references to the object are local. No... ouch mention 2 words in a sentence and association kicks in ha ha I'm saying... These local variables are completely private; there is no way for one thread to access the local variables of another thread. Nothing at all to do with ThreadLocal... So yes you right in a way... Tomcat isnt allowing those local method variables to get mixed up... but the second you decalare a static method or static variable... you had better be sure its thread safe. Let's not confuse static methods and static variables. Static variables should be avoided unless they are true constants. Static methods on the other hand are fine, but need to be careful when those static methods interact with object instances that may not be thread safe. All true... but damn hard to see when you plugged into someone elses engine... ... in your own code in a static method, only have to worry about your globals... But someone elses code... not easy... unless they explicitly say thread safe. What happens to that highway is that all the lanes merge into one, and every car has to go through it... Now your are talking about a singleton -- a whole different ball of wax. No... I'm not... its actually your C analogy When you add synchronized... your 30 lane high way becomes a single lane and its one car at a time... Still in singleton land with the one lane analogy. Syncs do add a huge performance penalty though, so even outside of singletons, syncs should be avoided as much as possible. You dont want to add synchronized because here you have the TC guys gone thru all the hassle of making sure you can have a 30 lane highway... and you bang it into one lane so new is better because each lane gets its own engine... and java is pretty damn good at garbage collecting, that little bit of memory is a blip on the radar screen... You got to really know what your code is doing when its static... you got to know its thread safe, and it can be really hard to see that 30 car pile up coming on the highway ;) My way of thinking about this stuff. mad science - chapter 1 ;) Johnny -- You might find the java language reference an interesting read. It describes all the rules regarding threading, access, value vs reference variables, etc., ... Maybe you want to tell us why it is his code is leaking connections? What is it exactly in his code thats jumping a connection? Do you know? - 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 5.5, JNDI Connection Pooling, Active connections keep increasing....
This question about static variables seems a bit deeper than I thought, the more I think about it the more confused I get. I could accept the fact that we should create new objects of Dao's, but for getting a datasource or connection it should make sense to have a utility class with static methods. CollectionBranch branches = new BranchDao().loadBranches( new DBUtil().getDataSource(), // This feels crap, I'd rather use DBUtil.getDataSource() (without new) 1); DBUtil should have static methods for retrieving a datasource or a connection, creating a new DBUtil for each request does not feel right. Well, you say that static methods don't necessarliy improve performance in the long run, but why does the code at the bottom work for others. And what is a thread-safe object: An object whose state cannot be modified So is a connection a thread-safe object or not? It looks like you can modify its state (closing and opening it) Below is a new connection object created, it is therefore not a static class variable, only the method is static. This means that the method should be thread safe, since a new connection object is created for each thread. public static Connection getConnection(){ try { Context context =(Context) new InitialContext().lookup(java:comp/env); DataSource dataSource = (DataSource) context.lookup(jdbc/FooBar); Connection connection = dataSource.getConnection(); return connection; } catch (NamingException namingException) { log.fatal(namingException); throw new RuntimeException(namingException); } catch (SQLException sqlException) { log.fatal(sqlException); throw new RuntimeException(sqlException); } } Date: Wed, 17 Sep 2008 09:40:16 -0400 From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: Re: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing Comments inline ... Johnny Kewl wrote: So, what exactly does it mean when we say that Tomcat is thread safe for requests. Tomcat creates a new thread for each request, so somehow my static methods are then thread safe (incdirectly, since it is managed by Tomcat). I actually searched all over to try find something for you this looks ok http://www.codestyle.org/java/servlets/faq-Threads.shtml But here my un-scientific way of thinking about it... When tomcat sends a thread into your doGet method... All those local variables in that thread are ok... As long as you mean variables defined inside of the doGet() method. Class instance variables are not cool in servlets. So I think about it as each thread being a lane on a big freeway/highway... But objects are not thread local unless they are setup that way implementing something like ThreadLocal. Only the references to the object are local. So yes you right in a way... Tomcat isnt allowing those local method variables to get mixed up... but the second you decalare a static method or static variable... you had better be sure its thread safe. Let's not confuse static methods and static variables. Static variables should be avoided unless they are true constants. Static methods on the other hand are fine, but need to be careful when those static methods interact with object instances that may not be thread safe. What happens to that highway is that all the lanes merge into one, and every car has to go through it... Now your are talking about a singleton -- a whole different ball of wax. When you add synchronized... your 30 lane high way becomes a single lane and its one car at a time... Still in singleton land with the one lane analogy. Syncs do add a huge performance penalty though, so even outside of singletons, syncs should be avoided as much as possible. You dont want to add synchronized because here you have the TC guys gone thru all the hassle of making sure you can have a 30 lane highway... and you bang it into one lane so new is better because each lane gets its own engine... and java is pretty damn good at garbage collecting, that little bit of memory is a blip on the radar screen... You got to really know what your code is doing when its static... you got to know its thread safe, and it can be really hard to see that 30 car pile up coming on the highway ;) My way of thinking about this stuff. mad science - chapter 1 ;) Johnny -- You might find the java language reference an interesting read. It describes all the rules regarding threading, access, value vs reference variables, etc., ... --David - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Discover Bird's Eye View now with Multimap
RE: Balance and sync data
On Tue, 2008-09-16 at 17:59 -0400, Paul McGurn wrote: If you're expecting the size of your image store to grow, or better yet, grow rapidly, you'd be best served to consider a strategy either with mod_proxy/mod_rewrite, or better yet, looking into a CDN (content delivery network) to host the images themselves. Example, I'm about to launch an offering that will allow for our support team to publish video tutorials on how to use our products. It makes absolutely no sense to have a copy of each video file on each front end webserver (we use tomcat as the web server and application container), and it also isn't responsible to deliver a content offering with no redundancy in case of outage/downtime/disaster. Instead, we're leveraging some clever (but very easy) DNS, and Amazon S3 to host the files. By leveraging Amazon, we can link all our content by using a CNAME DNS record, like content.yourname.com , and automatically deliver that content from Amazon. Of course, there are drawbacks. I don't think this method would work in SSL implementations for instance. This link is to the instructions I followed ot deliver content via S3: http://www.carltonbale.com/2007/09/how-to-alias-a-domain-name-or-sub-domain-to-amazon-s3/ Paul McGurn Looks pretty good, but have to check the price for that... Anyway, your videos are uploaded by people of your staff, and then viewed as html for your clients. Here, people upload images, so our server modify those images (resize, format, take off transparencies, etc), so it'll make more traffic from our server to the s3 server. I'll keep the idea in mind, but I don't see it as a solution to use soon in this case. Thanks for the idea anyway Paul, I'll check it out. Cheers Martín - 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 5.5, JNDI Connection Pooling, Active connections keep increasing....
Let's not get testy here -- your post had a lot of errors in it, including your concept of static methods and how they are handled in a threaded environment. This whole discussion is getting very off topic. I'll drop this thread here and respond to the OP on a thread that's still on topic. --David Johnny Kewl wrote: - Original Message - From: David Smith [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Wednesday, September 17, 2008 3:40 PM Subject: Re: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing Comments inline ... Johnny Kewl wrote: So, what exactly does it mean when we say that Tomcat is thread safe for requests. Tomcat creates a new thread for each request, so somehow my static methods are then thread safe (incdirectly, since it is managed by Tomcat). I actually searched all over to try find something for you this looks ok http://www.codestyle.org/java/servlets/faq-Threads.shtml But here my un-scientific way of thinking about it... When tomcat sends a thread into your doGet method... All those local variables in that thread are ok... As long as you mean variables defined inside of the doGet() method. Class instance variables are not cool in servlets. So I think about it as each thread being a lane on a big freeway/highway... But objects are not thread local unless they are setup that way implementing something like ThreadLocal. Only the references to the object are local. No... ouch mention 2 words in a sentence and association kicks in ha ha I'm saying... These local variables are completely private; there is no way for one thread to access the local variables of another thread. Nothing at all to do with ThreadLocal... So yes you right in a way... Tomcat isnt allowing those local method variables to get mixed up... but the second you decalare a static method or static variable... you had better be sure its thread safe. Let's not confuse static methods and static variables. Static variables should be avoided unless they are true constants. Static methods on the other hand are fine, but need to be careful when those static methods interact with object instances that may not be thread safe. All true... but damn hard to see when you plugged into someone elses engine... ... in your own code in a static method, only have to worry about your globals... But someone elses code... not easy... unless they explicitly say thread safe. What happens to that highway is that all the lanes merge into one, and every car has to go through it... Now your are talking about a singleton -- a whole different ball of wax. No... I'm not... its actually your C analogy When you add synchronized... your 30 lane high way becomes a single lane and its one car at a time... Still in singleton land with the one lane analogy. Syncs do add a huge performance penalty though, so even outside of singletons, syncs should be avoided as much as possible. You dont want to add synchronized because here you have the TC guys gone thru all the hassle of making sure you can have a 30 lane highway... and you bang it into one lane so new is better because each lane gets its own engine... and java is pretty damn good at garbage collecting, that little bit of memory is a blip on the radar screen... You got to really know what your code is doing when its static... you got to know its thread safe, and it can be really hard to see that 30 car pile up coming on the highway ;) My way of thinking about this stuff. mad science - chapter 1 ;) Johnny -- You might find the java language reference an interesting read. It describes all the rules regarding threading, access, value vs reference variables, etc., ... Maybe you want to tell us why it is his code is leaking connections? What is it exactly in his code thats jumping a connection? Do you know? - 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: [a little OT] Can I get Millisecond precision in Access Logs?
Ok, so I see that will have to roll my own PreciseAccessLogValve. So how do I integrate with Tomcat? Do i just write my code, jar it and place in the Tomcat's common/lib, and simply reference the classname like I do the built-in accesslogvalve? On Tue, Sep 16, 2008 at 4:40 PM, Mark Thomas [EMAIL PROTECTED] wrote: David Fisher wrote: Mark, Interesting but shouldn't the getDate method be slightly different: if ((systime - currentDate.getTime()) 1000) { In this line if currentDate is at millisecond 900 then the next second starts with the millisec and that is 100 ms later. long cachedtime = currentDate.getTime(); if ((systime - cachedtime 999 - cachedtime%1000) { Yes, I know it is a quibble about what is probably fuzzy logic. But I'm just a guy who learned to typeset using integers in ebcdic at 300 dpi in Fortran and IBM Sys 370 Assembler and this is a classic next pixel problem with proportional width characters at a small font size. You are right this isn't perfect. I'd need to do some performance tests so see how much slower the more correct code is. To be perfectly honest, I can live with the current implementation and don't feel the urge to scratch this particular itch. Of course, that shoudn't stop anyone else who fancies taking a look at this. Patches that improve the implementation without adding much (actually any in this case) overhead welcome. 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: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing....
To get this thread restarted in the right direction, I thought it'd be good to recap a little from your posts so far... I have set the max active connections to 40. My active connections keep increasing, they never seem to return back to the pool, eventhough when no-one is visiting the site. (Well, I have had up to 3 idle connections and that is the most I have ever had) After a few days, the active connections reach to 37, and then afterwards the active connections are reset to 0. It basically starts from 0 to 37 and then again 0 to 37, and so on 3. An idle connection can only be idle for an X amount of time and then it will be removed from the pool and get destroyed 4. An idle connection will become an active connection when it is required and then returned back to the pool as an idle connection when calling connection.close() To comment on #3, there is nothing to force destroy a connection at a set age. It's good until a test of the connection fails and then it's closed. That's what the validationQuery is for. On that note, it's be good to add validationQuery=select 1 to your Resource ... / definition so connections are tested before they get loaned out. That'll prevent problems at the 8 hour mark for MySQL db connections. To comment on #4, I would also expect that which is why it's interesting you see the behavior you do. It's also interesting you see the pool fill even when idle which implies *something* is grabbing a connection and not necessarily closing it properly. Might be time to run a profiler on it and see exactly where pool connections are getting borrowed and returned. --David sinoea kaabi wrote: This question about static variables seems a bit deeper than I thought, the more I think about it the more confused I get. I could accept the fact that we should create new objects of Dao's, but for getting a datasource or connection it should make sense to have a utility class with static methods. CollectionBranch branches = new BranchDao().loadBranches( new DBUtil().getDataSource(), // This feels crap, I'd rather use DBUtil.getDataSource() (without new) 1); DBUtil should have static methods for retrieving a datasource or a connection, creating a new DBUtil for each request does not feel right. Well, you say that static methods don't necessarliy improve performance in the long run, but why does the code at the bottom work for others. And what is a thread-safe object: An object whose state cannot be modified So is a connection a thread-safe object or not? It looks like you can modify its state (closing and opening it) Below is a new connection object created, it is therefore not a static class variable, only the method is static. This means that the method should be thread safe, since a new connection object is created for each thread. public static Connection getConnection(){ try { Context context =(Context) new InitialContext().lookup(java:comp/env); DataSource dataSource = (DataSource) context.lookup(jdbc/FooBar); Connection connection = dataSource.getConnection(); return connection; } catch (NamingException namingException) { log.fatal(namingException); throw new RuntimeException(namingException); } catch (SQLException sqlException) { log.fatal(sqlException); throw new RuntimeException(sqlException); } } Date: Wed, 17 Sep 2008 09:40:16 -0400 From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: Re: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing Comments inline ... Johnny Kewl wrote: So, what exactly does it mean when we say that Tomcat is thread safe for requests. Tomcat creates a new thread for each request, so somehow my static methods are then thread safe (incdirectly, since it is managed by Tomcat). I actually searched all over to try find something for you this looks ok http://www.codestyle.org/java/servlets/faq-Threads.shtml But here my un-scientific way of thinking about it... When tomcat sends a thread into your doGet method... All those local variables in that thread are ok... As long as you mean variables defined inside of the doGet() method. Class instance variables are not cool in servlets. So I think about it as each thread being a lane on a big freeway/highway... But objects are not thread local unless they are setup that way implementing something like ThreadLocal. Only the references to the object are local. So yes you right in a way... Tomcat isnt allowing those local method variables to get mixed up... but the second you decalare a static method or static variable... you had better be sure its thread safe. Let's not confuse static methods and static variables. Static variables should be avoided unless they are true constants.
Re: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing....
- Original Message - From: sinoea kaabi [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Wednesday, September 17, 2008 4:48 PM Subject: RE: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing This question about static variables seems a bit deeper than I thought, the more I think about it the more confused I get. I could accept the fact that we should create new objects of Dao's, but for getting a datasource or connection it should make sense to have a utility class with static methods. CollectionBranch branches = new BranchDao().loadBranches( new DBUtil().getDataSource(), // This feels crap, I'd rather use DBUtil.getDataSource() (without new) 1); DBUtil should have static methods for retrieving a datasource or a connection, creating a new DBUtil for each request does not feel right. Well, you say that static methods don't necessarliy improve performance in the long run, but why does the code at the bottom work for others. And what is a thread-safe object: An object whose state cannot be modified So is a connection a thread-safe object or not? It looks like you can modify its state (closing and opening it) Below is a new connection object created, it is therefore not a static class variable, only the method is static. This means that the method should be thread safe, since a new connection object is created for each thread. public static Connection getConnection(){ try { Context context =(Context) new InitialContext().lookup(java:comp/env); DataSource dataSource = (DataSource) context.lookup(jdbc/FooBar); Connection connection = dataSource.getConnection(); return connection; } catch (NamingException namingException) { log.fatal(namingException); throw new RuntimeException(namingException); } catch (SQLException sqlException) { log.fatal(sqlException); throw new RuntimeException(sqlException); } } sinoea, of course you can... that looks thread safe... but what I'm trying to do, is just make it bullet proof... You leaking connections, we dont know why... so idea is to try take any threading issues out of the equation... Then you run it, it works... you play with the code...add your routines back... find whats causing it... and then you going to tell us why it was leaking thats what we dying to know;) You wont be the first person that stared at a piece of code for 2 days and not seen the threading issue... It can be really hard to spot... If a person gives you a class and says... this is NOT thread safe... what you going to do with it? Thats the thing I'm showing you... David right, I'm no teacher... but I've done it a million times... send me your code, I'll find the problem for you... --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - 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: [a little OT] Can I get Millisecond precision in Access Logs?
valves are configured for the container as seen here for RequestDumperValve just below top-level Catalina BR Valve className=org.apache.catalina.valves.RequestDumperValve/BR info available atBR http://tomcat.apache.org/tomcat-5.5-doc/config/valve.htmlBR HTHBR MartinBR __ BR Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. Date: Wed, 17 Sep 2008 11:24:44 -0400 From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: Re: [a little OT] Can I get Millisecond precision in Access Logs? Ok, so I see that will have to roll my own PreciseAccessLogValve. So how do I integrate with Tomcat? Do i just write my code, jar it and place in the Tomcat's common/lib, and simply reference the classname like I do the built-in accesslogvalve? On Tue, Sep 16, 2008 at 4:40 PM, Mark Thomas [EMAIL PROTECTED] wrote: David Fisher wrote: Mark, Interesting but shouldn't the getDate method be slightly different: if ((systime - currentDate.getTime()) 1000) { In this line if currentDate is at millisecond 900 then the next second starts with the millisec and that is 100 ms later. long cachedtime = currentDate.getTime(); if ((systime - cachedtime 999 - cachedtime%1000) { Yes, I know it is a quibble about what is probably fuzzy logic. But I'm just a guy who learned to typeset using integers in ebcdic at 300 dpi in Fortran and IBM Sys 370 Assembler and this is a classic next pixel problem with proportional width characters at a small font size. You are right this isn't perfect. I'd need to do some performance tests so see how much slower the more correct code is. To be perfectly honest, I can live with the current implementation and don't feel the urge to scratch this particular itch. Of course, that shoudn't stop anyone else who fancies taking a look at this. Patches that improve the implementation without adding much (actually any in this case) overhead welcome. 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] _ See how Windows connects the people, information, and fun that are part of your life. http://clk.atdmt.com/MRT/go/msnnkwxp1020093175mrt/direct/01/
session replication / cluster groups
Hi, I have tomcat clustering working well with an apache load balancer in front (sticky session). I have around 10 at the moment, and I soon need to add at least 20 to 30 more. The configuration for session replication is all-to-all, using multicast. My aim is to reduce the session traffic between servers, so I am looking for alternatives. The Tomcat 6 book (o reilly) states: If you find that you have too many nodes in your cluster for all-to-all replication, you can [..] segment your network such that half of your nodes are in one group and half are in another group (or implement primary/secondary clustering). I assume that segmentation is done by supplying a different multicast ip/port to the two groups, however, how will the apache (mod_proxy) know the right group member to fall to? Regards, K. Phillips
RE: session replication / cluster groups
I believe this segregation is typically done with instances of multiple load balancers. I'm not an expert on the mod_jk stuff, but you'd probably want to implement this with multiple load balancers regardless, when you're getting up to that many instances. Bear in mind that this piece of your setup is acting as a single point of failure in front of your Tomcat cluster. Paul McGurn | Manager, Customer Support Escalations Operations · ·· LogMeIn, Inc. www.LogMeIn.com | [EMAIL PROTECTED] p. +1 781.897.1320 | f. +1 781.897.0632 -Original Message- From: Kevin Phillips [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2008 12:04 PM To: users@tomcat.apache.org Subject: session replication / cluster groups Hi, I have tomcat clustering working well with an apache load balancer in front (sticky session). I have around 10 at the moment, and I soon need to add at least 20 to 30 more. The configuration for session replication is all-to-all, using multicast. My aim is to reduce the session traffic between servers, so I am looking for alternatives. The Tomcat 6 book (o reilly) states: If you find that you have too many nodes in your cluster for all-to-all replication, you can [..] segment your network such that half of your nodes are in one group and half are in another group (or implement primary/secondary clustering). I assume that segmentation is done by supplying a different multicast ip/port to the two groups, however, how will the apache (mod_proxy) know the right group member to fall to? Regards, K. Phillips - 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 5.5, JNDI Connection Pooling, Active connections keep increasing....
- Original Message - From: sinoea kaabi [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Wednesday, September 17, 2008 4:48 PM Subject: RE: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing This question about static variables seems a bit deeper than I thought, the more I think about it the more confused I get. I could accept the fact that we should create new objects of Dao's, but for getting a datasource or connection it should make sense to have a utility class with static methods. CollectionBranch branches = new BranchDao().loadBranches( new DBUtil().getDataSource(), // This feels crap, I'd rather use DBUtil.getDataSource() (without new) 1); DBUtil should have static methods for retrieving a datasource or a connection, creating a new DBUtil for each request does not feel right. -- Are you an ex C programmer Sounds like it... theres a couple strange feeling things in Java... String x = new Thing(); in a loop is something else you see a C programmer wants to stick the declaration outside the loop... so its easy to clean up java nah... that garbage collector is pure magic ;) You get used of it... There is a pretty good threading tut in the famous Java Tutorial... Normal stuff, like race conditions... yada yada... its good reading but when you actually doing it... its a feeling... because its a timing issue. No error message that says anything... just wrong values. --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Migration from Tomcat 4.x to 5.5
Hi all, I need to migrate my web application from tomcat 4.1.29 to tomcat 5.5. I have installed tomcat 5.5 with JDK 1.6 and deployed my web application, its working fine. Tell me what are all the changes need to be done to connect apache 2.0 to tomcat 5.5. Earlier apache 2.0 server was connected to tomcat 4.1.29. In tomcat 4.1.29 server.xml there was the below tag for AJP connector !-- Define an AJP 1.3 Connector on port 8009 -- Connector className=org.apache.ajp.tomcat4.Ajp1.3Connector port=8029 minProcessors=5 maxProcessors=150 acceptCount=10 tomcatAuthentication=false debug=0/ Is there any similar kind of above tag for tomcat 5.5 so that i can enable authentication for my web application. Also tell me wat are all the changes need to be done in mod_jk.conf , workers.properties and httpd.conf files as am migrating to tomcat5.5. Its very urgent. Thanks in advance for ur help. Regards, Arun.
Re: Migration from Tomcat 4.x to 5.5
http://tomcat.apache.org/connectors-doc/ rgds gregor -- what's puzzlin' you, is the nature of my game gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2 gpgp-key available @ http://pgpkeys.pca.dfn.de:11371 - 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: session replication / cluster groups
you could use the BackupManager this only replicates data to one backup node http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-manager.html and you can fail over to any node, it will fetch the backup from the backup node Filip Kevin Phillips wrote: Hi, I have tomcat clustering working well with an apache load balancer in front (sticky session). I have around 10 at the moment, and I soon need to add at least 20 to 30 more. The configuration for session replication is all-to-all, using multicast. My aim is to reduce the session traffic between servers, so I am looking for alternatives. The Tomcat 6 book (o reilly) states: If you find that you have too many nodes in your cluster for all-to-all replication, you can [..] segment your network such that half of your nodes are in one group and half are in another group (or implement primary/secondary clustering). I assume that segmentation is done by supplying a different multicast ip/port to the two groups, however, how will the apache (mod_proxy) know the right group member to fall to? Regards, K. Phillips - 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: [a little OT] Can I get Millisecond precision in Access Logs?
Jonathan Mast wrote: Ok, so I see that will have to roll my own PreciseAccessLogValve. So how do I integrate with Tomcat? Do i just write my code, jar it and place in the Tomcat's common/lib, and simply reference the classname like I do the built-in accesslogvalve? Yep. That's all you need to do. 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: Migration from Tomcat 4.x to 5.5
Arun Raj Ramkumar wrote: Hi all, I need to migrate my web application from tomcat 4.1.29 to tomcat 5.5. I have installed tomcat 5.5 with JDK 1.6 and deployed my web application, its working fine. Tell me what are all the changes need to be done to connect apache 2.0 to tomcat 5.5. Earlier apache 2.0 server was connected to tomcat 4.1.29. In tomcat 4.1.29 server.xml there was the below tag for AJP connector !-- Define an AJP 1.3 Connector on port 8009 -- Connector className=org.apache.ajp.tomcat4.Ajp1.3Connector port=8029 minProcessors=5 maxProcessors=150 acceptCount=10 tomcatAuthentication=false debug=0/ Is there any similar kind of above tag for tomcat 5.5 so that i can enable authentication for my web application. http://tomcat.apache.org/tomcat-5.5-doc/config/ajp.html The sample that comes with 5.5 in server.xml is: Connector port=8009 enableLookups=false redirectPort=8443 protocol=AJP/1.3 / Also tell me wat are all the changes need to be done in mod_jk.conf , workers.properties and httpd.conf files as am migrating to tomcat5.5. None. 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: Migration from Tomcat 4.x to 5.5
Take a look at the server.xml that came with 5.5 and you'll see a similar connector in there. There won't be a className attribute -- instead it'll contain a protocol attribute with the value of AJP/1.3. With regard to authentication, the old tomcatAuthentication=false still exists in version 5.5. With regard to mod_jk, if you have a current version, no changes should be required. If however you have an older version, upgrade to the latest version of mod_jk (currently 1.2.26). Don't go after mod-jk2 as it's a dead release. More details are available at: http://tomcat.apache.org/connectors-doc/ If you were considering using the version 4.1.x server.xml as the tomcat 5.5 server.xml, don't do it. Take a copy of server.xml from 5.5, strip out all the documentation comments, and then modify to provide similar functionality to the tomcat 4.1.x server.xml. --David Arun Raj Ramkumar wrote: Hi all, I need to migrate my web application from tomcat 4.1.29 to tomcat 5.5. I have installed tomcat 5.5 with JDK 1.6 and deployed my web application, its working fine. Tell me what are all the changes need to be done to connect apache 2.0 to tomcat 5.5. Earlier apache 2.0 server was connected to tomcat 4.1.29. In tomcat 4.1.29 server.xml there was the below tag for AJP connector !-- Define an AJP 1.3 Connector on port 8009 -- Connector className=org.apache.ajp.tomcat4.Ajp1.3Connector port=8029 minProcessors=5 maxProcessors=150 acceptCount=10 tomcatAuthentication=false debug=0/ Is there any similar kind of above tag for tomcat 5.5 so that i can enable authentication for my web application. Also tell me wat are all the changes need to be done in mod_jk.conf , workers.properties and httpd.conf files as am migrating to tomcat5.5. Its very urgent. Thanks in advance for ur help. Regards, Arun. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
URLEncoding of \ Character
Verified on 6.0.16 and 6.0.18, 2.6.24 Linux kernel, JVM 1.6.0_10-beta. When I attempt to encode a \ character into a url resulting in a %5C in the URL on the wire, I'm seeing a 400 from the server and none of my code is hit. I've tried URLEncoding=UTF-8 on the connector with no luck. Same URL serves fine on Jetty6. Other encoded, non-URL safe chars seem to work fine. A sample of the URL on the wire looks like: GET /people/s%5Clash I'm hoping someone can tell me I've encoded the URL wrong and that Tomcat is doing the correct thing. Anybody seen similar issues?
Re: URLEncoding of \ Character
Erik Onnen wrote: Verified on 6.0.16 and 6.0.18, 2.6.24 Linux kernel, JVM 1.6.0_10-beta. When I attempt to encode a \ character into a url resulting in a %5C in the URL on the wire, I'm seeing a 400 from the server and none of my code is hit. I've tried URLEncoding=UTF-8 on the connector with no luck. Same URL serves fine on Jetty6. Other encoded, non-URL safe chars seem to work fine. A sample of the URL on the wire looks like: GET /people/s%5Clash I'm hoping someone can tell me I've encoded the URL wrong and that Tomcat is doing the correct thing. Anybody seen similar issues? http://tomcat.apache.org/tomcat-6.0-doc/config/systemprops.html org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH There are potential security issues of enabling this if Tomcat is behind a proxy. See http://tomcat.apache.org/security-6.html CVE-2007-0450 for details. 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]
Problem running Tomcat 6.0.18 on Windows 2k and 2k3 Server
I just upgraded the tomcat I'm using to host my application from 5.x to 6.0.18. Runs great on XP. However, when attempting to start tomcat on 2k or 2k3 server, it just dumps out to the command prompt with no error. Now as far as I can tell, the problem is with the error handling of the setclasspath.bat file. It seems to be returning an error even when it exits correctly. If I comment out the line which exits on a 1 error connection, tomcat starts right up. Anybody have any ideas? Obviously I don't want to leave error checking code commented out. TIA.
RE: URLEncoding of \ Character
U+0244 http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references Martin Gainty __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. Date: Wed, 17 Sep 2008 11:51:53 -0700 From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: URLEncoding of \ Character Verified on 6.0.16 and 6.0.18, 2.6.24 Linux kernel, JVM 1.6.0_10-beta. When I attempt to encode a \ character into a url resulting in a %5C in the URL on the wire, I'm seeing a 400 from the server and none of my code is hit. I've tried URLEncoding=UTF-8 on the connector with no luck. Same URL serves fine on Jetty6. Other encoded, non-URL safe chars seem to work fine. A sample of the URL on the wire looks like: GET /people/s%5Clash I'm hoping someone can tell me I've encoded the URL wrong and that Tomcat is doing the correct thing. Anybody seen similar issues? _ Want to do more with Windows Live? Learn “10 hidden secrets” from Jamie. http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008
Re: URLEncoding of \ Character
- Original Message - From: Erik Onnen [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Wednesday, September 17, 2008 8:51 PM Subject: URLEncoding of \ Character Verified on 6.0.16 and 6.0.18, 2.6.24 Linux kernel, JVM 1.6.0_10-beta. When I attempt to encode a \ character into a url resulting in a %5C in the URL on the wire, I'm seeing a 400 from the server and none of my code is hit. I've tried URLEncoding=UTF-8 on the connector with no luck. Same URL serves fine on Jetty6. Other encoded, non-URL safe chars seem to work fine. A sample of the URL on the wire looks like: GET /people/s%5Clash I'm hoping someone can tell me I've encoded the URL wrong and that Tomcat is doing the correct thing. Anybody seen similar issues?
Re: URLEncoding of \ Character
- Original Message - From: Johnny Kewl To: Tomcat Users List Sent: Wednesday, September 17, 2008 9:26 PM Subject: Re: URLEncoding of \ Character - Original Message - From: Erik Onnen [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Wednesday, September 17, 2008 8:51 PM Subject: URLEncoding of \ Character Verified on 6.0.16 and 6.0.18, 2.6.24 Linux kernel, JVM 1.6.0_10-beta. When I attempt to encode a \ character into a url resulting in a %5C in the URL on the wire, I'm seeing a 400 from the server and none of my code is hit. I've tried URLEncoding=UTF-8 on the connector with no luck. Same URL serves fine on Jetty6. Other encoded, non-URL safe chars seem to work fine. A sample of the URL on the wire looks like: GET /people/s%5Clash I'm hoping someone can tell me I've encoded the URL wrong and that Tomcat is doing the correct thing. Anybody seen similar issues? Would help if I said something in the first post hey ;) Not sure what you up to exactly but %5C is right for \ but \ I thing is probably an illegal servlet or file name, so it cant work If its part of a query... then its because you missing the ? eg: GET /path/script.cgi?field1=value1field2=value%5C2 HTTP/1.0 ... I think --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - 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: apache and tomcat version
Does Tomcat do the same thing as Apache? ie http; as well as the bonus of java? I am using PhP, and would to like to also have Java/AJAX?J2EE on my web page, and I am not sure if I need both Apache and Tomcat, or can just use Tomcat? (I dont know if it will do everything that Apache does plus more?) Thanks Ayden From: Hardik Shah [mailto:[EMAIL PROTECTED] is tomcat 3.2.1 and apache 1.3.27 are both server Tomcat 3.2.1 is a web server. You can use it to serve Web pages or web applications directly. You do not need to use any version of Apache httpd as well. If you want to use Apache httpd as well, you can connect Tomcat to httpd using AJP. It is more difficult to set up the two servers in this way. If possible, I would use a newer version of Tomcat than version 3. - 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: URLEncoding of \ Character
Martin Gainty wrote: U+0244 http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references That format won't work in a URL. 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: URLEncoding of \ Character
Johnny Kewl wrote: Would help if I said something in the first post hey ;) Not sure what you up to exactly but %5C is right for \ but \ I thing is probably an illegal servlet or file name, so it cant work On what basis? The OPs request is completely legal. 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: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing....
Johnny Kewl wrote: So, what exactly does it mean when we say that Tomcat is thread safe for requests. Tomcat creates a new thread for each request, so somehow my static methods are then thread safe (incdirectly, since it is managed by Tomcat). I actually searched all over to try find something for you this looks ok http://www.codestyle.org/java/servlets/faq-Threads.shtml But here my un-scientific way of thinking about it... When tomcat sends a thread into your doGet method... All those local variables in that thread are ok... So I think about it as each thread being a lane on a big freeway/highway... So yes you right in a way... Tomcat isnt allowing those local method variables to get mixed up... but the second you decalare a static method or static variable... you had better be sure its thread safe. What happens to that highway is that all the lanes merge into one, and every car has to go through it... When you add synchronized... your 30 lane high way becomes a single lane and its one car at a time... You dont want to add synchronized because here you have the TC guys gone thru all the hassle of making sure you can have a 30 lane highway... and you bang it into one lane so new is better because each lane gets its own engine... and java is pretty damn good at garbage collecting, that little bit of memory is a blip on the radar screen... You got to really know what your code is doing when its static... you got to know its thread safe, and it can be really hard to see that 30 car pile up coming on the highway ;) My way of thinking about this stuff. mad science - chapter 1 ;) Johnny, you really have your own style of writing, to which we've all gotten used to on this list. But this one was really nice. Very understandable and fun. Thanks. - 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: URLEncoding of \ Character
- Original Message - From: Mark Thomas [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Wednesday, September 17, 2008 10:01 PM Subject: Re: URLEncoding of \ Character Johnny Kewl wrote: Would help if I said something in the first post hey ;) Not sure what you up to exactly but %5C is right for \ but \ I thing is probably an illegal servlet or file name, so it cant work On what basis? The OPs request is completely legal. Mark GET /people/s%5Clash Just looked odd to me GET /people/s\lash You right... but I cant think of a reason to write it like that in the first place Why are you writing it like this? Like a windows path getting mixed with a url... and then why encode it? Doesnt seem strange to you? Ok... works I guess ;) --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - 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 5.5, JNDI Connection Pooling, Active connections keep increasing....
Caldarale, Charles R wrote: That's completely erroneous. Shame, Johnny's story was so nice.. - 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: URLEncoding of \ Character
Thanks Mark, much appreciated. I had no idea the extra system props even existed. On Wed, Sep 17, 2008 at 12:07 PM, Mark Thomas [EMAIL PROTECTED] wrote: Erik Onnen wrote: Verified on 6.0.16 and 6.0.18, 2.6.24 Linux kernel, JVM 1.6.0_10-beta. When I attempt to encode a \ character into a url resulting in a %5C in the URL on the wire, I'm seeing a 400 from the server and none of my code is hit. I've tried URLEncoding=UTF-8 on the connector with no luck. Same URL serves fine on Jetty6. Other encoded, non-URL safe chars seem to work fine. A sample of the URL on the wire looks like: GET /people/s%5Clash I'm hoping someone can tell me I've encoded the URL wrong and that Tomcat is doing the correct thing. Anybody seen similar issues? http://tomcat.apache.org/tomcat-6.0-doc/config/systemprops.html org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH There are potential security issues of enabling this if Tomcat is behind a proxy. See http://tomcat.apache.org/security-6.html CVE-2007-0450 for details. 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: URLEncoding of \ Character
- Original Message - From: Erik Onnen [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Wednesday, September 17, 2008 10:27 PM Subject: Re: URLEncoding of \ Character Thanks Mark, much appreciated. I had no idea the extra system props even existed. On Wed, Sep 17, 2008 at 12:07 PM, Mark Thomas [EMAIL PROTECTED] wrote: Erik Onnen wrote: Verified on 6.0.16 and 6.0.18, 2.6.24 Linux kernel, JVM 1.6.0_10-beta. When I attempt to encode a \ character into a url resulting in a %5C in the URL on the wire, I'm seeing a 400 from the server and none of my code is hit. I've tried URLEncoding=UTF-8 on the connector with no luck. Same URL serves fine on Jetty6. Other encoded, non-URL safe chars seem to work fine. A sample of the URL on the wire looks like: GET /people/s%5Clash Erik... why does this happen? Trying to understand why you end up with this url? Why cant you just turn it into this? /people/s/lash --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Server Maintenance Across Timezones (global)
My company's main webapp is used around the world (Europe, North America, Australia, etc.). We're using Tomcat as our app server and Oracle (10g) for our database. When we want to do an upgrade, that usually involves DDL changes to the database as well as corresponding changes to the webapp which means we have to make our users log out so we can shut down the app, update the DDL and restart the updated webapp. The changes are interdependent. It's all or nothing. This was not a big problem when we were just doing business in the U.S. We'd do upgrades late at night when nobody (or hardly anyone) was using the system. The problem now is that late at night here is middle of the day in other places and downtime in the middle of the day is a real problem. Our customers use our app to run parts of their business so downtime in the middle of the day is very very bad. They understandably don't like telling their customers: I'd like to help you but I need to wait for the Americans to upgrade their systems. I'm not sure how to deal with this. I've been trying to think of a way to use multiple servers and multiple databases but that seems like a synchronization nightmare. Losing data consistency is not an option. I'm sure that plenty of others on this list have had to deal with this problem. Any suggestions? How have others dealt with 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]
Re: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing....
- Original Message - From: sinoea kaabi [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Wednesday, September 17, 2008 9:56 PM Subject: RE: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing Right, I have attached the source code. I have included the whole package with the database classes. Also, I have included the package with three action classes, in reality there are more action classes but it would be a nightmare, and also the database classes are used quiet similarly in other action classes. This is a Struts web application, so action classes are used. = Arrrg not our favorite... should be fun Notice on some database classes where I use the connection in several inner methods: public static void doSomething(datasource) { Connection connection = datasource.getConnection(); try { innerMethod(connection); anotherInnerMethod(connection); } finally { connection.close(); // should be OK to use the connection in inner classes, as the connection gets finally closed. } } private static void innerMethod(connection) { Statetement statement = connection.createStatement(); try { } finally { statement.close(); } } If you spot a problem then FANTASTIC. I have had this problem for years and I really want to solve the problem now. Also, I would be grateful if you could let me know how you design your database classes. = Everything is ours we dont use frameworks = Pools, Persistence... all our own stuff... makes it kind of easy to find problems ;) The whole pattern and usage basically. = KISS... keep it simple stupid ;) = Basic TC MVC patterns... you can read up on them on the web... MVC methodology, not a framework CoreServlets has some nice articles Thanks for putting up with me so far = Hey I'm bored stiff... our banks are still running here... ha ha... = Its almost midnight here... we'll play with it in the morning... looks like you on the same time zone --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - 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: transparent junctino w/ Tomcat
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 André, André Warnier wrote: If those guys at CERN (which must be using multiple Tomcats) ever need a name for a new particle discovered on their brand new Large Hadron Collider.. Maybe charmed junctino or strange junctino. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkjRdI4ACgkQ9CaO5/Lv0PBfUgCbBu5RmOEsrqkRF60/EEVMBJQv rF8Ani7MQAUIpXflHb7jzmPvc0eKOTpf =Chr5 -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: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing....
- Original Message - From: André Warnier [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Wednesday, September 17, 2008 10:18 PM Subject: Re: Tomcat 5.5, JNDI Connection Pooling, Active connections keep increasing Caldarale, Charles R wrote: That's completely erroneous. Shame, Johnny's story was so nice.. I didnt even get to toll booths on the highway... when the threads have to all stop there, thats the global variable, can be dangerous, if you sharing one with oncoming traffic ;) No doubt not a chapter in the University Java Hand Book ;) --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - 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 5.5, JNDI Connection Pooling, Active connections keep increasing....
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sinoea, sinoea kaabi wrote: } finally { results.close(); } } finally { statement.close(); } } finally { connection.close(); } I typically put this all together so I don't have too many try/catch blocks when they're really not required: Connection conn = null; Statement statement = null; ResultSet results = null; try { ... } catch (SQLException ...) { ... } ... other exceptions ... finally { if(null != results) try { results.close(); } catch (SQLException sqle) { ... log exception ... } if(null != statement) try { statement.close(); } catch (SQLException sqle) { ... log exception ... } if(null != connection) try { connection.close(); } catch (SQLException sqle) { ... log exception ... } } Remember that it's important to put try/catch blocks around the close invocations -- and make sure to log any errors you get. Otherwise, a SQLException from closing your connection could mask a more serious exception occurring elsewhere. removeAbandoned=true removeAbandonedTimeout=60 logAbandoned=true You might also want to set: validationQuery=SELECT 1 Are you not seeing any log messages about abandoned connections? logAbandoned should be enabling that. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkjRdsUACgkQ9CaO5/Lv0PDz5QCfXKQp7Koz/OFmEZm68exHTxFV YMAAn2EPmXYtrS+eHFGx39Bp90TX4lOK =8euf -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: Server Maintenance Across Timezones (global)
Hi Bill Yes, we have the same problem and I've been working on ways to improve the situation. Unfortunately, I don't think there is an easy or simple solution - a lot will depend upon your application. As far as the database side of it goes it seems to me that much of it is a question of making the 'live-update' a design requirement for any upgrades. You have to make it possible for the changes to the database to 'co-exist' and then update the live database independently of the application. When the new tables are ready, deploy your new application and (hopefully) go home smiling. We tend to create DDL changes as SQL scripts - test them out on the development systems and then run them on the live site. Some examples make it easier to see what I mean. A 'simple' change might be just adding an extra field with a static default. Obviously easy - you just run the script, it adds the extra field, the old app. doesn't have any knowledge of it. You make sure the script correctly initializes the field. When the update app runs its there. A more complex change is where a new field is required that may need to be derived from existing data. Since this data may be changing on the fly, you have to ensure consistency. The best way I've found for this is to create an 'update' transaction in your ORM code (or whatever you are using) that detects that the DDL state has changed and then runs an ACID initialization of the new field. Once again, the testing of this update is a key part of your release testing strategy. As for tomcat itself its rather going to depend whether you run clustered or not. One method that I've used on unclustered systems is to configure the new system on a server instance on a different IP address on a system fronted by httpd, set up some redirects in httpd and just, as it were, 'hup' from the old instance to the new instance. This requires a DNS change, but any 'old' requests to the old server are redirected to the new server. After about 48 hours you should be able to shut down the old server. However, we were able to catch an 'idle' period - you may not be able to do that and you'd have to ensure that any sessions active on the old server were correctly propagated to the new server. I'd be interested to hear from people who have clustered solutions. Once again I suspect there may be problems with trying to sustain sessions across the upgrades. Regards Alan Chaney Bill Davidson wrote: My company's main webapp is used around the world (Europe, North America, Australia, etc.). We're using Tomcat as our app server and Oracle (10g) for our database. When we want to do an upgrade, that usually involves DDL changes to the database as well as corresponding changes to the webapp which means we have to make our users log out so we can shut down the app, update the DDL and restart the updated webapp. The changes are interdependent. It's all or nothing. This was not a big problem when we were just doing business in the U.S. We'd do upgrades late at night when nobody (or hardly anyone) was using the system. The problem now is that late at night here is middle of the day in other places and downtime in the middle of the day is a real problem. Our customers use our app to run parts of their business so downtime in the middle of the day is very very bad. They understandably don't like telling their customers: I'd like to help you but I need to wait for the Americans to upgrade their systems. I'm not sure how to deal with this. I've been trying to think of a way to use multiple servers and multiple databases but that seems like a synchronization nightmare. Losing data consistency is not an option. I'm sure that plenty of others on this list have had to deal with this problem. Any suggestions? How have others dealt with 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] !DSPAM:48d172ca19921381456296! - 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 5.5, JNDI Connection Pooling, Active connections keep increasing....
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sinoea, Oh, and I always always /always/ set my connection pool size to a fixed size of 1 (yes, a single connection) in development. This can help find places where you are requesting two connections from the pool by a single thread, which exposes you to a deadlock scenario. If you want to test if your logAbandoned logging is working, here's a simple JSP that will leak a connection for you ;) - -chris !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; [EMAIL PROTECTED] language=Java isErrorPage=false import= java.sql.*, java.util.*, java.io.PrintWriter, javax.naming.Context, javax.naming.InitialContext, javax.naming.NamingException, javax.sql.DataSource % %! /** * Gets a JDBC connection. This implementation uses JNDI to obtain a * connection. Feel free to substitute your own. */ Connection getConnection() throws SQLException, javax.naming.NamingException { Context ctx = new InitialContext(); DataSource ds = (DataSource)ctx.lookup((your JNDI name)); if(null == ds) throw new NamingException(Cannot obtain DataSource); return ds.getConnection(); } % % Connection conn = getConnection(); % html body pGot connection: %= conn %/p pNow, I refuse to give it away!/p /body /html -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkjReDoACgkQ9CaO5/Lv0PC/FwCfZPybusC0jzBeKYoD93xMyTbI 3XUAn1HUJWUjrfoZipIVXubV7MqPYPB/ =qfKA -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: 回复: 回复: 回复: about Co nnector's attribute redirectPort
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 李征, 李征 wrote: thank u so much for explaining the quesion so clearly. i think i understand how redirect works now. and in my case, i think apache handles all the ssl process, and redirectPort is not necessary. redirectPort might still be necessary, but you need to set it to the port that Apache httpd uses to provide SSL services (probably 443). - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkjReMgACgkQ9CaO5/Lv0PAruQCgm6w+YC6U1boM9RIyukH/HeQ+ hFYAn3k+GBs9Fge2vumImF/HFyX2qgRL =WNPD -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: Server Maintenance Across Timezones (global)
I think the ideal approach here (potentially) is segregating your customer base. Here's an idea directly from how Salesforce.com does it. Segregate, geographically, your customer base's target infrastructure. The way they do this is by tying their customers to a specific cluster of their cloud, and then everything that customer does in the application is tied back to that cluster. The layer of redundancy (on top of being a cluster of course), is having a hot failover infrastructure that is synched with the production infrastructure at whatever feasible cycle works for the amount of data. By doing this, they can then schedule maintenance windows geographically, to ensure that impact is low no matter where the customer is. In your case, this would likely require some effort in architecting the data storage part of things to be partition-able to some extent, but this would really be maintaining what would be the effect of multiple datacenters/clusters/clouds. The only alternative I can personally offer is ensuring that the intended webapp upgrade is backwards compatible, and that the intended database upgrade is backwards/forwards compatible, so you can roll them separately (which would probably be more of a challenge than geo-separate environments). Paul McGurn -Original Message- From: Bill Davidson [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2008 5:06 PM To: Tomcat Users List Subject: Server Maintenance Across Timezones (global) My company's main webapp is used around the world (Europe, North America, Australia, etc.). We're using Tomcat as our app server and Oracle (10g) for our database. When we want to do an upgrade, that usually involves DDL changes to the database as well as corresponding changes to the webapp which means we have to make our users log out so we can shut down the app, update the DDL and restart the updated webapp. The changes are interdependent. It's all or nothing. This was not a big problem when we were just doing business in the U.S. We'd do upgrades late at night when nobody (or hardly anyone) was using the system. The problem now is that late at night here is middle of the day in other places and downtime in the middle of the day is a real problem. Our customers use our app to run parts of their business so downtime in the middle of the day is very very bad. They understandably don't like telling their customers: I'd like to help you but I need to wait for the Americans to upgrade their systems. I'm not sure how to deal with this. I've been trying to think of a way to use multiple servers and multiple databases but that seems like a synchronization nightmare. Losing data consistency is not an option. I'm sure that plenty of others on this list have had to deal with this problem. Any suggestions? How have others dealt with 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]
Problem with JSP Compilation
I have a webapp which uses Struts 2's taglib and Tomcat 5.5.23 with Java 1.5. I am not using precompiled JSP pages. Whenever I try to access a JSP page containing a struts 2 tag, the following exception is thrown: org.apache.jasper.JasperException: /default/login.jsp(37,0) File /struts-tags not found org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88) org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:340) org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:373) org.apache.jasper.compiler.Parser.parseDirective(Parser.java:485) org.apache.jasper.compiler.Parser.parseElements(Parser.java:1557) org.apache.jasper.compiler.Parser.parse(Parser.java:127) org.apache.jasper.compiler.ParserController.doParse(ParserController.java:212) org.apache.jasper.compiler.ParserController.parse(ParserController.java:101) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:156) org.apache.jasper.compiler.Compiler.compile(Compiler.java:296) org.apache.jasper.compiler.Compiler.compile(Compiler.java:277) org.apache.jasper.compiler.Compiler.compile(Compiler.java:265) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:299) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) My JSP page is quite simple: %@ page language=java % %@ taglib uri=/struts-tags prefix=s % %@ page import=org.springframework.security.ui.webapp.AuthenticationProcessingFilter % %@ page import=org.springframework.security.ui.AbstractProcessingFilter % %@ page import=org.springframework.security.AuthenticationException % html xmlns=http://www.w3.org/1999/xhtml; lang=en body s:form action=SubmitAction theme=simple Name: s:textfield name=userName / s:submit / /s:form /body /html All of the struts 2 JAR files are located in the WEB-INF/lib directory (including struts2-core which contains the appropriate tld file for the /struts-tag library). Is there anything that I need to configure to make Tomcat manually compile each JSP page? Or does anyone have any troubleshooting suggestions? Thanks, David -- View this message in context: http://www.nabble.com/Problem-with-JSP-Compilation-tp19541813p19541813.html 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: disable caching of static files in tomcat 5.5
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Joerg, Joerg Endrullis wrote: $ ln -s x.jpg a.jpg; $ wget http://localhost:8180/a.jpg?time=0; $ rm a.jpg; $ ln -s y.jpg a.jpg; $ wget http://localhost:8180/a.jpg?time=1 My brain hurts. How about: $ wget -O t0.jpg http://localhost:8180/a.jpg?time=0 $ wget -O t1.jpg http://localhost:8180/a.jpg?time=1 ...and then compare the two. You will see that both downloaded images a.jpg.1 and a.jpg.2 are equal to x.jpg, Er, where did a.jpg.1 and a.jpg.2 come from? I think you are confusing yourself with the symlinks, wget, etc. even if Tomcat does have a problem. Simplifying your process will surely help. Is a.jpg changing on the server at some point? You say this is a static resource, but you never specified that you were changing the remote file at all. When/how does that happen? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkjRey0ACgkQ9CaO5/Lv0PAUvgCgi7ziGeHwW9LMGocay39egavO a4gAoLX5EmwTEcKbZnwK+bXOUl4nzEB+ =mdAN -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: apache and tomcat version
[EMAIL PROTECTED] wrote: Does Tomcat do the same thing as Apache? ie http; as well as the bonus of java? I am using PhP, and would to like to also have Java/AJAX?J2EE on my web page, and I am not sure if I need both Apache and Tomcat, or can just use Tomcat? (I dont know if it will do everything that Apache does plus more?) Ayden, the way your question is asked, it is not certain that using Tomcat would really bring you any advantage. Can you explain what you mean exactly by have Java/AJAX?J2EE on my web page ? What do you want to achieve ? To give you a quick overview : Both Apache and Tomcat are free and open source software; they are both developed by volonteers, who do this for fun (and sometimes hubris). They are both impressive, powerful pieces of software, and are both used by thousands of websites. Both Apache and Tomcat can act as webservers, to serve static html pages, images and other documents. Both Apache and Tomcat can deliver to your browser html pages containing Java applets, which are small Java programs which run in your browser and on your web page. But the way Apache and Tomcat work inside is very different, and their configurations are also very different (*). Tomcat can run applications written in Java, on the server side (that's where J2EE lives); Apache cannot do that. On the other hand, there are many things that Apache can do easily, which are a lot more complicated to do with Tomcat. For example processing PHP instructions embedded in html pages on the server side, or running perl cgi-bin scripts. Apache and Tomcat can also work together and split the work between them, but you have to add and configure a connector for that. Both have a good user support list, this one for Tomcat and [EMAIL PROTECTED] for Apache. The people on both are very helpful, even to beginners. But the ones on this list sometimes have a tendency to be a bit elitist (talking about classes all the time) and sometimes obscure (contexts, objects, factories, etc.. ). Ajax has not much to do with either Apache or Tomcat. It is javascript code that runs in the browser, not on the server. But you can use html pages with Ajax stuff with both Tomcat and Apache, from that point of view it's the same. (*) For example, Apache has basically one configuration file, written as plain text; Tomcat has many configuration files all over the place, and they are written in XML. For example also, it takes 2 lines to create a couple of Apache logfiles, and what is in them is usually quite clear; in Tomcat, it takes .. many lines to create a logfile; you gets lots of them, but what is in them is more difficult to read. - 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: Balance and sync data
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hassan, Hassan Schroeder wrote: On Tue, Sep 16, 2008 at 6:38 AM, Martin Spinassi [EMAIL PROTECTED] wrote: I don't know yet, I didn't try it yet, I was waiting to see if there is a better solution than rsync them every minute. Why not have your upload servlet invoke rsync when a new file has been stored? You're not seriously suggesting that as a viable production strategy, are you? NFS, baby. NFS. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkjRfUoACgkQ9CaO5/Lv0PA8zgCfRxagWpEeQPkbw+xaa91v+PST 6hEAn0WfeA4rT9k2RN5bjFq9Gij+nCFJ =7TnM -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: Problem with JSP Compilation
is your struts-tag.tld in \WEB-INF\classes is your struts2-dojo-plugin-2.1.2.jar in \WEB-INF\lib ? Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. Date: Wed, 17 Sep 2008 14:46:35 -0700 From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: Problem with JSP Compilation I have a webapp which uses Struts 2's taglib and Tomcat 5.5.23 with Java 1.5. I am not using precompiled JSP pages. Whenever I try to access a JSP page containing a struts 2 tag, the following exception is thrown: org.apache.jasper.JasperException: /default/login.jsp(37,0) File /struts-tags not found org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88) org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:340) org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:373) org.apache.jasper.compiler.Parser.parseDirective(Parser.java:485) org.apache.jasper.compiler.Parser.parseElements(Parser.java:1557) org.apache.jasper.compiler.Parser.parse(Parser.java:127) org.apache.jasper.compiler.ParserController.doParse(ParserController.java:212) org.apache.jasper.compiler.ParserController.parse(ParserController.java:101) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:156) org.apache.jasper.compiler.Compiler.compile(Compiler.java:296) org.apache.jasper.compiler.Compiler.compile(Compiler.java:277) org.apache.jasper.compiler.Compiler.compile(Compiler.java:265) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:299) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) My JSP page is quite simple: %@ page language=java % %@ taglib uri=/struts-tags prefix=s % %@ page import=org.springframework.security.ui.webapp.AuthenticationProcessingFilter % %@ page import=org.springframework.security.ui.AbstractProcessingFilter % %@ page import=org.springframework.security.AuthenticationException % html xmlns=http://www.w3.org/1999/xhtml; lang=en body s:form action=SubmitAction theme=simple Name: s:textfield name=userName / s:submit / /s:form /body /html All of the struts 2 JAR files are located in the WEB-INF/lib directory (including struts2-core which contains the appropriate tld file for the /struts-tag library). Is there anything that I need to configure to make Tomcat manually compile each JSP page? Or does anyone have any troubleshooting suggestions? Thanks, David -- View this message in context: http://www.nabble.com/Problem-with-JSP-Compilation-tp19541813p19541813.html 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] _ See how Windows Mobile brings your life together—at home, work, or on the go. http://clk.atdmt.com/MRT/go/msnnkwxp1020093182mrt/direct/01/
Re: Server Maintenance Across Timezones (global)
I get around my the same kinds of problems by keeping all the layers of the web app seperate so that i can swap them out one at a time and create a near seemless upgrade. The layers in my web apps are: 1 The web interface. 2. The application logic. (this may itself be several layers in itself if the app is complicated) 3. The database access layer. 4. The database. The key in your case is in the database access layer. The database access layer should be programmed to read either database format and write to the new one (filling in defaults/placeholders where necessary). All you need to do then is setup the structure for the new database on a new server (can use the server for testing while your at it). Drop in the new database backend. Do the rest of the data migration in the background safe in the knowledge that your webapp is still able to do whatever it needs with the old data and is already sending data to your new database aswell. The frontend can then be changed whenever (if at all). The key to any seemless upgrade is layers in the same way that redundency provides layers for server downtime. Hope what i said is useful. John5342 2008/9/17 Bill Davidson [EMAIL PROTECTED] My company's main webapp is used around the world (Europe, North America, Australia, etc.). We're using Tomcat as our app server and Oracle (10g) for our database. When we want to do an upgrade, that usually involves DDL changes to the database as well as corresponding changes to the webapp which means we have to make our users log out so we can shut down the app, update the DDL and restart the updated webapp. The changes are interdependent. It's all or nothing. This was not a big problem when we were just doing business in the U.S. We'd do upgrades late at night when nobody (or hardly anyone) was using the system. The problem now is that late at night here is middle of the day in other places and downtime in the middle of the day is a real problem. Our customers use our app to run parts of their business so downtime in the middle of the day is very very bad. They understandably don't like telling their customers: I'd like to help you but I need to wait for the Americans to upgrade their systems. I'm not sure how to deal with this. I've been trying to think of a way to use multiple servers and multiple databases but that seems like a synchronization nightmare. Losing data consistency is not an option. I'm sure that plenty of others on this list have had to deal with this problem. Any suggestions? How have others dealt with 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]
Re: Balance and sync data
On Wed, Sep 17, 2008 at 2:57 PM, Christopher Schultz [EMAIL PROTECTED] wrote: Why not have your upload servlet invoke rsync when a new file has been stored? You're not seriously suggesting that as a viable production strategy, are you? [ IM IN UR DURECTRY COPYNG UR IMAGES ] Sure -- why not? It works nicely for a use case like this. And exec'ing a process as needed beats spawning one every minute! NFS, baby. NFS. Um, single point of failure? :-) -- Hassan Schroeder [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: Server Maintenance Across Timezones (global)
Paul McGurn wrote: Segregate, geographically, your customer base's target infrastructure. The way they do this is by tying their customers to a specific cluster of their cloud, and then everything that customer does in the application is tied back to that cluster. The layer of redundancy (on top of being a cluster of course), is having a hot failover infrastructure that is synched with the production infrastructure at whatever feasible cycle works for the amount of data. By doing this, they can then schedule maintenance windows geographically, to ensure that impact is low no matter where the customer is. Indeed. In your case, this would likely require some effort in architecting the data storage part of things to be partition-able to some extent, but this would really be maintaining what would be the effect of multiple datacenters/clusters/clouds. The main difficulty with this is consistency. Many parts of our data are tagged with dynamically generated id's (order id's for example) that are printed out and referenced by our customers, and even their customers. Running on multiple databases allows for the possibility (at this point certainty) of generating duplicate ids across different regions. This could result in a lot of confusion, particularly for support calls. We may need to learn to live with that but I still am not crazy about it. This may be the only reasonable way to do this without completely re-architecting our app (which is not really doable any time soon). - 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: Server Maintenance Across Timezones (global)
Easy solution to that one: Make order ID's GUIDs (globally unique identifiers). Most platforms allow for this, so I presume that Java is one of them. This could also be achieved by adding another element to the order ID generation as well. For instance, if your order ID was comprised of a few letters and the data, you could multiply the numeric part by a random number, or something to that effect. The only hole in that though is pre-existing data, but realistically, if you don't already have duplicates, it should not be a problem. The problem would arise if you have any dependency in the application on how the ID if formatted. If that's your only concern, you're doing good so far! Paul McGurn -Original Message- From: Bill Davidson [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2008 6:45 PM To: Tomcat Users List Subject: Re: Server Maintenance Across Timezones (global) Paul McGurn wrote: Segregate, geographically, your customer base's target infrastructure. The way they do this is by tying their customers to a specific cluster of their cloud, and then everything that customer does in the application is tied back to that cluster. The layer of redundancy (on top of being a cluster of course), is having a hot failover infrastructure that is synched with the production infrastructure at whatever feasible cycle works for the amount of data. By doing this, they can then schedule maintenance windows geographically, to ensure that impact is low no matter where the customer is. Indeed. In your case, this would likely require some effort in architecting the data storage part of things to be partition-able to some extent, but this would really be maintaining what would be the effect of multiple datacenters/clusters/clouds. The main difficulty with this is consistency. Many parts of our data are tagged with dynamically generated id's (order id's for example) that are printed out and referenced by our customers, and even their customers. Running on multiple databases allows for the possibility (at this point certainty) of generating duplicate ids across different regions. This could result in a lot of confusion, particularly for support calls. We may need to learn to live with that but I still am not crazy about it. This may be the only reasonable way to do this without completely re-architecting our app (which is not really doable any time soon). - 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: apache and tomcat version
What I want to run on my webpage is AJAX push via icefaces.org opensource code (asynchronous, web-based push of presentation changes to the client browser based on server-side events) to do this I believe I need NIO (I think NIO is also referred to as APACHE MINA project or another name I have seen but cannot find info on is 'Comet') I would also like a Blogger like WordPress or Apache ROLLER So I am unsure if I need Apache, Tomcat or both? Many Thanks, Ayden [EMAIL PROTECTED] wrote: Does Tomcat do the same thing as Apache? ie http; as well as the bonus of java? I am using PhP, and would to like to also have Java/AJAX?J2EE on my web page, and I am not sure if I need both Apache and Tomcat, or can just use Tomcat? (I dont know if it will do everything that Apache does plus more?) Ayden, the way your question is asked, it is not certain that using Tomcat would really bring you any advantage. Can you explain what you mean exactly by have Java/AJAX?J2EE on my web page ? What do you want to achieve ? To give you a quick overview : Both Apache and Tomcat are free and open source software; they are both developed by volonteers, who do this for fun (and sometimes hubris). They are both impressive, powerful pieces of software, and are both used by thousands of websites. Both Apache and Tomcat can act as webservers, to serve static html pages, images and other documents. Both Apache and Tomcat can deliver to your browser html pages containing Java applets, which are small Java programs which run in your browser and on your web page. But the way Apache and Tomcat work inside is very different, and their configurations are also very different (*). Tomcat can run applications written in Java, on the server side (that's where J2EE lives); Apache cannot do that. On the other hand, there are many things that Apache can do easily, which are a lot more complicated to do with Tomcat. For example processing PHP instructions embedded in html pages on the server side, or running perl cgi-bin scripts. Apache and Tomcat can also work together and split the work between them, but you have to add and configure a connector for that. Both have a good user support list, this one for Tomcat and [EMAIL PROTECTED] for Apache. The people on both are very helpful, even to beginners. But the ones on this list sometimes have a tendency to be a bit elitist (talking about classes all the time) and sometimes obscure (contexts, objects, factories, etc.. ). Ajax has not much to do with either Apache or Tomcat. It is javascript code that runs in the browser, not on the server. But you can use html pages with Ajax stuff with both Tomcat and Apache, from that point of view it's the same. (*) For example, Apache has basically one configuration file, written as plain text; Tomcat has many configuration files all over the place, and they are written in XML. For example also, it takes 2 lines to create a couple of Apache logfiles, and what is in them is usually quite clear; in Tomcat, it takes .. many lines to create a logfile; you gets lots of them, but what is in them is more difficult to read. - 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: Server Maintenance Across Timezones (global)
John5342 wrote: I get around my the same kinds of problems by keeping all the layers of the web app seperate so that i can swap them out one at a time and create a near seemless upgrade. The layers in my web apps are: 1 The web interface. 2. The application logic. (this may itself be several layers in itself if the app is complicated) 3. The database access layer. 4. The database. [...] Hope what i said is useful. I think it will be useful when we get to the point of redesigning the app from scratch. It's a bit tough to replace the data access layer of a large complex app that's been around for a long time though. - 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: Server Maintenance Across Timezones (global)
I think it will be useful when we get to the point of redesigning the app from scratch. It's a bit tough to replace the data access layer of a large complex app that's been around for a long time though. It is indeed difficult to change a long standing app but in the long run its a better approach. Definately something for the next major overhaul. I use the same design principals on all of my web apps. Even on my own custom written servers (non http). I am currently in my 7th year of continuous uptime with on average 10 structural app changes every month and i have to do that on 64 servers. Trust me when i say the technique works and is well worth investing the time to setup. Building the initial framework for it is a pain but once its up and running then its well worth it and you will never look back. 2008/9/18 Bill Davidson [EMAIL PROTECTED] John5342 wrote: I get around my the same kinds of problems by keeping all the layers of the web app seperate so that i can swap them out one at a time and create a near seemless upgrade. The layers in my web apps are: 1 The web interface. 2. The application logic. (this may itself be several layers in itself if the app is complicated) 3. The database access layer. 4. The database. [...] Hope what i said is useful. I think it will be useful when we get to the point of redesigning the app from scratch. It's a bit tough to replace the data access layer of a large complex app that's been around for a long time though. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Deploying a Java Web Application on / folder
Hello, I am trying to deploy a java Web application on Tomcat Server. This is part of my server.xml file Host name=anotherheadsets.com appBase=/home/anotherheadsets/public_html unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Aliaswww.anotherheadsets.com/Alias Context path= reloadable=true docBase=/home/anotherheadsets/public_html / Context path=/manager docBase=/usr/local/tomcat/users/anotherheadsets/tomcat/webapps/manager privileged=true antiResourceLocking=false antiJARLocking=false reloadable=true / /Host When I am deploying my application as ProjectOne.war on tomcat, the application works fine when I use the url http://www.anotherheadsets.com/ProjectOne But when I am using the url http://www.anotherheadsets.com the application doesn't seem to work properly... How do I deploy my application on the home URL rather than a subdirectory... What modifications do I need to make to config files. Thank you in advance. Kris -- View this message in context: http://www.nabble.com/Deploying-a-Java-Web-Application-on---folder-tp19543430p19543430.html 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: Deploying a Java Web Application on / folder
deploy your application as root.war http://tomcat.apache.org/tomcat-5.5-doc/virtual-hosting-howto.html Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. Date: Wed, 17 Sep 2008 16:45:28 -0700 From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: Deploying a Java Web Application on / folder Hello, I am trying to deploy a java Web application on Tomcat Server. This is part of my server.xml file Host name=anotherheadsets.com appBase=/home/anotherheadsets/public_html unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Aliaswww.anotherheadsets.com/Alias Context path= reloadable=true docBase=/home/anotherheadsets/public_html / Context path=/manager docBase=/usr/local/tomcat/users/anotherheadsets/tomcat/webapps/manager privileged=true antiResourceLocking=false antiJARLocking=false reloadable=true / /Host When I am deploying my application as ProjectOne.war on tomcat, the application works fine when I use the url http://www.anotherheadsets.com/ProjectOne But when I am using the url http://www.anotherheadsets.com the application doesn't seem to work properly... How do I deploy my application on the home URL rather than a subdirectory... What modifications do I need to make to config files. Thank you in advance. Kris -- View this message in context: http://www.nabble.com/Deploying-a-Java-Web-Application-on---folder-tp19543430p19543430.html 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] _ See how Windows Mobile brings your life together—at home, work, or on the go. http://clk.atdmt.com/MRT/go/msnnkwxp1020093182mrt/direct/01/
Tomcat/apache - JDBC errors w/ jt400.jar?
Hi, I am newbie - pardon any lack of details or etiquite on my first post! We are trying to get our website to run correctly on a RHEL5.2 Linux server and getting errors with the JDBC - IBM AS400 ODBC connection. SEVERE: Servlet /wsidr threw load() exception java.lang.NoClassDefFoundError: com/ibm/as400/access/DirectoryEntryList at java.lang.Class.getDeclaredConstructors0(Native Method) ERROR LOADING CALENDAR: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.ibm.as400.access.AS400JDBCDriver' SQL error: Cannot load JDBC driver class 'com.ibm.as400.access.AS400JDBCDriver' JAVA: [EMAIL PROTECTED] root]# java -version java version 1.5.0_15 Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_15-b04) Java HotSpot(TM) Client VM (build 1.5.0_15-b04, mixed mode, sharing) HTTP: [EMAIL PROTECTED] root]# apachectl -v Server version: Apache/2.0.46 Server built: Jun 19 2008 11:46:47 APACHE-Tomat: Tomcat 5.5.26 We have our jt400.jar in our classpath var within our webapps dir and in common/lib. /usr/local/tomcat5/common/lib/jt400.jar But, when we copy the jt400.jar file to this dir - it locks tomcat and the apache/tomcat connection locks and we have to killall java to shutdown! WE have compiled a mod_jk tha apache accepts and we can server up *.jsp's from our website but don;t have issues until we add the jt400.jar file? WE have tried multiple versions of the jt400.jar file with no luck... Our server.xml appears to be configured correctly. Haven't messed with the web.xml or any other config files. Do we need to add a workers.properties file to the Apache httpd conf? We configured older versions of tomcat/apache along time ago that worked with mod_jk + workers.properties, etc. Do we need to use jk2 or something else now? Any ideas or need more details? TIA -P -- View this message in context: http://www.nabble.com/Tomcat-apache---JDBC-errors-w--jt400.jar--tp19544738p19544738.html 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: Deploying a Java Web Application on / folder
You'll get better mileage as; ROOT.war - case sensitivity tends to matter for this sort of thing. -- Stephen Souness Martin Gainty wrote: deploy your application as root.war http://tomcat.apache.org/tomcat-5.5-doc/virtual-hosting-howto.html Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. Date: Wed, 17 Sep 2008 16:45:28 -0700 From: [EMAIL PROTECTED] To: users@tomcat.apache.org Subject: Deploying a Java Web Application on / folder Hello, I am trying to deploy a java Web application on Tomcat Server. This is part of my server.xml file Host name=anotherheadsets.com appBase=/home/anotherheadsets/public_html unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Aliaswww.anotherheadsets.com/Alias Context path= reloadable=true docBase=/home/anotherheadsets/public_html / Context path=/manager docBase=/usr/local/tomcat/users/anotherheadsets/tomcat/webapps/manager privileged=true antiResourceLocking=false antiJARLocking=false reloadable=true / /Host When I am deploying my application as ProjectOne.war on tomcat, the application works fine when I use the url http://www.anotherheadsets.com/ProjectOne But when I am using the url http://www.anotherheadsets.com the application doesn't seem to work properly... How do I deploy my application on the home URL rather than a subdirectory... What modifications do I need to make to config files. Thank you in advance. Kris -- View this message in context: http://www.nabble.com/Deploying-a-Java-Web-Application-on---folder-tp19543430p19543430.html 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] _ See how Windows Mobile brings your life together—at home, work, or on the go. http://clk.atdmt.com/MRT/go/msnnkwxp1020093182mrt/direct/01/ - 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 5.5, JNDI Connection Pooling, Active connections keepincreasing....
From: sinoea kaabi [mailto:[EMAIL PROTECTED] Subject: RE: Tomcat 5.5, JNDI Connection Pooling, Active connections keepincreasing I could accept the fact that we should create new objects of Dao's, but for getting a datasource or connection it should make sense to have a utility class with static methods. Absolutely - Johnny K's suggestion of doing a new every time is utter nonsense. So is a connection a thread-safe object or not? No, a connection is not thread-safe: it is designed to be be used by only one thread at a time. If you have multiple threads accessing a connection object *simultaneously*, you will have problems. On the other hand, connection managers (e.g., the commons-dbcp code) are thread-safe; multiple threads may call one simultaneously to acquire connection objects, and each thread is guaranteed to be given a separate object. - 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: Dual-Independent Tomcat servers, on Single Win32 host sharing IIS server.
André , I tried your suggestion, and it still did not work. On Wed, Aug 20, 2008 at 12:10 PM, André Warnier [EMAIL PROTECTED] wrote: dOE wrote: I tried to do the following, and it did not work. worker.list=ajp13w worker.ajp13w.type=ajp13 worker.ajp13w.host=192.168.0.1 worker.ajp13w.port=8009 worker.list=ajp13w2 worker.ajp13w2.type=ajp13 worker.ajp13w2.host=192.168.0.2 worker.ajp13w2.port=8109 Maybe you just need to do worker.list=ajp13w,ajp13w2 worker.ajp13w.type=ajp13 worker.ajp13w.host=192.168.0.1 worker.ajp13w.port=8009 worker.ajp13w2.type=ajp13 worker.ajp13w2.host=192.168.0.2 worker.ajp13w2.port=8109 André - 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: Dual-Independent Tomcat servers, on Single Win32 host sharing IIS server.
I can not upgrade to 1.2.26, this is for an application and its certified' for 1.2.8...so I am forced to work with this older version. On Wed, Aug 20, 2008 at 4:48 PM, Rainer Jung [EMAIL PROTECTED]wrote: First before trying to find the right configuration, upgrade! Version 1.2.8 is s old and whatever hints you get on how to use the redirector, you'd always need to find out, which of those are true for 1.2.8. We are at 1.2.26, just use that version. André Warnier schrieb: dOE wrote: I tried to do the following, and it did not work. worker.list=ajp13w worker.ajp13w.type=ajp13 worker.ajp13w.host=192.168.0.1 worker.ajp13w.port=8009 worker.list=ajp13w2 worker.ajp13w2.type=ajp13 worker.ajp13w2.host=192.168.0.2 worker.ajp13w2.port=8109 Maybe you just need to do worker.list=ajp13w,ajp13w2 No, all properties which take multiple values can be split into multiple lines. This often makes writing a modular config file more easy. We join those lines during reading them. Regards, Rainer - 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: Dual-Independent Tomcat servers, on Single Win32 host sharing IIS server.
The interface for this host has multiple IP's bound to it. The IP's I posted in this thread are the addresses to the sites in IIS. Doesn't the worker have to pointed to the site (via IP) its intended for? The ports (server.xml) for both Tomcat instances are unique 8009 and 8109. On Wed, Aug 20, 2008 at 12:18 PM, Johnny Kewl [EMAIL PROTECTED] wrote: - Original Message - From: dOE [EMAIL PROTECTED] To: Tomcat User-List users@tomcat.apache.org Sent: Wednesday, August 20, 2008 5:10 PM Subject: Dual-Independent Tomcat servers, on Single Win32 host sharing IIS server. Hello, Can anyone guide me in the right direction with my issue. Windows Server 2003, IIS 6.0, tomcat-connector 1.2.8, and Tomcat 5.0.16. I have been tasked to do the following. To get two separate Tomcat server instances running on the same host independent of each other and working off of the same IIS server (compliments of the Tomcat-Connector, and ISAPI-Filter). Getting the two servers up and running together is the easy part, and has already been achieved. They both have unique ports, and IP addresses from each other.. MY issue is the isapi filter. The workers.properties.minimal uses 8009 for ajp13, and 'localhost' worker.list=ajp13w worker.ajp13w.type=ajp13 worker.ajp13w.host=localhost worker.ajp13w.port=8009 There has to be some information out there that will guide you to create a custom workers.properties.minimal file. One of my two Tomcat servers has port 8009 assigned, and the other is using port 8109. I am assuming that I was correct on thinking this port needed to be unique from the other Tomcat server on the host? I tried to do the following, and it did not work. worker.list=ajp13w OUT worker.list=ajp13w,ajp13w2 worker.ajp13w.type=ajp13 worker.ajp13w.host=192.168.0.1 OUT worker.ajp13w.host=localhost worker.ajp13w.port=8009 worker.list=ajp13w2 OUT worker.ajp13w2.type=ajp13 worker.ajp13w2.host=192.168.0.2 OUT worker.ajp13w.host=localhost worker.ajp13w2.port=8109 ..and then in my uriworker.properties file /servlets-examples/*=ajp13w /jsp-examples/*=ajp13w2 I thought this would work, but clearly I am looking at this from the wrong angle. The systems are both on localhost... you said same machine... it can only have one IP Thats ok as long as you rightly said... the ports are different... If you using the machine in an org with no DNS... then the name of the machine will also work worker.ajp13w.host=MyMachineName But assigning actual IP's can be tricky especially if you have a DHCP server running... something that assigned IP's to machines... most MS systems do.. I think thats it... with a little play --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - 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: Deploying a Java Web Application on / folder
From: krisrks [mailto:[EMAIL PROTECTED] Subject: Deploying a Java Web Application on / folder I am trying to deploy a java Web application on Tomcat Server. Should we guess which version of Tomcat you're using, or would you deign to tell us? Host name=anotherheadsets.com appBase=/home/anotherheadsets/public_html unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false Aliaswww.anotherheadsets.com/Alias Context path= reloadable=true docBase=/home/anotherheadsets/public_html / Context path=/manager docBase=/usr/local/tomcat/users/anotherheadsets/tomcat/webapp s/manager privileged=true antiResourceLocking=false antiJARLocking=false reloadable=true / /Host You have one basic error: the appBase and docBase settings for a webapp must *never* be the same; erratic behavior is guaranteed. If you're using any reasonably recent version of Tomcat, you should not be putting Context elements in server.xml - really bad practice. As previously stated in this thread, the default webapp should be named ROOT, placed under the appBase directory specified in the Host element (if you're running on Tomcat 5.0 or above). For your situation, no Context element is needed for your webapp. - 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: Tomcat/apache - JDBC errors w/ jt400.jar?
From: pichels [mailto:[EMAIL PROTECTED] Subject: Tomcat/apache - JDBC errors w/ jt400.jar? We have our jt400.jar in our classpath var within our webapps dir and in common/lib. Never, ever, use a CLASSPATH environment variable with Tomcat. Your jt400.jar must not be in two places at once; put it in either the webapp's WEB-INF/lib directory OR in common/lib, but not both. (WEB-INF/lib is preferred.) Do we need to use jk2 or something else now? The jk2 connector died several years ago, as noted in the Tomcat doc. Get things working with direct Tomcat access first, then worry about hooking Tomcat up to httpd, if that's really necessary at all. (Unless you're using httpd for load balancing or something like PHP, it will only worsen performance with modern versions of Tomcat.) - 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: Tomcat Cluster Deployer
OK, I successfully deployed this in our test environment. Could you point me toward the general guidelines for properly creating documentation in the acceptable format? I'll start by documenting the existing cluster example that includes the farm section and work from there. Paul McGurn -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 16, 2008 4:02 PM To: Tomcat Users List Subject: Re: Tomcat Cluster Deployer Paul McGurn wrote: Thanks Mark. I'll work at actually translating this into real documentation and examples. As far as patching, I'm not qualified to do that, but I'd be willing to take a crack at it if there's a list of bugs/wishlist items for it. Sounds great. I don't recall any open bugs - check bugzilla. I'm sure you'll find some when you test it. Crate bugzilla entries as you find them and add patches where you can. Also, if you create a bugzilla entry for any doc changes I'll make sure they get applied. Note all the source for the docs is in xml not html. Mark Paul McGurn -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 16, 2008 3:50 PM To: Tomcat Users List Subject: Re: Tomcat Cluster Deployer Paul McGurn wrote: Is there any (complete) documentation on the Cluster Deployer? The official documentation doesn't actually say anything about it (or let alone anything useful at all...): http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-deployer.html The source code is probably your best bet. See http://svn.apache.org/repos/asf/tomcat/trunk/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java As far as I am aware, it isn't production ready. As always, patches are welcome. 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] - 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]