Re: Problems running pre-compiled JSP classes when in subdirectories
The generated servlets are not put in a package. When Tomcat is compiling JSP it is put in org.apache.jsp. How to set this in the jspc task. The files are generated as usual in the work directory in the same structure as Tomcat itself compiles JSP files. Not entirely true. You can compile the java sources of the JSP's yourself. I do it and it prevents the delay (for Tomcat to compile it) when you first execute a JSP. You also pick up any possible JSP errors when building, not after deployment. You can also specify *any* package, it doesn't have to be org.apache.jsp... I eg use com.myapp.jsp The Tomcat HOW-TO documentation has a good example of the complete process. Jasper 2 JSP Engine How To, option Web Application Compilation. I followed it exactly and mine works 100%. The main difference from what you guys explain (I think), is that I do not only generate java sources for the jsp's, but also compile them (my jsp's are thus delivered as .class files) and also include the servlet mappings in the web.xml. Its all very easy to do with ant. Antony Paul - Original Message - From: Ralph Einfeldt [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 7:06 PM Subject: RE: Problems running pre-compiled JSP classes when in subdirectories May be you should have a look at the following: - the package statements in the generated source files - the file structure of the generate class files -Original Message- From: Jay Glanville [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 2:20 PM To: 'Tomcat Users List' Subject: Problems running pre-compiled JSP classes when in subdirectories Here's my application's background. I have two files: WEBROOT/index.jsp WEBROOT/dir/index.jsp java.lang.NoClassDefFoundError: org/apache/jsp/index_jsp (wrong name: org/apache/jsp/dir/index_jsp) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:537) at java.lang.ClassLoader.defineClass(ClassLoader.java:448) at - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat stops handling HTTP connections, socket is SYN_RECV
On Wed, Jan 07, 2004 at 21:00:30 +0100, Antonio Fiol Bonnín wrote: I have not read through all the thread, so maybe I am repeating something. If so, sorry about being lazy. You seem to be hitting maxProcessors. If you do, no more threads are created, and connections start getting into SYN_RECV state, simply because Tomcat is not accept()ing them, exactly as you told it to do. So, either reduce your concurrency level for the tests, or increase maxProcessors. Actually, I don't think I'm hitting maxProcessors - usually when that happens, you only get an error message about no more threads being available in the pool. Here, the issue is that Java is unable to create a new native thread and therefore throws an OutOfMemoryError. So the problem is that even after the tests are complete and there are no active connections at all, it's no longer possible to connect. I think perhaps the OutOfMemoryError causes whatever thread is accept()ing new http connections to die. - Frode - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with embedded Tomcat and JSP compilation.
Hi, I wrote an application running an embedded Tomcat, based on the sample code of the onJava site (an org.apache.catalina.startup.Embedded class with manual configuration of things usually found in server.xml). I use Tomcat 4.1.27 and Java 1.3.1. Tomcat starts well, but is not able to compile JSP page. It displays the following error: code org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 4 in the jsp file: /index.jsp Generated servlet error: [javac] Compiling 1 source file C:\test\tomcat\work\_\localhost\_\index_jsp.java:3: package javax.servlet does not exist import javax.servlet.*; ^ ... /code and so on for all import statements. It looks like a classpath problem, but I set the classpath with all the jar files in tomcat/common/lib, in tomcat/server/lib, in tomcat/common/endorsed, bootstrap.jar, the tools.jar of java. I set it in the environment CLASSPATH variable and in the classpath of the jar of my application. And the classpath is set, because if not, Tomcat cannot be launched. So I probably missed something, but what? Below you can see the code of my class and the code of the main function: code of class EmbeddedTomcat import org.apache.catalina.Connector; import org.apache.catalina.Context; import org.apache.catalina.Deployer; import org.apache.catalina.Engine; import org.apache.catalina.Host; import org.apache.catalina.logger.SystemOutLogger; import org.apache.catalina.startup.Embedded; import org.apache.catalina.Container; public class EmbeddedTomcat { private String path = null; private Embedded embedded = null; private Host host = null; public EmbeddedTomcat() { } public void setPath( String path) { this.path = path; } public String getPath() { return( path); } public void startTomcat() throws Exception { Engine engine = null; Context context = null; System.setProperty( catalina.home, getPath()); System.setProperty( catalina.base, getPath()); embedded = new Embedded(); embedded.setDebug( 0); embedded.setLogger( new SystemOutLogger()); engine = embedded.createEngine(); engine.setDefaultHost( localhost); host = embedded.createHost( localhost, webapps); engine.addChild( host); context = embedded.createContext( , c:/test/root); host.addChild( context); embedded.addEngine( engine); Connector connector = embedded.createConnector( null, 8080, false); embedded.addConnector( connector); embedded.start(); } public void stopTomcat() throws Exception { embedded.stop(); } } /code code in main function of my application EmbeddedTomcat tomcat = new EmbeddedTomcat(); tomcat.setPath( m_config.getString( tomcat.home)); try { tomcat.startTomcat(); } catch( Exception error) { logger.fatal( Unable to start tomcat., error); return; } /code - NetCourrier, votre bureau virtuel sur Internet : Mail, Agenda, Clubs, Toolbar... Web/Wap : www.netcourrier.com Téléphone/Fax : 08 92 69 00 21 (0,34 TTC/min) Minitel: 3615 NETCOURRIER (0,16 TTC/min) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
japanese download filename
Hello, (B (BI've got a servlet that allows users to download files. I'm specifying (Bthe filename using the Content-Disposition header, and the charset using (Bthe Content-Type header. It all works lovely when the filename is English (B- but not with Japanese. (B (BI got the following to work with the latest version of IE: (B (B encodeFileName = URLEncoder.encode(fileName, "UTF-8"); (B response.setContentType("application/octet-stream"); // ie doesn't (Bseem to need the charset if it's utf-8 (B response.setHeader("Content-Disposition", "attachment; filename=\"" (B+ encodeFileName + "\""); (B (BThis, however, does not work with Netscape, nor does it work with older (Bversions of IE (the name displays as escaped unicode). (BI need to support NE and IE (recent versions) on both Windows and Mac. (B (BI played around with the headers for Netscape and tried everything I could (Bthink of, to no avail. (BI then used a packet sniffer to checkout the headers from a different (Bapplication (PHP based) (Bthat works properly with Netscape - but even after I managed to get the (Bheaders for Content-Type AND Content-Disposition (Bto match, it still didn't work (the action name shows up instead of the (Bjapanese file name). (B (BHere are the settings I used to get the headers to match - the file name (Bencoding matches byte for byte with the PHP app: (B encodeFileName = new String(fileName.getBytes("Shift_JIS"), (B"ISO-8859-1"); (B response.setContentType("application/octet-stream; charset=Shift_JIS"); (B response.setHeader("Content-Disposition", "filename=" (B+ encodeFileName); (B (Bfor a file name PC$B4IM}(B.xls I get a filename=PC\212\307\227\235.xls in the (Bheader, which looks good to me. (B (BHere are the (relevant) headers from the PHP app, which works fine (it's (Bclosed source, so no luck there): (BContent-Disposition: filename=PC\212\307\227\235.xls\r\n (BContent-Type: application/octet-stream; charset=Shift_JIS\r\n (B (B (B (BI'm at a total loss. I've tried every charset, leaving OUT the charset, (Bsurrounding the filename in quotes, standing on my head... I stumbled (Bacross this tomcat bug (B(http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24380) but the header (Bencoding appears to be coming out ok. I tried tomcat 4.0.6 for the hell (Bof it but that, of course, did not work either. (B (BIs it possible that NS is ignoring the specified charset, and trying to (Bget it from the data stream? (BIf the headers are a match, what else could be happening? Are there other (Bheaders besides Content-Type and Content-Disposition that I should be (Bworrying about? (B (BOne (slightly) strange thing is that my packet sniffer seems to (Bautomatically recognize the PHP app's packets at HTTP, but not the servlet (Bapp's packets (have to click the "decode as html" button). (B (BAny help, ideas, suggestions, or prayers would be most welcome. (B (BThanks in advance, (BDave (B (B (B-- (B (BADiRECT Corporation $B%"%G%#%l%/%H3t<02q.EAGOD.(B12$BHV(B8$B9f!!(B (BTEL $B!'(B03-5651-5700 $B!!(BFAX$B!'(B03-5651-5566 (BURL http://www.adirect.jp (B (B--PR $B!zJ*N.Hq:o8:$r$*9M$($J$i!V%"%G%#%l%/%H(B e3PL $B%*%Z%l!<%7%g%s%;%s%?! $B$/[EMAIL PROTECTED](B (Bhttp://www.adirect.jp/logistics $B!z1?DB!&5wN%7W;;$,B.$$!"4JC1!*!VEE;RA49q2_J*<+F0 H/GdCf(B $B!*(B (Bhttp://www.adirect.jp/kilotei (B (B- (BTo unsubscribe, e-mail: [EMAIL PROTECTED] (BFor additional commands, e-mail: [EMAIL PROTECTED]
Re: Custom-Principal
Hi, thanx. You did answer the question. But I didn´t know how to realize what you suggested for the embedded version of Tomcat into JBoss. I didn´t even find the server.xml. Any idea about it? Best regards anis - Original Message - From: Shapira, Yoav [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 2:58 PM Subject: RE: Custom-Principal Howdy, Hmm, I could swear I've read and answered this exact message, maybe a few weeks ago. Or maybe I'm dreaming. Anyways, you need a custom Realm implementation, probably a simple extension of one of the existing Realms (see the Realm how-to and server.xml for discussion and examples). This realm will create your custom principal object. Yoav Shapira Millennium ChemInformatics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 8:39 AM To: Tomcat Users List Subject: Custom-Principal Importance: High Hi, I am using JBoss 3.2.3 with embedded Tomcat 4. I am developping a secure web-application based on JAAS. The problem is that I want to use my own custom Principal. I made the necessary changes in JBoss and EJBContext.getUserprincopal delivers the right Implementation. But when I call request.getUserprincipal() in my servlet, I get don´t !! Why doesn´t tomcat use the defined custom Principal? How to set this? Please help as soon as possible !!! Best regards anis This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
criteria for a session
Hi, what are the criteria for tomcat 4.1.26 to say the session is null (((HttpServletRequest)request).getSession(false))? It seams to depend on something in the request. When i open a second new IE Window, not a child from the first IE Window, the session is null. I dontt call session.invalidate() and the timeout is not reached. I know that there are only two reasons for invalidate a session. 1) session.invalidate(); 2) session timeout I thought these where the only reasons. Thanks for your help Günter
RE: criteria for a session
3) Request contains no session id (URL/Cookie) 4) Request contains invalid session id (URL/Cookie) Have a look at - isRequestedSessionIdFromCookie - isRequestedSessionIdFromUrl - isRequestedSessionIdValid - getRequestedSessionId in HttpServletRequest to find out if the request contains a session id and if it belongs to the same session as the first window. -Original Message- From: Günter Kukies [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 9:52 AM To: [EMAIL PROTECTED] Subject: criteria for a session what are the criteria for tomcat 4.1.26 to say the session is null (((HttpServletRequest)request).getSession(false))? It seams to depend on something in the request. When i open a second new IE Window, not a child from the first IE Window, the session is null. I dontt call session.invalidate() and the timeout is not reached. I know that there are only two reasons for invalidate a session. 1) session.invalidate(); 2) session timeout I thought these where the only reasons. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RES: Off-topic - Java and X11 Window Server
1/ is Tomcat running on the same host with X? YES! If not, change $DISPLAY to that_host:0.0 2/ is X running on said host? YES! 3/ is X on said host set to accept connections? I guess its not necessary, since they are at the same host... isnt it? Jose Euclides Junior Projeto DOP201 Infra-estrutura J2EE para as aplicacoes corporativas da Previdencia Social -Mensagem original- De: QM [mailto:[EMAIL PROTECTED] Enviada em: quarta-feira, 7 de janeiro de 2004 16:33 Para: Tomcat Users List Assunto: Re: Off-topic - Java and X11 Window Server : Have anybody ever seen this error before? The X11 seems to be alive at my : environment -- Conectiva Linux. The target Java app,GraficoBig, works with : a free package, called org.jfree.char and org.jfree.gui. : : 500 Internal Server Error : java.lang.InternalError: Can't connect to X11 window server using ':0.0' as : the value of the DISPLAY variable. 1/ is Tomcat running on the same host with X? If not, change $DISPLAY to that_host:0.0 2/ is X running on said host? 3/ is X on said host set to accept connections? -QM -- software -- http://www.brandxdev.net (C++ / Java / SSL) tech news -- http://www.RoarNetworX.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RES: Off-topic - Java and X11 Window Server
Dear Patrick, Where (and HOW ) should i set it? Thanks in advance, José Euclides Junior Projeto DOP201 Infra-estrutura J2EE para as aplicações corporativas da Previdência Social -Mensagem original- De: Patrick Willart [mailto:[EMAIL PROTECTED] Enviada em: quarta-feira, 7 de janeiro de 2004 16:51 Para: Tomcat Users List Assunto: RE: Off-topic - Java and X11 Window Server I am not an expert on any *nix system, but faced the same problem once. I had to set to DISPLAY varirable to :1.0 (export DISPLAY=:1.0). It is important that this is set for the same user that is running Tomcat. grts, Patrick -Original Message- From: Jose Euclides da Silva Junior - DATAPREVRJ [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 10:55 AM To: '[EMAIL PROTECTED]' Subject: Off-topic - Java and X11 Window Server Hi guys, Have anybody ever seen this error before? The X11 seems to be alive at my environment -- Conectiva Linux. The target Java app,GraficoBig, works with a free package, called org.jfree.char and org.jfree.gui. 500 Internal Server Error java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable. at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method) at sun.awt.X11GraphicsEnvironment.clinit(X11GraphicsEnvironment.java:54) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:115) at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment .java:53) at java.awt.Window.init(Window.java:183) at java.awt.Frame.init(Frame.java:310) at java.awt.Frame.init(Frame.java:289) at javax.swing.JFrame.init(JFrame.java:167) at org.jfree.ui.ApplicationFrame.init(Unknown Source) at mypackage2.GraficoBig.init(GraficoBig.java:26) at _Jspbig._jspService(_Jspbig.java:128) [SRC:Jspbig.jsp:118] regards, José Euclides Junior Projeto DOP201 Infra-estrutura J2EE para as aplicações corporativas da Previdência Social - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat maximum heap size on Linux
It's not a system roof, we use around 200Mb on average and under high load we use around 700Mb with maximum heap set to 900Mb. Also it's not tomcat using the RAM but the JVM, and yes the jvm can use a gig of ram and even more. One more thing, use this jsp code to monitor the JVM's heap usage. %@ page language=java % %@ page session=false % % long free = java.lang.Runtime.getRuntime().freeMemory(); long total = java.lang.Runtime.getRuntime().totalMemory(); long availableProc = java.lang.Runtime.getRuntime().availableProcessors(); long threadCount = java.lang.Thread.activeCount(); long used = total - free; out.print(total + , + used); % Thanks Daniel Mindaugas Genutis wrote: I expect to use it a few hundred Megabytes. It was quickly increasing in my eyes and stopped on 150Mb. Looks like its the system roof. Could it be so? Howdy, If it doesn't need more than 150MB, it won't use more than 150MB... Are you blindly playing around with heap numbers, or did you actually determine 1GB was required to handle your max expected load? Yoav Shapira Millennium ChemInformatics -Original Message- From: Mindaugas Genutis [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 2:37 PM To: Tomcat Users List Subject: Tomcat maximum heap size on Linux I wanted to increase Tomcat's maximum heap size. I did it by putting the following string in the catalina.sh file (I'm running RedHat Linux): CATALINA_OPTS=-Djava.awt.headless=true -Xmx1024m So, Tomcat can use 1Gb of my RAM. However, I'm observing Tomcat's usage with top under Linux and it stops growing at 150Mb. Looks like this option doesn't work. Where else could I increase it? I'm using JDK 1.4.2, Tomcat 4.1.24 -- Kaunas Regional Distance Education Center Programmer Phone: +370 674 05232 WWW: http://distance.ktu.lt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5 standalone on Linux 2.6
David Rees wrote: On Wed, January 7, 2004 1at 1:54 am, Remy Maucherat wrote: Does anyone have stability issues on this platform (without any LD_ASSUME_KERNEL, and with Sun JDK 1.4.2 or similar very recent VM) ? I'm trying to compare with Redhat 9 and see if the troubles also happen with that (cleaner) platform. Bonus question: How's the performance / scalability ? I've been running Linux kernels 2.6.0 on a couple of very lightly loaded Tomcat servers without any issues. This is running on Fedora Core 1 and JDK 1.4.2_01-b06 (which reminds me, I should upgrade that machine to the latest JDK, 1.4.2_03-b02). No LD_ASSUME_KERNEL env vars set. I also have a Redhat 7.3 with kernel 2.6.0 server running Tomcat with JDK 1.4.2_02-b03 with no problems, but again it's a development server so no real load. I haven't done any performance / scalability tests but theoretically it should be a lot better than 2.4 kernels. This was a bonus question :) I was wondering if Tomcat 5 (or 4.1.29, it's basically the same for the connector) had the same issues than on Redhat 9 (with Redhat kernels) and therefore needed a LD_ASSUME_KERNEL. The Redhat issue occurs regardless of the load, so your answer clears this :) Thanks ! BTW, I'm not sure what platform you really mean by Linux 2.6 as that isn't a specific platform, but any Linux distribution running a 2.6 kernel. Yes, that was the question. -- x Rémy Maucherat Senior Developer Consultant JBoss Group (Europe) SàRL x - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Static ints being cached
Hi All, I have an interface containing public final static ints. My servlets reference these ints when making database inserts. Yesterday I reordered the values of the ints and noticed that old values were still being placed into the database. I guess this was somehow a caching problem. I deleted the .class from Tomcat to ensure a recompile would place a new .class and restarted Tomcat, but old values still went in the database! - If I output the static ints from a JSP the new values come out. - If I output the static ints from a class the old values come out. - If I force the class using the interface to recompile, then the class starts using the new values It seems that somehow references are being stored by Tomcat somewhere since a restart does not work but I don't know much about this. I would like to trust that when I change values that Tomcat is able to pick these up, at the very least on a restart!! I don't want to go through recompiling my whole app. I am using Ant in a multi-developer environment to compile and it compiles only classes that have changed. I cannot recompile the whole app everytime I change constant values. Help and understanding appreciated ... Cheers, ADC FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Static ints being cached
On Thu, Jan 08, 2004 at 09:53:14 -, Allistair Crossley wrote: Hi All, I have an interface containing public final static ints. My servlets reference these ints when making database inserts. Yesterday I reordered the values of the ints and noticed that old values were still being placed into the database. I guess this was somehow a caching problem. I deleted the .class from Tomcat to ensure a recompile would place a new .class and restarted Tomcat, but old values still went in the database! - If I output the static ints from a JSP the new values come out. - If I output the static ints from a class the old values come out. - If I force the class using the interface to recompile, then the class starts using the new values It seems that somehow references are being stored by Tomcat somewhere since a restart does not work but I don't know much about this. I would like to trust that when I change values that Tomcat is able to pick these up, at the very least on a restart!! I don't want to go through recompiling my whole app. I am using Ant in a multi-developer environment to compile and it compiles only classes that have changed. I cannot recompile the whole app everytime I change constant values. Help and understanding appreciated ... The values of static final ints are copied into classes referring to those as an optimization by the java compiler. So if you have class A with some public static final ints in, and a class B referencing these values, you will need to recompile class B if you change class A. Or you need to make them non-final, so that java will actually look at the current values in class A every time. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Static ints being cached
Hi I cannot recompile the whole app everytime I change constant values. This is the problem. public final static ints are not referenced by the compiler but placed inside the class files as constants as far as I know. Therefor, the value is in every class file which uses those. After all, this is NO issue of tomcat, this is an issue of the java compiler. cu Steffen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Static ints being cached
OK, thanks. ADC -Original Message- From: Frode E. Moe [mailto:[EMAIL PROTECTED] Sent: 08 January 2004 09:57 To: Tomcat Users List Subject: Re: Static ints being cached On Thu, Jan 08, 2004 at 09:53:14 -, Allistair Crossley wrote: Hi All, I have an interface containing public final static ints. My servlets reference these ints when making database inserts. Yesterday I reordered the values of the ints and noticed that old values were still being placed into the database. I guess this was somehow a caching problem. I deleted the .class from Tomcat to ensure a recompile would place a new .class and restarted Tomcat, but old values still went in the database! - If I output the static ints from a JSP the new values come out. - If I output the static ints from a class the old values come out. - If I force the class using the interface to recompile, then the class starts using the new values It seems that somehow references are being stored by Tomcat somewhere since a restart does not work but I don't know much about this. I would like to trust that when I change values that Tomcat is able to pick these up, at the very least on a restart!! I don't want to go through recompiling my whole app. I am using Ant in a multi-developer environment to compile and it compiles only classes that have changed. I cannot recompile the whole app everytime I change constant values. Help and understanding appreciated ... The values of static final ints are copied into classes referring to those as an optimization by the java compiler. So if you have class A with some public static final ints in, and a class B referencing these values, you will need to recompile class B if you change class A. Or you need to make them non-final, so that java will actually look at the current values in class A every time. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Forms Authentication
snip I want to have a login link and a logout link.snip snip how do you tell j_security_check where to go once the user has logged in successfully. snip If your application requires the click here to login functionality, where would the user expect to go after logging in? If it's to a generic welcome/login confirmation page then could you not have that page in a protected url? (set up in web.xml) When the user clicks on the Login link they will get your login page based on the url and only successful users will go to the welcome/login confirmation page Are you storing other user specific info in cookies that can be used to determine their post-login destination? If so you could make the welcome page a JSP/servlet that is smart. If you can do anything programmatic involving j_security_check let me know, I've asked a couple of times about this myself. Best regards Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat OutOfMemory at 158MB - Not reclaiming any memory overnight
Hi, The other day Tomcat threw an OutOfMemoryException. This is our development version of Tomcat. Looking at the Windows processes revealed Tomcat at 158MB. I could not tell you whether that is a good or bad statistic for a 2 man development Tomcat that uses database pooling to SQL Server, Struts and a Content Management System. I don't consider what we are doing to be overly complicated. However, when we get to lauch to 300 people, I am a little nervous that we will hit OutOfMemory within seconds. Our Tomcat 5 loads itself by default at around 30MB. When the first hit to the web application goes in it leaps by 2-3 MB. Then each subsequent request seems to cost about 50-100K for just moving around. There are not many session objects being stored. The memory increases all the time and very rarely drops. Last night when we left it stood at 70MB and coming in this morning it was still 70MB. Would anyone be kind enough to provide some tips on how to analyse this problem or what it might be even with the view to a 300 user burdon being placed on Tomcat. Is Tomcat even supposed to be able to handle 300 users? Are there any good sources of information on the web relating to tuning Tomcat or its performance - I have looked around but could not find anything definitive. Many thanks for your time, ADC FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT
RE: criteria for a session
I thought sessions were essentially browser sessions. For anything I've done that requires knowledge of user state between different browsers (but same machine) I've used cookies to save some form of user id. I did turn on the Tomcat setting for persistent sessions and found that preserved session in the same browser with a Tomcat reboot. I guess you could serialise sessions to a DB and retrieve from user id in a cookie - or am I losing the plot now? Best regards Chris what are the criteria for tomcat 4.1.26 to say the session is null (((HttpServletRequest)request).getSession(false))? It seams to depend on something in the request. When i open a second new IE Window, not a child from the first IE Window, the session is null. I dontt call session.invalidate() and the timeout is not reached. I know that there are only two reasons for invalidate a session. 1) session.invalidate(); 2) session timeout I thought these where the only reasons. Thanks for your help Günter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat OutOfMemory at 158MB - Not reclaiming any memory overnight
-Original Message- The other day Tomcat threw an OutOfMemoryException. This is our development version of Tomcat. Looking at the Windows processes revealed Tomcat at 158MB. Let me do some divination. You are using a SUN Jvm, with no Xms nor Xmx parameter. So, the memory allocated to your applications is 64MB (default). 158 is a good value reflecting the size of the VM plus the size allocated to your applications. If your application needs more memory, try to path -Xmx=128m -Xms=128m to your startup scripts. Hope this helps, François (Oraculum). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Squid with ESI + Tomcat
Hi all I'm trying to use squid as a reverse proxy in front of Tomcat and to make things more complicated squid is compiled with ESI enabled :-) I've allready convinced squid-tomcat dou to process basic esi example but squid doesn't cache anything. I suspect that it's because of http headers that Tomcat by default adds to each response. I tried similar configuration with Apache and everything works promising ;-) So the question is how to remove Pragma, Cache-control and Expires http headers? -- Regards Konrad - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
installing tomcat 5 on Linux
Hi What are the steps for installing tomcat 5 on Linux I have don ethese Installed JDK untared everything from the Tomcat5 installation file to a tomcat5 directory set the JAVA_HOME and CATALINA_HOME when i give the command sh $CATALINA_HOME/bin/startup.sh the following messages getting Using CATALINA_BASE: /var/tomcat5 Using CATALINA_HOME: /var/tomcat5 Using CATALINA_TMPDIR: /var/tomcat5/temp Using JAVA_HOME: /usr/java/j2sdk1.4.2_03 but http://siteaddress:8080 is not giving the homepage what could be the problem? How can I run tomcat as root? thanks in advance Prince - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 5 is not generating IOException when connection closes
I have a servlet with a persistent connection open to a client (browser), and when the browser is closed or the user hits the stop button, the connection is closed, but the servlet isn't throwing the IOException when it should do it. (i guess) As i could notice, after about 8k of data being written to the client after the connection has been closed, the serlet gets the IOException. I think that perhaps tomcat is buffering the data and only when this buffer is full the IOException is thrown, even when we make a explicit call to out.flush(). The strange thing is that when the connection is open, the client receives data in real time, with no buffering or very little buffering. Has anyone ever had this problem? I tried to call the method response.setBufferSize(0), but it didn't work. Below is the piece of code that writes the data to the ServletOutputStream. ServletOutputStream out = response.getOutputStream(); public void send(String s) throws IOException { out.write(s.getBytes(), 0, s.length()); out.flush(); } thanks in advance, Paulo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
TEST
TEST - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat OutOfMemory at 158MB - Not reclaiming any memory overn ight
In my opnion, is better instead of increasing memory of tomcat JVM try to profile your application. I´m sure if tomcat complain about memory, your servlets have something wrong. -- De: Francois JEANMOUGIN[SMTP:[EMAIL PROTECTED] Responder:Tomcat Users List Enviada: quinta-feira, 8 de janeiro de 2004 7:31 Para: Tomcat Users List Assunto: RE: Tomcat OutOfMemory at 158MB - Not reclaiming any memory overnight -Original Message- The other day Tomcat threw an OutOfMemoryException. This is our development version of Tomcat. Looking at the Windows processes revealed Tomcat at 158MB. Let me do some divination. You are using a SUN Jvm, with no Xms nor Xmx parameter. So, the memory allocated to your applications is 64MB (default). 158 is a good value reflecting the size of the VM plus the size allocated to your applications. If your application needs more memory, try to path -Xmx=128m -Xms=128m to your startup scripts. Hope this helps, François (Oraculum). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat OutOfMemory at 158MB - Not reclaiming any memory overnight
Yes I would like to profile my applicationbut do you have any tips on how to do this or where to start? Thanks -Original Message- From: Edson Alves Pereira [mailto:[EMAIL PROTECTED] Sent: 08 January 2004 12:49 To: 'Tomcat Users List' Subject: RE: Tomcat OutOfMemory at 158MB - Not reclaiming any memory overnight In my opnion, is better instead of increasing memory of tomcat JVM try to profile your application. I´m sure if tomcat complain about memory, your servlets have something wrong. -- De: Francois JEANMOUGIN[SMTP:[EMAIL PROTECTED] Responder:Tomcat Users List Enviada: quinta-feira, 8 de janeiro de 2004 7:31 Para: Tomcat Users List Assunto: RE: Tomcat OutOfMemory at 158MB - Not reclaiming any memory overnight -Original Message- The other day Tomcat threw an OutOfMemoryException. This is our development version of Tomcat. Looking at the Windows processes revealed Tomcat at 158MB. Let me do some divination. You are using a SUN Jvm, with no Xms nor Xmx parameter. So, the memory allocated to your applications is 64MB (default). 158 is a good value reflecting the size of the VM plus the size allocated to your applications. If your application needs more memory, try to path -Xmx=128m -Xms=128m to your startup scripts. Hope this helps, François (Oraculum). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5 is not generating IOException when connection closes
Paulo Pizarro wrote: I have a servlet with a persistent connection open to a client (browser), and when the browser is closed or the user hits the stop button, the connection is closed, but the servlet isn't throwing the IOException when it should do it. (i guess) As i could notice, after about 8k of data being written to the client after the connection has been closed, the serlet gets the IOException. I think that perhaps tomcat is buffering the data and only when this buffer is full the IOException is thrown, even when we make a explicit call to out.flush(). The strange thing is that when the connection is open, the client receives data in real time, with no buffering or very little buffering. Has anyone ever had this problem? I tried to call the method response.setBufferSize(0), but it didn't work. Below is the piece of code that writes the data to the ServletOutputStream. ServletOutputStream out = response.getOutputStream(); public void send(String s) throws IOException { out.write(s.getBytes(), 0, s.length()); out.flush(); } I believe this works ok. -- x Rémy Maucherat Senior Developer Consultant JBoss Group (Europe) SàRL x - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Connection Pooling
Justin, The DBCP that's bundled with Tomcat as well as most other pools (proxool for one) return a java.sql.Connection implementation class that wraps the actual DB driver java.sql.Connection implementation. Calling close() on the Connection that you got from the pool returns the underlying connection to the pool for reuse. For DBCP, if you don't call close(), the connection is eventually considered abandoned, and there are a few configuration parameters that affect what happens at that point. http://jakarta.apache.org/commons/dbcp/ for details. -john. -Original Message- From: James Neville [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 11:51 AM To: Tomcat Users List Subject: Re: Connection Pooling Justin, That would all depend on the pooling implementation you're using. Commonly, its pool.free(conn) or pool.freeConnection(conn). Remember *not* to close the connection if you're using connection pooling, as this should be handled by the pool itself. That said one of my colleagues mentioned one pooling implementation he used that returned a custom connection object when obtained from the pool (ie not a java.sql Connection object). The close() method on that connection returned it to the pool, but *didn't* actually close it. If you let us know which pooling implementation you're using, it may make things clearer ;) Cheers, James Hart, Justin wrote: Is there some manner in which a database connection should be returned to the connection pool, or is that automatic? Justin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5 is not generating IOException when connection closes
What do you mean by ok? As far as i can see, the connection closes and writing data to the OutputStream should generate an IOException, but this isn't happening... :-( The problem is that my servlet is inside a loop, and needs to know when the client closes the connection, so it can exit the loop and properly close the running thread and liberate memory and cpu resources. If you say it's ok, it means that tomcat really buffers the data and only generate the IOException when this buffer is full, and that this behavior is ok. Is there any way i can control this tomcat's behaviour, like reduce the size of the buffer? Or even disable this buffer? (better) thanks! Vitor P.S.: (to avoid confusion) The original message was posted by Paulo, but i'm working with him. Remy Maucherat wrote: Paulo Pizarro wrote: I have a servlet with a persistent connection open to a client (browser), and when the browser is closed or the user hits the stop button, the connection is closed, but the servlet isn't throwing the IOException when it should do it. (i guess) As i could notice, after about 8k of data being written to the client after the connection has been closed, the serlet gets the IOException. I think that perhaps tomcat is buffering the data and only when this buffer is full the IOException is thrown, even when we make a explicit call to out.flush(). The strange thing is that when the connection is open, the client receives data in real time, with no buffering or very little buffering. Has anyone ever had this problem? I tried to call the method response.setBufferSize(0), but it didn't work. Below is the piece of code that writes the data to the ServletOutputStream. ServletOutputStream out = response.getOutputStream(); public void send(String s) throws IOException { out.write(s.getBytes(), 0, s.length()); out.flush(); } I believe this works ok. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems running pre-compiled JSP classes when in subdirectories
The problem is when files are kept in work directory. I dont want to put the generated files in web-inf\classes and add mapping. My purpose is to compile jsp pages as part of a build before the application is given for testing. I will keep files in work directory. This I have to do frequently and I want to detect any compilation errors and make it faster for the QA fellow to access the application. Antony Paul - Original Message - From: Riaan Oberholzer [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, January 08, 2004 1:06 PM Subject: Re: Problems running pre-compiled JSP classes when in subdirectories The generated servlets are not put in a package. When Tomcat is compiling JSP it is put in org.apache.jsp. How to set this in the jspc task. The files are generated as usual in the work directory in the same structure as Tomcat itself compiles JSP files. Not entirely true. You can compile the java sources of the JSP's yourself. I do it and it prevents the delay (for Tomcat to compile it) when you first execute a JSP. You also pick up any possible JSP errors when building, not after deployment. You can also specify *any* package, it doesn't have to be org.apache.jsp... I eg use com.myapp.jsp The Tomcat HOW-TO documentation has a good example of the complete process. Jasper 2 JSP Engine How To, option Web Application Compilation. I followed it exactly and mine works 100%. The main difference from what you guys explain (I think), is that I do not only generate java sources for the jsp's, but also compile them (my jsp's are thus delivered as .class files) and also include the servlet mappings in the web.xml. Its all very easy to do with ant. Antony Paul - Original Message - From: Ralph Einfeldt [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 7:06 PM Subject: RE: Problems running pre-compiled JSP classes when in subdirectories May be you should have a look at the following: - the package statements in the generated source files - the file structure of the generate class files -Original Message- From: Jay Glanville [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 2:20 PM To: 'Tomcat Users List' Subject: Problems running pre-compiled JSP classes when in subdirectories Here's my application's background. I have two files: WEBROOT/index.jsp WEBROOT/dir/index.jsp java.lang.NoClassDefFoundError: org/apache/jsp/index_jsp (wrong name: org/apache/jsp/dir/index_jsp) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:537) at java.lang.ClassLoader.defineClass(ClassLoader.java:448) at - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Servlet Unavailable when Reloading Application
Hi, List, I'm using TOMCAT 4.1.27 integrated with WebSphere Studio Application Developer 5.1 under Windows. When I change a class and recompile it, I wish to reload my application to test the changes made. Using the TOMCAT Manager application, I click in the reload link, and when I try to refresh the page I have: HTTP Status 503 - Servlet SCPController is currently unavailable type Status report message Servlet SCPController is currently unavailable description The requested service (Servlet SCPController is currently unavailable) is not currently available. Apache Tomcat/4.1.27 Looking at the LOGS, I found: 2004-01-08 11:46:29 HTMLManager: restart: Reloading web application at '/SCP'2004-01-08 11:46:29 StandardContext[/SCP]: Reloading this Context has started2004-01-08 11:46:29 WebappLoader[/SCP]: Reloading checks are enabled for this Context2004-01-08 11:46:29 StandardWrapper[/SCP:default]: Loading container servlet default2004-01-08 11:46:29 StandardWrapper[/SCP:invoker]: Loading container servlet invoker2004-01-08 11:46:29 StandardManager[/SCP]: Seeding random number generator class java.security.SecureRandom2004-01-08 11:46:29 StandardManager[/SCP]: Seeding of random number generator has been completed2004-01-08 11:46:29 StandardContext[/SCP]: Reloading this Context is completed2004-01-08 11:46:29 HTMLManager: list: Listing contexts for virtual host 'localhost'2004-01-08 11:46:33 StandardWrapper[/SCP:SCPController]: Marking servlet SCPController as unavailable2004-01-08 11:46:33 StandardWrapperValve[SCPController]: Allocate exception for servlet SCPControllerjavax.servlet.ServletException: Wrapper cannot find servlet class com.eccox.scp.web.SCPController or a class it depends onat org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:891)at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:668)at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)at java.lang.Thread.run(Thread.java:534)- Root Cause -java.lang.ClassNotFoundException: com.eccox.scp.web.SCPControllerat org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1444)at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1289)at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:885)at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:668)at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)at
RE: Tomcat 5 is not generating IOException when connection closes
Are you using tomcat standalone or behind apache/iis ? In the later case there may be some buffering in the webserver or mod_jk that can't be controlled from within tomcat. -Original Message- From: Vitor Buitoni [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 1:37 PM To: Tomcat Users List Subject: Re: Tomcat 5 is not generating IOException when connection closes If you say it's ok, it means that tomcat really buffers the data and only generate the IOException when this buffer is full, and that this behavior is ok. Is there any way i can control this tomcat's behaviour, like reduce the size of the buffer? Or even disable this buffer? (better) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat OutOfMemory at 158MB - Not reclaiming any memory overn ight
JProfiler is the best for this job, there are examples to show you how bind JProfiler to tomcat ( www.jprofiler.com ), its pretty easy to handle this tool. -- De: Allistair Crossley[SMTP:[EMAIL PROTECTED] Responder:Tomcat Users List Enviada: quinta-feira, 8 de janeiro de 2004 8:58 Para: Tomcat Users List Assunto: RE: Tomcat OutOfMemory at 158MB - Not reclaiming any memory overnight Yes I would like to profile my applicationbut do you have any tips on how to do this or where to start? Thanks -Original Message- From: Edson Alves Pereira [mailto:[EMAIL PROTECTED] Sent: 08 January 2004 12:49 To: 'Tomcat Users List' Subject: RE: Tomcat OutOfMemory at 158MB - Not reclaiming any memory overnight In my opnion, is better instead of increasing memory of tomcat JVM try to profile your application. I´m sure if tomcat complain about memory, your servlets have something wrong. -- De: Francois JEANMOUGIN[SMTP:[EMAIL PROTECTED] Responder: Tomcat Users List Enviada:quinta-feira, 8 de janeiro de 2004 7:31 Para: Tomcat Users List Assunto:RE: Tomcat OutOfMemory at 158MB - Not reclaiming any memory overnight -Original Message- The other day Tomcat threw an OutOfMemoryException. This is our development version of Tomcat. Looking at the Windows processes revealed Tomcat at 158MB. Let me do some divination. You are using a SUN Jvm, with no Xms nor Xmx parameter. So, the memory allocated to your applications is 64MB (default). 158 is a good value reflecting the size of the VM plus the size allocated to your applications. If your application needs more memory, try to path -Xmx=128m -Xms=128m to your startup scripts. Hope this helps, François (Oraculum). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5 is not generating IOException when connection closes
I'm using tomcat standalone... Vitor Ralph Einfeldt wrote: Are you using tomcat standalone or behind apache/iis ? In the later case there may be some buffering in the webserver or mod_jk that can't be controlled from within tomcat. -Original Message- From: Vitor Buitoni [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 1:37 PM To: Tomcat Users List Subject: Re: Tomcat 5 is not generating IOException when connection closes If you say it's ok, it means that tomcat really buffers the data and only generate the IOException when this buffer is full, and that this behavior is ok. Is there any way i can control this tomcat's behaviour, like reduce the size of the buffer? Or even disable this buffer? (better) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- *Vitor Buitoni* /Programador - APC/ *DÍGITRO TECNOLOGIA* *E-mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] *Fone:* (0xx48) 281-7314 / (0xx48) 281-7000 *Fax:* (0xx48) 281-7000 *Site:* www.portaldigitro.com.br http://www.portaldigitro.com.br - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5 is not generating IOException when connection closes
Vitor Buitoni wrote: What do you mean by ok? As far as i can see, the connection closes and writing data to the OutputStream should generate an IOException, but this isn't happening... :-( The problem is that my servlet is inside a loop, and needs to know when the client closes the connection, so it can exit the loop and properly close the running thread and liberate memory and cpu resources. If you say it's ok, it means that tomcat really buffers the data and only generate the IOException when this buffer is full, and that this behavior is ok. Is there any way i can control this tomcat's behaviour, like reduce the size of the buffer? Or even disable this buffer? (better) thanks! Vitor P.S.: (to avoid confusion) The original message was posted by Paulo, but i'm working with him. There was indeed something wrong. This has been fixed. out.write(s.getBytes(), 0, s.length()); Writing that kind of code is bad ! You should likely use a PrintWriter instead and use checkError. -- x Rémy Maucherat Senior Developer Consultant JBoss Group (Europe) SàRL x - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
HttpConnector class not found int Tomcat 5.0.12
When trying to use Apache Proxy Support the connector configuration: ... Connector className=org.apache.catalina.connector.http.HttpConnector port=8080 proxyPort=80/ ... forces the following error (in catalina.out): SEVERE: Begin event threw exception java.lang.ClassNotFoundException: org.apache.catalina.connector.http.HttpConnector Analysis in my installation directory results in the fact, that there is no class org.apache.catalina.connector.http.HttpConnector in the server/lib/catalina.jar as in a Tomcat 4 Installation is !? Where is the org.apache.catalina.connector.http.HttpConnector-class located in Tomcat 5 ? Rainer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with Web app, javax.print, SecurityManager, and printer discovery
I'm running a Web app that uses the javax.print API to do discovery on attached printers and passes a java.util.List of names to a JSP to display to clients in an HTML select box . I'm running under Tomcat 4.1.29 on Windows 2000 SP 4 and Sun's JDK 1.4.1_03. The drop-down list box is empty - no printers were found. I have three attached printers, so I know the list box should not be empty. I have a Command class that gets all the available printers. The pertinent lines are: List availablePrinters = new ArrayList(); SecurityManager securityGuard = System.getSecurityManager(); if (securityGuard != null) securityGuard.checkPrintJobAccess(); else System.out.println(No security guard; could not check print job access); PrintService [] ps = PrintServiceLookup.lookupPrintServices(DocFlavor.INPUT_STREAM.AUTOSENSE, null); I put some print statements into the code so I could see what was happening. I get this out in the log file: No security guard; could not check print job accessFound zero available printers If I take this code and run it in a desktop app I get back three printers and I can print to my default printer without a problem. I KNOW that I ran this app on Tomcat 4.1.24 and saw printers in the drop-down. I downloaded and tried running the app under the older version of Tomcat, but it, too, shows an empty drop-down. My notes aren't telling me what I did to allow printer discovery. Can anyone refresh my memory? Thanks - MOD __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat OutOfMemory at 158MB - Not reclaiming any memory overn ight
On Unix you can also use the truss command to attach to a running process (check Google for examples). I used this technique on a web application and discovered that a file with *static* content was being opened 1,000 times per hour by the application. Before I showed up at the company, everybody was working on NT and basically hated Unix, so the problem went undiscovered for close to four years. AFAIK, most (all?) of the Java-based tools would not detect this sort of problem. I don't think truss is available on NT, even with the MKS (or equivalent) package. For people who are on NT and are experiencing problems with their Java-based web- application, I would strongly recommend setting up a Unix environment to perform truss-based testing (even if you need to hire a contractor to set up everything). It's really quite amazing what truss can uncover:) Cordially, Oswald Edson Alves Pereira [EMAIL PROTECTED] wrote: JProfiler is the best for this job, there are examples to show you how bind JProfiler to tomcat ( www.jprofiler.com ), its pretty easy to handle this tool. -- De: Allistair Crossley[SMTP:[EMAIL PROTECTED] Responder: Tomcat Users List Enviada: quinta-feira, 8 de janeiro de 2004 8:58 Para: Tomcat Users List Assunto: RE: Tomcat OutOfMemory at 158MB - Not reclaiming any memory overnight Yes I would like to profile my applicationbut do you have any tips on how to do this or where to start? Thanks -Original Message- From: Edson Alves Pereira [mailto:[EMAIL PROTECTED] Sent: 08 January 2004 12:49 To: 'Tomcat Users List' Subject: RE: Tomcat OutOfMemory at 158MB - Not reclaiming any memory overnight In my opnion, is better instead of increasing memory of tomcat JVM try to profile your application. I´m sure if tomcat complain about memory, your servlets have something wrong. -- De: Francois JEANMOUGIN[SMTP:[EMAIL PROTECTED] Responder: Tomcat Users List Enviada: quinta-feira, 8 de janeiro de 2004 7:31 Para: Tomcat Users List Assunto: RE: Tomcat OutOfMemory at 158MB - Not reclaiming any memory overnight -Original Message- The other day Tomcat threw an OutOfMemoryException. This is our development version of Tomcat. Looking at the Windows processes revealed Tomcat at 158MB. Let me do some divination. You are using a SUN Jvm, with no Xms nor Xmx parameter. So, the memory allocated to your applications is 64MB (default). 158 is a good value reflecting the size of the VM plus the size allocated to your applications. If your application needs more memory, try to path -Xmx=128m -Xms=128m to your startup scripts. Hope this helps, François (Oraculum). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- QAS Ltd. Developers of QuickAddress Software www.qas.com Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes
weird tomcat questions
Can someone please decipher the following questions? * How does scoping work in Tomcat? * Why would you bother using a singleton when you're working with Tomcat? Why would scoping be different in tomcat than any other servlet-complying container? What does a singleton have to do with a web container? /tk
Tomcat 4.2 with IIS5
Hi, Where can I find a copy of isapi_redirect.dll ? Dave Anger Sr. Product Analyst - Technology Effectiveness Services I.T. Division 612.752-3002 (w) 612.386-5463 (cell) [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: The security example doesn't
Were you able to use form based auth at all? Is it just the example. I was able to load a .war from a file that used basic and it worked fine. Does a bug report need to be submitted? On Wed, 2004-01-07 at 16:16, FTP Admin wrote: yep. Had exactly the same behavior bad don't know the reason! Nick wrote: Help? Installed Tomcat from the binary (5.0.16) on to a Fedora box. Tried to run the security example from the Documentation. Noticed that the link wasn't changed even though the directory had been Is: http://localhost:8080/examples/jsp/security/protected/ Should be: http://localhost:8080/jsp-examples/security/protected/ I looked over everything that I can think of but the example doesn't log me in. The login.jsp and error.jsp pages are display correctly and if I try to access the index.jsp, I am redirected. It seems as if the user/password/realm are not being recognized. Anyone else seen this? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Nick (Nix) Gray Senior Systems Engineer Bruzenak Inc. (512) 331-7998 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem in configuration
Respected sir/madam, I have a probe in configuration of tomcat server Following are my installations in my pc OS: win98se C:\jdk1.3.1_09\bin C:\jakarta-tomcat-4.1.29\bin ( abstracted ) also i have attacthed the startup.bat file with this mail and it is not working So help me to execute the applications Sir please reply me as soon as possible Thanking you Ronak Do you Yahoo!? Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 5 installation
Hi What ar ethe steps for installing tomcat 5 on Linux I have don ethese Installed JDK untared everything from the Tomcat5 installation file to a tomcat5 directory set the JAVA_HOME and CATALINA_HOME when i give the command sh $CATALINA_HOME/bin/startup.sh the following messages getting Using CATALINA_BASE: /var/tomcat5 Using CATALINA_HOME: /var/tomcat5 Using CATALINA_TMPDIR: /var/tomcat5/temp Using JAVA_HOME: /usr/java/j2sdk1.4.2_03 but http://siteaddress:8080 is not giving the homepage what could be the problem thanks in advace Prince - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: installing tomcat 5 on Linux
On Thu, 2004-01-08 at 05:28, Prince wrote: Hi What are the steps for installing tomcat 5 on Linux I have don ethese Installed JDK untared everything from the Tomcat5 installation file to a tomcat5 directory set the JAVA_HOME and CATALINA_HOME when i give the command sh $CATALINA_HOME/bin/startup.sh the following messages getting Using CATALINA_BASE: /var/tomcat5 Using CATALINA_HOME: /var/tomcat5 Using CATALINA_TMPDIR: /var/tomcat5/temp Using JAVA_HOME: /usr/java/j2sdk1.4.2_03 but http://siteaddress:8080 is not giving the homepage try http://localhost:8080 what could be the problem? How can I run tomcat as root? Don't! create a tomcat user/group and change the ownership of /var/tomcat to that. thanks in advance Prince - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Nick (Nix) Gray Senior Systems Engineer Bruzenak Inc. (512) 331-7998 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 4.2 with IIS5
http://jakarta.apache.org/site/binindex.cgi scroll down to Tomcat Web Server Connectors ADC -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 07 January 2004 22:09 To: [EMAIL PROTECTED] Subject: Tomcat 4.2 with IIS5 Hi, Where can I find a copy of isapi_redirect.dll ? Dave Anger Sr. Product Analyst - Technology Effectiveness Services I.T. Division 612.752-3002 (w) 612.386-5463 (cell) [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: weird tomcat questions
See below: -Original Message- From: T K [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 9:03 PM To: [EMAIL PROTECTED] Subject: weird tomcat questions * How does scoping work in Tomcat? What kind of scoping do you mean ? - attribute scoping a la servlet spec ? (application, session, request, page) * Why would you bother using a singleton when you're working with Tomcat? The same reason as in any other application. Tomcat doesn't enforce or restrict the use of singletons in any way. Why would scoping be different in tomcat than any other servlet-complying container? Why should it. After all tomcat is the reference implementation. Any difference probably spec violation of the other container or there is a disagreement on the interpretation or something is not specified in the spec. (There may be also errors in tomcat that violate the spec, but regarding your question I would nearly bet that there are none) * What does a singleton have to do with a web container? Nothing special. They serve the same purpose as in any other application /tk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat maximum heap size on Linux
Howdy, 150MB is definitely not a roof for the JVM. We have several production machines running heaps with 1GB allocated. They're well tuned, GC shows no discernible pauses even during high usage, and they effectively use numerous processors. Yoav Shapira Millennium ChemInformatics -Original Message- From: Daniel Williams [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 2:04 PM To: Tomcat Users List Subject: Re: Tomcat maximum heap size on Linux It's not a system roof, we use around 200Mb on average and under high load we use around 700Mb with maximum heap set to 900Mb. Also it's not tomcat using the RAM but the JVM, and yes the jvm can use a gig of ram and even more. One more thing, use this jsp code to monitor the JVM's heap usage. %@ page language=java % %@ page session=false % % long free = java.lang.Runtime.getRuntime().freeMemory(); long total = java.lang.Runtime.getRuntime().totalMemory(); long availableProc = java.lang.Runtime.getRuntime().availableProcessors(); long threadCount = java.lang.Thread.activeCount(); long used = total - free; out.print(total + , + used); % Thanks Daniel Mindaugas Genutis wrote: I expect to use it a few hundred Megabytes. It was quickly increasing in my eyes and stopped on 150Mb. Looks like its the system roof. Could it be so? Howdy, If it doesn't need more than 150MB, it won't use more than 150MB... Are you blindly playing around with heap numbers, or did you actually determine 1GB was required to handle your max expected load? Yoav Shapira Millennium ChemInformatics -Original Message- From: Mindaugas Genutis [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 2:37 PM To: Tomcat Users List Subject: Tomcat maximum heap size on Linux I wanted to increase Tomcat's maximum heap size. I did it by putting the following string in the catalina.sh file (I'm running RedHat Linux): CATALINA_OPTS=-Djava.awt.headless=true -Xmx1024m So, Tomcat can use 1Gb of my RAM. However, I'm observing Tomcat's usage with top under Linux and it stops growing at 150Mb. Looks like this option doesn't work. Where else could I increase it? I'm using JDK 1.4.2, Tomcat 4.1.24 -- Kaunas Regional Distance Education Center Programmer Phone: +370 674 05232 WWW: http://distance.ktu.lt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
mod_jk2 JNI question for the brave :)
Hi everyone, Bringing the woes of jk2+JNI again here with the dreaded Can't find child xx in scoreboard, since I haven't found a satisfactory answer by anyone. Using TC5 with Apache 2.0.x under Linux, I can get jk2 to work using sockets. However the fun begins when I try to use JNI. Looking at the source from mod_jk2, I have the following snippet: workerEnv-childId = find_child_by_pid(proc); if (workerEnv-childId == -1) { int max_daemons_limit; ap_mpm_query(AP_MPMQ_MAX_DAEMONS, max_daemons_limit); if (max_daemons_limit == 0) { workerEnv-childId = 0; env-l-jkLog(env, env-l, JK_LOG_INFO, jk2_init() Found child %d in scoreboard slot %d\n, proc.pid, workerEnv-childId); } else { env-l-jkLog(env, env-l, JK_LOG_ERROR, jk2_init() Can't find child %d in scoreboard\n, proc.pid); workerEnv-childId = -2; } } else { env-l-jkLog(env, env-l, JK_LOG_INFO, jk2_init() Found child %d in scoreboard slot %d\n, proc.pid, workerEnv-childId); Now, the first line is the line that tries to locate the childId of the worker in the running server threads (if I am not mistaken). find_child_by_pid will loop through all the active servers trying to find the pid passed as an argument, if it fails to do so it returns -1. I am hazarding a guess, by saying that it must be something in my configuration, within workers2.properties. Is there anyone out there who can provide the definitive configuration file and/or guidelines for workers2.properties? The documentation on jk2 at the mo is a pile of poo (sorry guys). Have a nice day, Yiannis Note:__ This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Jaguar Freight Services and any of its subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk
RE: HttpConnector class not found int Tomcat 5.0.12
Howdy, What makes you think HttpConnector (which was deprecated for long time before tomcat 5 stable came out) is available in tomcat 5? ;) Use Coyote. Yoav Shapira Millennium ChemInformatics -Original Message- From: R. Stransky [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 8:20 AM To: [EMAIL PROTECTED] Subject: HttpConnector class not found int Tomcat 5.0.12 When trying to use Apache Proxy Support the connector configuration: ... Connector className=org.apache.catalina.connector.http.HttpConnector port=8080 proxyPort=80/ ... forces the following error (in catalina.out): SEVERE: Begin event threw exception java.lang.ClassNotFoundException: org.apache.catalina.connector.http.HttpConnector Analysis in my installation directory results in the fact, that there is no class org.apache.catalina.connector.http.HttpConnector in the server/lib/catalina.jar as in a Tomcat 4 Installation is !? Where is the org.apache.catalina.connector.http.HttpConnector-class located in Tomcat 5 ? Rainer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Custom-Principal
Howdy, thanx. You did answer the question. But I didn´t know how to realize what you suggested for the embedded version of Tomcat into JBoss. I didn´t even find the server.xml. Any idea about it? So you asked the exact same question? ;) JBoss uses its own configuration for embedded tomcat, not the same as standalone server.xml, and I'm not sure how to use a custom realm in that context -- ask on the JBoss forums. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with Web app, javax.print, SecurityManager, and printer discovery
Howdy, I remember helping with this a while ago. Ahh, yes: http://marc.theaimsgroup.com/?l=tomcat-userm=105672303905158w=2 Yoav Shapira Millennium ChemInformatics -Original Message- From: Michael Duffy [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 8:22 AM To: [EMAIL PROTECTED] Subject: Problem with Web app, javax.print, SecurityManager, and printer discovery I'm running a Web app that uses the javax.print API to do discovery on attached printers and passes a java.util.List of names to a JSP to display to clients in an HTML select box . I'm running under Tomcat 4.1.29 on Windows 2000 SP 4 and Sun's JDK 1.4.1_03. The drop-down list box is empty - no printers were found. I have three attached printers, so I know the list box should not be empty. I have a Command class that gets all the available printers. The pertinent lines are: List availablePrinters = new ArrayList(); SecurityManager securityGuard = System.getSecurityManager(); if (securityGuard != null) securityGuard.checkPrintJobAccess(); else System.out.println(No security guard; could not check print job access); PrintService [] ps = PrintServiceLookup.lookupPrintServices(DocFlavor.INPUT_STREAM.AUTOSENSE , null); I put some print statements into the code so I could see what was happening. I get this out in the log file: No security guard; could not check print job accessFound zero available printers If I take this code and run it in a desktop app I get back three printers and I can print to my default printer without a problem. I KNOW that I ran this app on Tomcat 4.1.24 and saw printers in the drop-down. I downloaded and tried running the app under the older version of Tomcat, but it, too, shows an empty drop-down. My notes aren't telling me what I did to allow printer discovery. Can anyone refresh my memory? Thanks - MOD __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat OutOfMemory at 158MB - Not reclaiming any memory overnight
Howdy, JProfiler is one option, there are many others. I use OptimizeIt on a regular basis. How to profile? Umm, that's a bit of a black art. Basically, start the profiler following its documentation on how to tie it into your tomcat process. You will see where CPU time is spent and where memory is allocated. Look for unnecessary allocations (why do I still have 20 instance of foo.bar around, they should all be gone by now...) and overly heavy methods (how come foo.bar.getX is taking 5 seconds, it's a simple read operation). Profiling and memory tuning go hand in hand. You will go through several iterations of playing with the Java VM Options before you settle on the optimal one. Can tomcat handle 300 users? Sure, depending on your hardware and your webapps. This is why you stress-test your app with a tool like JMeter that can simulate 300 users hitting your site. Let me do some divination. You are using a SUN Jvm, with no Xms nor Xmx parameter. So, the memory allocated to your applications is 64MB (default). 158 is a good value reflecting the size of the VM plus the size allocated to your applications. Umm, no. 64MB is the default heap which includes the VM and your applications. At that size, VM stack/symbol table overhead is far less than 64MB, and so the total process resident size would not be 158MB unless other wacky things were going on. But anyways, my point is that whatever you specify in -Xmx is total for the JVM's heap, which includes its own objects as well as your applications, not just your applications. And another basic note on JVM memory usage: it will never go down overnight. The JVM allocates memory as needed (by default, this can be changed using parameters like -Xms), and will not release that memory back to the operating system, ever. It'll release the memory back into its own heap, but it will stay tied to the JVM process. JVM process memory is monotonically increasing in the strict mathematical sense of the term. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Best practices - doing code pushes
Howdy, I'm sure there are fancier ways, but I always opt for the old-fashioned way, which is to deploy and restart when no one is using the application. This is almost always possible in an intranet environment. On the big web it's a different story, but I'd still probably do it the same way: analyze logs, pick a time of lowest usage, post a notice before that time, and do it. Yoav Shapira Millennium ChemInformatics -Original Message- From: Jacob Kjome [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 12:15 AM To: Tomcat Users List Subject: Re: Best practices - doing code pushes At 03:29 PM 1/7/2004 -0700, you wrote: I have a question about how to load a new application w/o interruption of service. What do others do to remove/reduce service interruption when doing a new code push? I would like to be able to push new code for new Axis services w/o having to kill any service requests currently being serviced, and pick up the new code for any new incoming requests. Is this possible? There's a new pause parameter for the manager deploy servlet which should do what you require... http://jakarta.apache.org/tomcat/tomcat-5.0-doc/manager- howto.html#Deploy%20A%20New%20Application%20Remotely Jake - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Retrieving the context path from a standalone class
Howdy, One way is by taking advantage of Tomcat's naming conventions with the tempdir String tempdir = + context.getAttribute(javax.servlet.context.tempdir); int lastSlash = tempdir.lastIndexOf(File.separator); if ((tempdir.length() - 1) lastSlash) { logHomePropName = tempdir.substring(lastSlash + 1) + .log.home; } Very tomcat-specific and subject to change ;) But the 2nd approach is much better, as I mentioned using ServletContext#getResource is a good way to go. As I was reading the code, I could swear I'd seen it before, and then I realized it's a paste from the log4j repository selector you wrote ;) (BTW how come we haven't moved it from log4j-sandbox to log4j for 1.3 yet?) Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: weird tomcat questions
One thing i forgot in my previous reply: To implement singletons under tomcat requires more knowhow as a typical stand alone applications. Tomcat has several classloaders and there can a copy of the same class in different classloaders. This way the simple approach of using static class vars to store singletons can fail. -Original Message- From: T K [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 9:03 PM To: [EMAIL PROTECTED] Subject: weird tomcat questions Can someone please decipher the following questions? * How does scoping work in Tomcat? * Why would you bother using a singleton when you're working with Tomcat? Why would scoping be different in tomcat than any other servlet-complying container? What does a singleton have to do with a web container? /tk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat maximum heap size on Linux
Howdy, I've seen this answer twice today, make scripts to stress-test your app. How do you do that? What am I connecting to and looking for in a script that stress-tests a Java servlet or web app? I'm only asking because I'm a little green at this and there are obviously other people with the same needs who are failing to do this preemptively. Twice today, hundreds of times in the archives ;) This is a standard process which can be summarized as follows? - How many maximum concurrent users to you need to support? (e.g. 100). - When handling that expected maximum number, what is the acceptable response time for pages in your application (e.g. 5sec). - Now get a tool like JMeter (which I like a lot, because it's free, powerful, and contains great tidbits from my friend and fellow developer Peter Lin [http://jakarta.apache.org/tomcat/articles/performance.pdf]) or Apache AB and write a script to simulate that expected maximum number of users hitting your webapp. - Run the script and see how your webapp responds. Are there crashes or other errors in the log? Is the response time too slow? - If all works well, you rock. Otherwise, inspect your webapp, perhaps running it with a profiler, for ways to improve performance. You will most likely need to experiment with Java VM Options, perhaps hardware or OS-level tweaking as well. Repeat the process until you're satisfied with performance. That's it. If you're stuck at any step in the process feel free to ask for help. I can't make this a complete message without stressing, yet again, that anyone who says they put apache in front of tomcat because tomcat's standalone performance isn't good enough without having done the above analysis should be fired on the spot. If they did this analysis and concluded they needed apache, kudos, but making performance decisions based on some old preconceived notions is... well, no need to swear. ;) Yoav Shapira -- John Beamon Systems Administrator Franklin American Mortgage eml: [EMAIL PROTECTED] web: www.franklinamerican.com Shapira, Yoav wrote: Howdy, Stress-test it with your max expected load and see what happens. There's no artificial reason for it to stop at 150MB. Yoav Shapira Millennium ChemInformatics -Original Message- From: Mindaugas Genutis [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 2:45 PM To: Tomcat Users List Subject: RE: Tomcat maximum heap size on Linux I expect to use it a few hundred Megabytes. It was quickly increasing in my eyes and stopped on 150Mb. Looks like its the system roof. Could it be so? Howdy, If it doesn't need more than 150MB, it won't use more than 150MB... Are you blindly playing around with heap numbers, or did you actually determine 1GB was required to handle your max expected load? Yoav Shapira Millennium ChemInformatics -Original Message- From: Mindaugas Genutis [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 2:37 PM To: Tomcat Users List Subject: Tomcat maximum heap size on Linux I wanted to increase Tomcat's maximum heap size. I did it by putting the following string in the catalina.sh file (I'm running RedHat Linux): CATALINA_OPTS=-Djava.awt.headless=true -Xmx1024m So, Tomcat can use 1Gb of my RAM. However, I'm observing Tomcat's usage with top under Linux and it stops growing at 150Mb. Looks like this option doesn't work. Where else could I increase it? I'm using JDK 1.4.2, Tomcat 4.1.24 -- Kaunas Regional Distance Education Center Programmer Phone: +370 674 05232 WWW: http://distance.ktu.lt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Kaunas Regional Distance Education Center Programmer Phone: +370 674 05232 WWW: http://distance.ktu.lt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not
RE: Retrieving the context path from a standalone class
Howdy, If it isn't then I want to know the correct way to deal with the problem. Can you restate your problem? If I remember correctly, it was that you need to index your site using lucene upon tomcat startup. You don't want to wait for the first user request because you don't want that request to have to wait for indexing. Is that right? The only thing I didn't understand in your email was the comment re docBase. I'm not sure what this is - in particular, are you talking HTML document base or some other mechanism - can you enlighten me? The docBase is the root directory of your webapplication, i.e. /contextPath/. It's not the same as the root directory of the server usually, only in the special case where contextPath is the empty string. All ServletContext#getResource and getRequestDispatcher calls are relative to this docBase rather than the server root, and therefore you don't need to know the context path in order to use these function calls. Actually I just thought of another argument for supplying deployment information to the developer - feel free to shoot me down. In my web app I have a filter called ProtocolFilter. It simply switches the client in and out of SSL as specified by filter options. In order to perform the switch, the ports must be known. I currently have these ports defined as env entries so that the filter (and other code) can pick them up. How else could I possibly do this? Using the redirectPort attribute of tomcat's Connector element in server.xml. I took a look at lucene's indexing code. It seems like you can construct an Analyzer from a Reader (so an InputStreamReader constructed from the InputStream returned by ServletContext#getResourceAsStream would work), and then use a RAMDirectory as the IndexWriter's Directory argument. Alternatively you an use an FSDirectory if you want to save the index to disk, use the one directory where the container will let you write, the directory accessible via (File) servletContext.getAttribute(javax.servlet.context.tempdir); That should work, no? Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: weird tomcat questions
Howdy, * How does scoping work in Tomcat? The same as in all java programs. * Why would you bother using a singleton when you're working with Tomcat? Why would scoping be different in tomcat than any other servlet-complying container? What does a singleton have to do with a web container? You would use a singleton in tomcat for the same reasons you would in other programs. One advantage a singleton has in a servlet container like tomcat is that all the webapps run in one JVM but their own classloaders, with one common parent classloader. If your singleton is in that classloader (the shared or common classloader in tomcat parlance) then all your webapps see the same instance of this singleton, thereby making it a suitable location to place objects that you want to share across webapps. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HttpConnector class not found int Tomcat 5.0.12
Because it is mentioned in the documentation devivered with Tomcat 5 (http://localhost:8080/tomcat-docs/proxy-howto.html). But thanks for your answer. I will use Coyote instead. Raienr On Thursday 08 January 2004 14:37, Shapira, Yoav wrote: Howdy, What makes you think HttpConnector (which was deprecated for long time before tomcat 5 stable came out) is available in tomcat 5? ;) Use Coyote. Yoav Shapira Millennium ChemInformatics -Original Message- From: R. Stransky [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 8:20 AM To: [EMAIL PROTECTED] Subject: HttpConnector class not found int Tomcat 5.0.12 When trying to use Apache Proxy Support the connector configuration: ... Connector className=org.apache.catalina.connector.http.HttpConnector port=8080 proxyPort=80/ ... forces the following error (in catalina.out): SEVERE: Begin event threw exception java.lang.ClassNotFoundException: org.apache.catalina.connector.http.HttpConnector Analysis in my installation directory results in the fact, that there is no class org.apache.catalina.connector.http.HttpConnector in the server/lib/catalina.jar as in a Tomcat 4 Installation is !? Where is the org.apache.catalina.connector.http.HttpConnector-class located in Tomcat 5 ? Rainer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with Web app, javax.print, SecurityManager, and printer discovery
Now that I have your reminder, I can see that I've got the fix in my notes dated 27Jun2003. Too bad I wasn't looking back that far before I sent my note to the list. I'm glad your memory is better than mine. Sorry to bother you again, Yoav. I hope your holidays were good, and my best to you for the new year. Thanks again for watching this list. Sincerely, MOD --- Shapira, Yoav [EMAIL PROTECTED] wrote: Howdy, I remember helping with this a while ago. Ahh, yes: http://marc.theaimsgroup.com/?l=tomcat-userm=105672303905158w=2 Yoav Shapira Millennium ChemInformatics -Original Message- From: Michael Duffy [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 8:22 AM To: [EMAIL PROTECTED] Subject: Problem with Web app, javax.print, SecurityManager, and printer discovery I'm running a Web app that uses the javax.print API to do discovery on attached printers and passes a java.util.List of names to a JSP to display to clients in an HTML select box . I'm running under Tomcat 4.1.29 on Windows 2000 SP 4 and Sun's JDK 1.4.1_03. The drop-down list box is empty - no printers were found. I have three attached printers, so I know the list box should not be empty. I have a Command class that gets all the available printers. The pertinent lines are: List availablePrinters = new ArrayList(); SecurityManager securityGuard = System.getSecurityManager(); if (securityGuard != null) securityGuard.checkPrintJobAccess(); else System.out.println(No security guard; could not check print job access); PrintService [] ps = PrintServiceLookup.lookupPrintServices(DocFlavor.INPUT_STREAM.AUTOSENSE , null); I put some print statements into the code so I could see what was happening. I get this out in the log file: No security guard; could not check print job accessFound zero available printers If I take this code and run it in a desktop app I get back three printers and I can print to my default printer without a problem. I KNOW that I ran this app on Tomcat 4.1.24 and saw printers in the drop-down. I downloaded and tried running the app under the older version of Tomcat, but it, too, shows an empty drop-down. My notes aren't telling me what I did to allow printer discovery. Can anyone refresh my memory? Thanks - MOD __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: mod_jk2 JNI question for the brave :)
From: Yiannis Mavroukakis Subject: mod_jk2 JNI question for the brave :) Hi everyone, Bringing the woes of jk2+JNI again here with the dreaded Can't find child xx in scoreboard, since I haven't found a satisfactory answer by anyone. Using TC5 with Apache 2.0.x under Linux, I can get jk2 to work using sockets. However the fun begins when I try to use JNI. Looking at the source from mod_jk2, I have the following snippet: Since I wrote the code, It would be me to blame :-). The problem with JNI and Linux is that you may have few different mpm's to run. JNI presumes that you have a _single_ worker process with multiple threads. If your mpm behave differently then the JNI isn't the appropriate channel to use. The documentation on jk2 at the mo is a pile of poo (sorry guys). I agree with you. Do you volunteer? MT. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with Web app, javax.print, SecurityManager, and printer discovery
Howdy, No problem, glad to help ;) Yoav Shapira Millennium ChemInformatics -Original Message- From: Michael Duffy [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 9:46 AM To: Tomcat Users List Subject: RE: Problem with Web app, javax.print, SecurityManager, and printer discovery Now that I have your reminder, I can see that I've got the fix in my notes dated 27Jun2003. Too bad I wasn't looking back that far before I sent my note to the list. I'm glad your memory is better than mine. Sorry to bother you again, Yoav. I hope your holidays were good, and my best to you for the new year. Thanks again for watching this list. Sincerely, MOD --- Shapira, Yoav [EMAIL PROTECTED] wrote: Howdy, I remember helping with this a while ago. Ahh, yes: http://marc.theaimsgroup.com/?l=tomcat-userm=105672303905158w=2 Yoav Shapira Millennium ChemInformatics -Original Message- From: Michael Duffy [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 8:22 AM To: [EMAIL PROTECTED] Subject: Problem with Web app, javax.print, SecurityManager, and printer discovery I'm running a Web app that uses the javax.print API to do discovery on attached printers and passes a java.util.List of names to a JSP to display to clients in an HTML select box . I'm running under Tomcat 4.1.29 on Windows 2000 SP 4 and Sun's JDK 1.4.1_03. The drop-down list box is empty - no printers were found. I have three attached printers, so I know the list box should not be empty. I have a Command class that gets all the available printers. The pertinent lines are: List availablePrinters = new ArrayList(); SecurityManager securityGuard = System.getSecurityManager(); if (securityGuard != null) securityGuard.checkPrintJobAccess(); else System.out.println(No security guard; could not check print job access); PrintService [] ps = PrintServiceLookup.lookupPrintServices(DocFlavor.INPUT_STREAM.AUTOSENS E , null); I put some print statements into the code so I could see what was happening. I get this out in the log file: No security guard; could not check print job accessFound zero available printers If I take this code and run it in a desktop app I get back three printers and I can print to my default printer without a problem. I KNOW that I ran this app on Tomcat 4.1.24 and saw printers in the drop-down. I downloaded and tried running the app under the older version of Tomcat, but it, too, shows an empty drop-down. My notes aren't telling me what I did to allow printer discovery. Can anyone refresh my memory? Thanks - MOD __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HttpConnector class not found int Tomcat 5.0.12
R. Stransky wrote: Because it is mentioned in the documentation devivered with Tomcat 5 (http://localhost:8080/tomcat-docs/proxy-howto.html). Fixing all the stale stuff from the docs takes time :-( -- x Rémy Maucherat Senior Developer Consultant JBoss Group (Europe) SàRL x - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Squid with ESI + Tomcat
Hi all I'm trying to use squid as a reverse proxy in front of Tomcat and to make things more complicated squid is compiled with ESI enabled :-) I've allready convinced squid-tomcat dou to process basic esi example but squid doesn't cache anything. I suspect that it's because of http headers that Tomcat by default adds to each response. I tried similar configuration with Apache and everything works promising ;-) So the question is how to remove Pragma, Cache-control and Expires http headers? -- Regards Konrad - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat reconnect to database server?
Actually, I am correct that the Microsoft SQL Server JDBC driver does not support a validationQuery option. However, I agree that I was incorrect in assuming that the resource parameters configured the JDBC driver, rather than the connection pool (and the JDBC driver indirectly). I'm glad that you corrected my mistake. Fortunately, one thing that I've learned from using mailing lists is that there's no better way to get someone to give you the right answer than to suggest the wrong one! Derek -Original Message- From: Altankov Peter [mailto:[EMAIL PROTECTED] Sent: January 8, 2004 7:24 AM To: Derek Mahar Subject: RE: Tomcat reconnect to database server? I think u r just wrong. We are not talking bout the JDBC driver itself but for the apache DBCP and POOL implementations. And THAT dbpool package supports the option of validation query -Original Message- From: Derek Mahar [mailto:[EMAIL PROTECTED] Sent: 07 2004 . 20:41 To: Altankov Peter Subject: RE: Tomcat reconnect to database server? Thanks for the suggestion. After reading the MS SQL Server JDBC driver documentation, however, it appears that the driver does not support the validationQuery option. :-( Derek -Original Message- From: Altankov Peter [mailto:[EMAIL PROTECTED] Sent: January 7, 2004 11:38 AM To: Tomcat Users List Subject: RE: Tomcat reconnect to database server? The DBCP pool that you lookup from JNDI is already such a connection manager. Just try adding the validation query that Arthur suggested. Im not sure for MSSQL but I use this for Oracle: parameter namevalidationQuery/name valueSELECT 1 FROM dual/value /parameter This goes underResourceParams name=jdbc/your_resource BR -Original Message- From: Derek Mahar [mailto:[EMAIL PROTECTED] Sent: 07 2004 . 18:21 To: Tomcat Users List Subject: RE: Tomcat reconnect to database server? Thanks for your reply. Unfortunately, the Microsoft SQL Server JDBC driver does not support an autoreconnect option. Do I need a separate connection pool manager? The MS SQL Server JDBC driver documentation suggests that I might need such a manager since the driver does not itself manage the connection pool. Derek -Original Message- From: Philipp Taprogge [mailto:[EMAIL PROTECTED] Sent: January 7, 2004 9:47 AM To: Tomcat Users List Subject: Re: Tomcat reconnect to database server? Hi! I don't know MSSQL in particular, but in princible it should be as simple as adding ?autoreconnect=true to the driver URL. Phil Derek Mahar wrote: How can I configure Tomcat 5.0.16 to reconnect to a Microsot SQL Server after a server restart? I have configured Tomcat to use JNDI datasources (through Resource and ResourceParam elements within GlobalNamingResources). I presume that at startup, Tomcat connects to the server and creates a pool of connections for later use. However, when we restart our server, Tomcat loses its connection(s) and does not re-establish these connections. -- And on the seventh day, He exited from append mode. (Book of create(2), line 255) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: HttpConnector class not found int Tomcat 5.0.12
Howdy, And I see Remy beat me to this one ;) The doc change will be visible with the next release and site update. Yoav Shapira Millennium ChemInformatics -Original Message- From: Remy Maucherat [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 9:57 AM To: Tomcat Users List Subject: Re: HttpConnector class not found int Tomcat 5.0.12 R. Stransky wrote: Because it is mentioned in the documentation devivered with Tomcat 5 (http://localhost:8080/tomcat-docs/proxy-howto.html). Fixing all the stale stuff from the docs takes time :-( -- x Rémy Maucherat Senior Developer Consultant JBoss Group (Europe) SàRL x - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Microsoft SQL Server validation query
Does anyone happen to know which validation query I should use for Microsoft SQL Server? Derek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Microsoft SQL Server validation query
Any, such as if you have a user table, Select lastname from user where userid = 1 It's just a query which is going to return results. -Art D'Alessandro CBE Technologies Office: 617-514-1785 Cell: 617-905-5917 -Original Message- From: Derek Mahar [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 10:15 AM To: Tomcat Users List Subject: Microsoft SQL Server validation query Does anyone happen to know which validation query I should use for Microsoft SQL Server? Derek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Microsoft SQL Server validation query
i think you could use anything .. maybe SELECT COUNT(*) FROM table The dual table is an oracle dummy table and is quite handy, but I think the validation query can just be any old select statement that should return true a result always. ADC -Original Message- From: Derek Mahar [mailto:[EMAIL PROTECTED] Sent: 08 January 2004 15:15 To: Tomcat Users List Subject: Microsoft SQL Server validation query Does anyone happen to know which validation query I should use for Microsoft SQL Server? Derek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Microsoft SQL Server validation query
Or even SELECT 1 FROM TABLE. No COUNT overhead, if any. - MOD --- Allistair Crossley [EMAIL PROTECTED] wrote: i think you could use anything .. maybe SELECT COUNT(*) FROM table The dual table is an oracle dummy table and is quite handy, but I think the validation query can just be any old select statement that should return true a result always. ADC -Original Message- From: Derek Mahar [mailto:[EMAIL PROTECTED] Sent: 08 January 2004 15:15 To: Tomcat Users List Subject: Microsoft SQL Server validation query Does anyone happen to know which validation query I should use for Microsoft SQL Server? Derek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Retrieving the context path from a standalone class
Quoting Shapira, Yoav [EMAIL PROTECTED]: Howdy, One way is by taking advantage of Tomcat's naming conventions with the tempdir String tempdir = + context.getAttribute(javax.servlet.context.tempdir); int lastSlash = tempdir.lastIndexOf(File.separator); if ((tempdir.length() - 1) lastSlash) { logHomePropName = tempdir.substring(lastSlash + 1) + .log.home; } Very tomcat-specific and subject to change ;) Yep, that's why I don't use that anymore and use the second approach. But the 2nd approach is much better, as I mentioned using ServletContext#getResource is a good way to go. As I was reading the code, I could swear I'd seen it before, and then I realized it's a paste from the log4j repository selector you wrote ;) Yes, with your help :-) (BTW how come we haven't moved it from log4j-sandbox to log4j for 1.3 yet?) Not sure, but we will probably want to update it to work with Ceki's new configuration mechanism which is to replace the DOMConfigurator (what was it called again?) and also use the new watchdogs instead of configureAndWatch() (which is only used in cases where it is configured to be used *and* we detect that we have file system access to the configured [proposed] location of the log file). However, I am unfamiliar with how these work, so any help on this effort would be appreciated. For my purposes, I use a jar built off the unofficial 0.2 tagged version of the log4j-sandbox CVS code. BTW, ContextJNDISelector has been moved to Log4j already. I think we should also move the other optional appenders as well as the configuration stuff as they have been very useful (to me, at least). I'd like to hear the opinions of some of the other developers on this before an alpha release of log4j-1.3. Jake - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Microsoft SQL Server validation query
I would not do that because that would return as many 1s as there are rows in the table. Something like count(*) may not be the most efficient but it returns just 1 row always. Also with using 1, you cannot guarantee a row will come back. Allistair Crossley __ Intranet Senior Developer New Media Group, QAS Ltd Telephone: 020 7819 5343 __ -Original Message- From: Michael Duffy [mailto:[EMAIL PROTECTED] Sent: 08 January 2004 15:25 To: Tomcat Users List Subject: RE: Microsoft SQL Server validation query Or even SELECT 1 FROM TABLE. No COUNT overhead, if any. - MOD --- Allistair Crossley [EMAIL PROTECTED] wrote: i think you could use anything .. maybe SELECT COUNT(*) FROM table The dual table is an oracle dummy table and is quite handy, but I think the validation query can just be any old select statement that should return true a result always. ADC -Original Message- From: Derek Mahar [mailto:[EMAIL PROTECTED] Sent: 08 January 2004 15:15 To: Tomcat Users List Subject: Microsoft SQL Server validation query Does anyone happen to know which validation query I should use for Microsoft SQL Server? Derek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Microsoft SQL Server validation query
in the past I just select the date from sql server. unless you want to test a specific table, but that has potential performance impact. the safe simple query to see if sql server is alive is to just select the date. peter lin Allistair Crossley [EMAIL PROTECTED] wrote: I would not do that because that would return as many 1s as there are rows in the table. Something like count(*) may not be the most efficient but it returns just 1 row always. Also with using 1, you cannot guarantee a row will come back. Allistair Crossley __ Intranet Senior Developer New Media Group, QAS Ltd Telephone: 020 7819 5343 __ -Original Message- From: Michael Duffy [mailto:[EMAIL PROTECTED] Sent: 08 January 2004 15:25 To: Tomcat Users List Subject: RE: Microsoft SQL Server validation query Or even SELECT 1 FROM TABLE. No COUNT overhead, if any. - MOD --- Allistair Crossley wrote: i think you could use anything .. maybe SELECT COUNT(*) FROM table The dual table is an oracle dummy table and is quite handy, but I think the validation query can just be any old select statement that should return true a result always. ADC -Original Message- From: Derek Mahar [mailto:[EMAIL PROTECTED] Sent: 08 January 2004 15:15 To: Tomcat Users List Subject: Microsoft SQL Server validation query Does anyone happen to know which validation query I should use for Microsoft SQL Server? Derek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- QAS Ltd. Developers of QuickAddress Software www.qas.com Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes
RE: Microsoft SQL Server validation query
If that takes to long, you can limit the search, if you have a table with an indexed column where you know that there is certain id SELECT 1 FROM TABLE WHERE ID = known id (We always have such tables) --- Allistair Crossley [EMAIL PROTECTED] wrote: i think you could use anything .. maybe SELECT COUNT(*) FROM table The dual table is an oracle dummy table and is quite handy, but I think the validation query can just be any old select statement that should return true a result always. ADC - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Conn.Pooling stopped Tomcat from starting at boot time
Hi, I implemented connection pooling for Tomcat 4.0 and it works fine. The only thing is Tomcat is not starting at boot time anymore. Any reason for that? How can I correct it? Also, what should I do to start Tomcat 5.0.16 at boot time on my other machine? Thanks N.K. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: mod_jk2 JNI question for the brave :)
Hi Mladen, thank you for the reply that helps me gain some understanding in the issue. Would it not be possible to bind JNI under a single worker and then isolate that worker from the rest of the pool (possibly provide the ability for workers to carry some sort of identification bit with regards to who can access them)? I'll be more than happy to volunteer for the documentation, just point at the right direction :) Thank you, Yiannis -Original Message- From: Mladen Turk [mailto:[EMAIL PROTECTED] Sent: 08 January 2004 14:48 To: 'Tomcat Users List' Subject: RE: mod_jk2 JNI question for the brave :) From: Yiannis Mavroukakis Subject: mod_jk2 JNI question for the brave :) Hi everyone, Bringing the woes of jk2+JNI again here with the dreaded Can't find child xx in scoreboard, since I haven't found a satisfactory answer by anyone. Using TC5 with Apache 2.0.x under Linux, I can get jk2 to work using sockets. However the fun begins when I try to use JNI. Looking at the source from mod_jk2, I have the following snippet: Since I wrote the code, It would be me to blame :-). The problem with JNI and Linux is that you may have few different mpm's to run. JNI presumes that you have a _single_ worker process with multiple threads. If your mpm behave differently then the JNI isn't the appropriate channel to use. The documentation on jk2 at the mo is a pile of poo (sorry guys). I agree with you. Do you volunteer? MT. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk Note:__ This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Jaguar Freight Services and any of its subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk
SocketException - JK2, Tomcat 4.1.29, IIS 5.1
When accessing pages on my Tomcat server via IIS and isapi_redirector2.dll I get the following errors on every page request. The errors below are for a simple page invokation like http://localhost/asis/index.jsp Each page is returned successfully, but there are reams of errors generated. Thanks for any help. I have included the catalina.out, isapi.log, jk2.properties and workers2.properties file. Thanks again, Frank In the TOMCAT LOG I get: SEVERE: Error, processing connection java.net.SocketException: Software caused connection abort: recv failed at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:129) at java.io.BufferedInputStream.fill(BufferedInputStream.java:183) at java.io.BufferedInputStream.read1(BufferedInputStream.java:222) at java.io.BufferedInputStream.read(BufferedInputStream.java:277) at org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:548) at org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:486) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:603) at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:786) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:666) at java.lang.Thread.run(Thread.java:536) StandardContext[/asis]: Mapped to servlet 'default' with servlet path '/includes/style.css' and path info 'null' and update=true Jan 8, 2004 10:23:06 AM org.apache.jk.common.ChannelSocket processConnection SEVERE: Error, processing connection java.net.SocketException: Software caused connection abort: recv failed at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.read(SocketInputStream.java:129) at java.io.BufferedInputStream.fill(BufferedInputStream.java:183) at java.io.BufferedInputStream.read1(BufferedInputStream.java:222) at java.io.BufferedInputStream.read(BufferedInputStream.java:277) at org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:548) at org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:486) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:603) at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:786) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:666) at java.lang.Thread.run(Thread.java:536) In the ISAPI LOG I get: [Thu Jan 08 10:23:06 2004] (error ) [jk_worker_ajp13.c (341)] ajp13.service() error sending, reconnect channel.socket:localhost:8009 -1 0 No error [Thu Jan 08 10:23:06 2004] (error ) [jk_service_iis.c (157)] jk_ws_service_t::head, ServerSupportFunction failed [Thu Jan 08 10:23:06 2004] (error ) [jk_handler_response.c (178)] handler.response() Error sending response[Thu Jan 08 10:23:06 2004] (error ) [jk_worker_ajp13.c (416)] ajp13.service() ajpGetReply recoverable error 3 [Thu Jan 08 10:23:06 2004] (error ) [jk_service_iis.c (157)] jk_ws_service_t::head, ServerSupportFunction failed [Thu Jan 08 10:23:06 2004] (error ) [jk_handler_response.c (178)] handler.response() Error sending response[Thu Jan 08 10:23:06 2004] (error ) [jk_worker_ajp13.c (416)] ajp13.service() ajpGetReply recoverable error 3 [Thu Jan 08 10:23:06 2004] (error ) [jk_worker_ajp13.c (512)] ajp13.service() Error forwarding ajp13:localhost:8009 1 0 My jk2.properties file: # Handler configuration # handler.list=request,container,channelSocket # Socket configuration # channelSocket.port=8009 channelSocket.address=127.0.0.1 channelSocket.maxPort=port+10 My workers2.properties file: # shared memory # [shm] file=D:/tomcat-4.1.29/work/shm.file size=1048576 # alternate logging to keep mod_jk2 logging separate from IIS logging # [logger.file:0] file=D:/tomcat-4.1.29/logs/jk2.log [workerEnv:] info=Global server options timing=1 debug=0 logger=logger.file:0 # IP socket channel # [channel.socket:localhost:8009] port=8009 host=127.0.0.1 # define the ajp13 worker # [ajp13:localhost:8009] channel=channel.socket:localhost:8009 # Uri mapping examples - jsp files only # [uri:/asis/*] worker=ajp13:localhost:8009 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Possible Bug in 4.1.27 - RequestDispatcher fails after cross context include
I have two web applications, client and server (attached). In the client web application, there is a single servlet, ClientServlet which performs an include to another servlet, ServerServlet, in server web application. This is done through the following code: ServletContext serverServletContext = getServletContext().getContext(SERVER_CONTEXT_ROOT); RequestDispatcher requestDispatcher = serverServletContext.getRequestDispatcher(SERVER_SERVLET_PATH); requestDispatcher.include(httpServletRequest, httpServletResponse); This portion of the test case works as expected. The ServerServlet will then attempt to include a jsp file, test.jsp, within the server web application using the following: RequestDispatcher dispatcher = httpServletRequest.getRequestDispatcher (/test.jsp); dispatcher.include(httpServletRequest, httpServletResponse); This, however, does not work as expected. Although the dispatcher is not null, the content of the jsp is not displayed. Note that if you invoke the ServletServlet directly, without going through the ClientServlet of the Client web application, the jsp is displayed as expected. Thoughts? Scott - Shanje.NET The webmaster's 1st choice for Windows 2003 Hosting http://www.Shanje.NET/ - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Retrieving the context path from a standalone class
Howdy, Not sure, but we will probably want to update it to work with Ceki's new configuration mechanism which is to replace the DOMConfigurator (what was it called again?) and also use the new watchdogs instead of It's called Joran, and the JoranConfigurator. We'll continue this discussion on log4j-dev ;) Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Retrieving the context path from a standalone class
-Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 7:36 AM To: Tomcat Users List Subject: RE: Retrieving the context path from a standalone class I took a look at lucene's indexing code. It seems like you can construct an Analyzer from a Reader (so an InputStreamReader constructed from the InputStream returned by ServletContext#getResourceAsStream would work), and then use a RAMDirectory as the IndexWriter's Directory argument. Alternatively you an use an FSDirectory if you want to save the index to disk, use the one directory where the container will let you write, the directory accessible via (File) servletContext.getAttribute(javax.servlet.context.tempdir); That should work, no? Won't that index the JSP source ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Mapping /BAH/ to /
Hi all. Quick question regarding Tomcat. I'd like to create a mapping such that all requests to http://hostname:8080/FOO/ http://hostname:8080/FOO/ are forwarded to http://hostname:8080/ http://hostname:8080/ in a transparent manner (to the user, at least). Thus, if there is a JSP at http://hostname:8080/FOO/bar/Page.jsp http://hostname:8080/FOO/bar/Page.jsp , users can access it by either going to that URL or to this url: http://hostname:8080/bar/Page.jsp http://hostname:8080/bar/Page.jsp . (Where BAR is the name of the webapp). Does anyone know if / how this can be done? I know one can implement such functionality using Valves, but I seek a simpler solution (if there is one). Thanks! -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Retrieving the context path from a standalone class
Howdy, I took a look at lucene's indexing code. It seems like you can construct an Analyzer from a Reader (so an InputStreamReader constructed from the InputStream returned by ServletContext#getResourceAsStream would work), and then use a RAMDirectory as the IndexWriter's Directory argument. Alternatively you an use an FSDirectory if you want to save the index to disk, use the one directory where the container will let you write, the directory accessible via (File) servletContext.getAttribute(javax.servlet.context.tempdir); That should work, no? Won't that index the JSP source ? Probably. AFAIK there's no way to get the HTML that a JSP page would show without an actual request. Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: TC 4.1.12 on Linux - session swapping
I took a look at the code. UGLY. All of the code is in the JSP and there are no class variables. There are lots of page scope beans. Page scope is not something that I am used to using. I usually use request. Could this be a problem where the next request is hitting the page before it has died in a high-volume scenario? --- Altankov Peter [EMAIL PROTECTED] wrote: This has the taste of a thread safety issue. Do you guys happen to run the query against the same servlet? If yes, do you happen to use variables, defined in the servlet class scope in order to extract objects from session? BR -Original Message- From: Norris Shelton [mailto:[EMAIL PROTECTED] Sent: 07 ßíóàðè 2004 ã. 16:17 To: 'Tomcat Users List' Subject: TC 4.1.12 on Linux - session swapping We are running TC 4.1.12 on Linux. We have 8 different websites that run on tomcat. Most of them are low volume. We have encountered the problem where a test engine is executing multiple requests from multiple machines using multiple user accounts against a specific webapp. Sometimes the search results that come back are the search results for a query that was supposed to be ran by one of the other machines. Here is an example. Machine 1 - user 1 -query 1 Machine 2 - user 2 - query 2 machine 1 will sometimes get the results from query 2. The session information holds all of the information. This is from an internal test against a test server so there is no firewall, proxy, etc in the way. I have also been told that this has happened on one of our other web apps also. This time it was a production machine and one of our most used webapps. Any ideas? = Norris Shelton Software Engineer Sun Certified Java 1.1 Programmer Appriss, Inc. ICQ# 26487421 AIM NorrisEShelton YIM norrisshelton __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] = Norris Shelton Software Engineer Sun Certified Java 1.1 Programmer Appriss, Inc. ICQ# 26487421 AIM NorrisEShelton YIM norrisshelton __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Mapping /BAH/ to /
Howdy, Sure, make BAH a simple web application with just one class, a filter mapped to url-pattern /* that does a sendRedirect to / + the rest of the path. I don't know if that's simpler than a Valve, but it's portable. Apache's mod_rewrite can also do this, but you probably don't want to add the complexity of an apache-tomcat setup for this reason alone. Yoav Shapira Millennium ChemInformatics -Original Message- From: Green, Jeffrey [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 10:50 AM To: '[EMAIL PROTECTED]' Subject: Mapping /BAH/ to / Hi all. Quick question regarding Tomcat. I'd like to create a mapping such that all requests to http://hostname:8080/FOO/ http://hostname:8080/FOO/ are forwarded to http://hostname:8080/ http://hostname:8080/ in a transparent manner (to the user, at least). Thus, if there is a JSP at http://hostname:8080/FOO/bar/Page.jsp http://hostname:8080/FOO/bar/Page.jsp , users can access it by either going to that URL or to this url: http://hostname:8080/bar/Page.jsp http://hostname:8080/bar/Page.jsp . (Where BAR is the name of the webapp). Does anyone know if / how this can be done? I know one can implement such functionality using Valves, but I seek a simpler solution (if there is one). Thanks! --- --- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: TC 4.1.12 on Linux - session swapping
They are being posted to the same JSP. There are several beans that are page scope. Think that is it? I have a newer part that was written by me that uses request and session scope beans. I will have the QA person run her tests against that part of the project. I am assuming that this will be OK. If so, I will change the page scope beans to be request scope beans. Hopefully the problem will go away. I had noticed on other servers that if you have a request scope beans and you post back to the same page, you sometimes get back the same request. Usually not a problem, because it is yours. However, if this happens for page scope, then real bad, because everyone uses the page. I will let you know what we find. --- QM [EMAIL PROTECTED] wrote: : machine 1 will sometimes get the results from query 2. Smells like an instance/global variable where there shouldn't be one. Add that to a subtle race condition and you have the problem you've outlined. Are the queries being posted to the same servlet? -QM -- software -- http://www.brandxdev.net (C++ / Java / SSL) tech news -- http://www.RoarNetworX.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] = Norris Shelton Software Engineer Sun Certified Java 1.1 Programmer Appriss, Inc. ICQ# 26487421 AIM NorrisEShelton YIM norrisshelton __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Changing location of jk2.properties
Hi there, The jk2 documentation mentions that conf/jk2.properties is the *default* location for this file, which implies that it can be changed. However, I can't find any documentation indicating how this can be done. I have done a lot of digging through the source code, and I can see that the JkMain class *uses* the file, but I can't for the life of me figure out who calls JkMain.setPropertiesFile(). Does anyone have any idea if/how this file's location can be changed? Thanks in advance for any help. Andrew Kerr - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Mapping /BAH/ to /
Thanks for the response. How bout if I want the mapping to be for *all* webapps on the appserver? Eg, I want: http://hostname:8080/FOO/bar to map to /bar http://hostname:8080/FOO/sampleWebapp to map to /sampleWebapp http://hostname:8080/FOO/anotherWebapp to map to /anotherWebapp Etc for all webapps in the server. Is this behavior possible? -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 10:52 AM To: Tomcat Users List Subject: RE: Mapping /BAH/ to / Howdy, Sure, make BAH a simple web application with just one class, a filter mapped to url-pattern /* that does a sendRedirect to / + the rest of the path. I don't know if that's simpler than a Valve, but it's portable. Apache's mod_rewrite can also do this, but you probably don't want to add the complexity of an apache-tomcat setup for this reason alone. Yoav Shapira Millennium ChemInformatics -Original Message- From: Green, Jeffrey [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 10:50 AM To: '[EMAIL PROTECTED]' Subject: Mapping /BAH/ to / Hi all. Quick question regarding Tomcat. I'd like to create a mapping such that all requests to http://hostname:8080/FOO/ http://hostname:8080/FOO/ are forwarded to http://hostname:8080/ http://hostname:8080/ in a transparent manner (to the user, at least). Thus, if there is a JSP at http://hostname:8080/FOO/bar/Page.jsp http://hostname:8080/FOO/bar/Page.jsp , users can access it by either going to that URL or to this url: http://hostname:8080/bar/Page.jsp http://hostname:8080/bar/Page.jsp . (Where BAR is the name of the webapp). Does anyone know if / how this can be done? I know one can implement such functionality using Valves, but I seek a simpler solution (if there is one). Thanks! --- --- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Making index.jsp work as welcome page after upgrade
I realized that one and put it back. Still the same problem, unfortunately. I tried with both my webapp precompiled and not precompiled, both with index.jsp present. I even tried Tomcat's default ROOT webapp, same problem. Still just get the directory index. *sigh* -Original Message- From: news To: [EMAIL PROTECTED] Sent: 1/7/2004 10:40 PM Subject: Re: Making index.jsp work as welcome page after upgrade Talley, Angelina [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello! I just upgraded a web application from Tomcat 4.0.6/mod_jk 1.2.5 to Tomcat 4.1.29/mod_jk2 2.0.2 (built myself), both on Apache 1.3.27 on Linux. Our webapp runs as the ROOT context (files are in $TOMCAT_HOME/webapps/ROOT). We have precompiled the JSP pages for 4.1.29, but did not do that in 4.0.6. With Tomcat 4.x, you still need to have a physical 'index.jsp' file in the directory, even if you've precompiled it (this is no longer true for Tomcat 5.x). An empty file is good enough. Also, unless you're mapping everything to Tomcat, you need it so that Apache realizes that there is an index file there. On the old setup, to get to our application all you had to do was type https://myserver https://myserver and you'd get index.jsp by default. Now, if you type the URL like that you get a directory listing. You have to explicitly put index.jsp in the URL to get to it. If you do that, the entire web app works just fine. Is there some new configuration item I need to tweak here? I tried adding a segment for welcome-file-list to my web.xml: welcome-file-list welcome-fileindex.jsp/welcome-file /welcome-file-list But it still doesn't work. Any other suggestions would be greatly appreciated. I figured perhaps my workers2.properties was messed up, so I'll put a sample of that below. I made almost no changes at all to server.xml except to add tomcatAuthentication=false for the Coyote connector and to comment out the connector on port 8080. I should note that if run as Tomcat standalone (without Apache) on Windows (haven't tried Linux because of our authentication setup), it works perfectly. From workers2.properties: # # IP socket channel # [channel.socket:localhost:8009] port=8009 host=127.0.0.1 # # define the ajp13 worker # [ajp13:localhost:8009] channel=channel.socket:localhost:8009 # # Uri mapping - jsp files only # [uri:/*.jsp] group=ajp13:localhost:8009 # # Uri mapping - Struts stuff # [uri:/action/*] group=ajp13:localhost:8009 # # Uri mapping - all servlets in servlets directory # [uri:/servlets/*] group=ajp13:localhost:8009 From server.xml: !-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -- Connector className=org.apache.coyote.tomcat4.CoyoteConnector port=8009 minProcessors=5 maxProcessors=75 enableLookups=true redirectPort=8443 acceptCount=10 debug=0 connectionTimeout=0 useURIValidationHack=false tomcatAuthentication=false protocolHandlerClassName=org.apache.jk.server.JkCoyoteHandler/ Entire jk2.properties: # # Socket configuration # handler.list=request,container,channelSocket # # socket configuration # channelSocket.port=8009 channelSocket.address=127.0.0.1 channelSocket.maxPort=port+10 Thanks! -Angelina Talley - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Mapping /BAH/ to /
mod_proxy might work too (A *very* quick guess at syntax, ymmv) ProxyPass / http://more.cowbell.com/BAH/ ProxyPassReverse / http://more.cowbell.com/BAH/ -Tim Shapira, Yoav wrote: Howdy, Sure, make BAH a simple web application with just one class, a filter mapped to url-pattern /* that does a sendRedirect to / + the rest of the path. I don't know if that's simpler than a Valve, but it's portable. Apache's mod_rewrite can also do this, but you probably don't want to add the complexity of an apache-tomcat setup for this reason alone. Yoav Shapira Millennium ChemInformatics -Original Message- From: Green, Jeffrey [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 10:50 AM To: '[EMAIL PROTECTED]' Subject: Mapping /BAH/ to / Hi all. Quick question regarding Tomcat. I'd like to create a mapping such that all requests to http://hostname:8080/FOO/ http://hostname:8080/FOO/ are forwarded to http://hostname:8080/ http://hostname:8080/ in a transparent manner (to the user, at least). Thus, if there is a JSP at http://hostname:8080/FOO/bar/Page.jsp http://hostname:8080/FOO/bar/Page.jsp , users can access it by either going to that URL or to this url: http://hostname:8080/bar/Page.jsp http://hostname:8080/bar/Page.jsp . (Where BAR is the name of the webapp). Does anyone know if / how this can be done? I know one can implement such functionality using Valves, but I seek a simpler solution (if there is one). Thanks! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Making index.jsp work as welcome page after upgrade
Since I'm running with JK2 and went the workers2.properties route to configure it I don't have any JKMount statements anymore (I did with JK). FYI, we're running Apache 1.3.27. This is the relevant part of my workers2.properties: # # IP socket channel # [channel.socket:localhost:8009] port=8009 host=127.0.0.1 # # define the ajp13 worker # [ajp13:localhost:8009] channel=channel.socket:localhost:8009 # # Uri mapping - jsp files only # [uri:/*.jsp] group=ajp13:localhost:8009 # # Uri mapping - Struts stuff # [uri:/action/*] group=ajp13:localhost:8009 # # Uri mapping - all servlets in servlets directory # [uri:/servlets/*] group=ajp13:localhost:8009 -Original Message- From: Jeff Tulley To: [EMAIL PROTECTED] Sent: 1/7/2004 7:52 PM Subject: RE: Making index.jsp work as welcome page after upgrade What is your apache configuration, the JkMount statements and the like? It seems like there could be a problem there and the request is never getting to Tomcat for some reason [EMAIL PROTECTED] 1/7/04 2:55:41 PM I don't quite understand. I have the 8080 connector commented out since we don't want to use Tomcat as standalone. I was able to disable everything else and get Tomcat up and running standalone to verify that it worked, and it does. I just run into problems as I try to connect up to Apache. -Original Message- From: Andres Ledesma [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 5:00 PM To: Tomcat Users List Subject: Re: Making index.jsp work as welcome page after upgrade I was following this thread, And it occurs to me that instead of comment the port:8080 line, write port:80 give it a try !! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Jeff Tulley ([EMAIL PROTECTED]) (801)861-5322 Novell, Inc., The Leading Provider of Net Business Solutions http://www.novell.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Mapping /BAH/ to /
Mod_proxy does indeed do exactly what I'm asking for (in the Apache space) however, I'm looking to do this in the Tomcat space (without having Apache proxy to Tomcat). Any ideas? Thanks again! -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 11:01 AM To: Tomcat Users List Subject: Re: Mapping /BAH/ to / mod_proxy might work too (A *very* quick guess at syntax, ymmv) ProxyPass / http://more.cowbell.com/BAH/ ProxyPassReverse / http://more.cowbell.com/BAH/ -Tim Shapira, Yoav wrote: Howdy, Sure, make BAH a simple web application with just one class, a filter mapped to url-pattern /* that does a sendRedirect to / + the rest of the path. I don't know if that's simpler than a Valve, but it's portable. Apache's mod_rewrite can also do this, but you probably don't want to add the complexity of an apache-tomcat setup for this reason alone. Yoav Shapira Millennium ChemInformatics -Original Message- From: Green, Jeffrey [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 10:50 AM To: '[EMAIL PROTECTED]' Subject: Mapping /BAH/ to / Hi all. Quick question regarding Tomcat. I'd like to create a mapping such that all requests to http://hostname:8080/FOO/ http://hostname:8080/FOO/ are forwarded to http://hostname:8080/ http://hostname:8080/ in a transparent manner (to the user, at least). Thus, if there is a JSP at http://hostname:8080/FOO/bar/Page.jsp http://hostname:8080/FOO/bar/Page.jsp , users can access it by either going to that URL or to this url: http://hostname:8080/bar/Page.jsp http://hostname:8080/bar/Page.jsp . (Where BAR is the name of the webapp). Does anyone know if / how this can be done? I know one can implement such functionality using Valves, but I seek a simpler solution (if there is one). Thanks! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Mapping /BAH/ to /
Howdy, Thanks for the response. How bout if I want the mapping to be for *all* webapps on the appserver? Eg, I want: http://hostname:8080/FOO/bar to map to /bar http://hostname:8080/FOO/sampleWebapp to map to /sampleWebapp http://hostname:8080/FOO/anotherWebapp to map to /anotherWebapp Etc for all webapps in the server. Is this behavior possible? Take a look at the balancer webapp's URLStringMatchRule (Balancer ships with tomcat 5). It's perfect for your needs. You would add the balancer filter to your webapp and add a string match rule to balancer's rules.xml file for every case like the above 3. Yoav Shapira -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 10:52 AM To: Tomcat Users List Subject: RE: Mapping /BAH/ to / Howdy, Sure, make BAH a simple web application with just one class, a filter mapped to url-pattern /* that does a sendRedirect to / + the rest of the path. I don't know if that's simpler than a Valve, but it's portable. Apache's mod_rewrite can also do this, but you probably don't want to add the complexity of an apache-tomcat setup for this reason alone. Yoav Shapira Millennium ChemInformatics -Original Message- From: Green, Jeffrey [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 10:50 AM To: '[EMAIL PROTECTED]' Subject: Mapping /BAH/ to / Hi all. Quick question regarding Tomcat. I'd like to create a mapping such that all requests to http://hostname:8080/FOO/ http://hostname:8080/FOO/ are forwarded to http://hostname:8080/ http://hostname:8080/ in a transparent manner (to the user, at least). Thus, if there is a JSP at http://hostname:8080/FOO/bar/Page.jsp http://hostname:8080/FOO/bar/Page.jsp , users can access it by either going to that URL or to this url: http://hostname:8080/bar/Page.jsp http://hostname:8080/bar/Page.jsp . (Where BAR is the name of the webapp). Does anyone know if / how this can be done? I know one can implement such functionality using Valves, but I seek a simpler solution (if there is one). Thanks! -- - --- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- --- This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to
RE: Microsoft SQL Server validation query
Thank you to all of you for your quick replies. It seems that the connection pool validation query is not specific to any database server implementation unless the query statement itself is server-specific (that is, it refers to a special server system database, table, or function). I like the idea of querying the server for the date, but I'm not sure that the date function is standard SQL and portable across all server implementations. Does anyone know otherwise? Derek -Original Message- From: Peter Lin [mailto:[EMAIL PROTECTED] Sent: January 8, 2004 10:35 AM To: Tomcat Users List Subject: RE: Microsoft SQL Server validation query in the past I just select the date from sql server. unless you want to test a specific table, but that has potential performance impact. the safe simple query to see if sql server is alive is to just select the date. peter lin Allistair Crossley [EMAIL PROTECTED] wrote: I would not do that because that would return as many 1s as there are rows in the table. Something like count(*) may not be the most efficient but it returns just 1 row always. Also with using 1, you cannot guarantee a row will come back. Allistair Crossley __ Intranet Senior Developer New Media Group, QAS Ltd Telephone: 020 7819 5343 __ -Original Message- From: Michael Duffy [mailto:[EMAIL PROTECTED] Sent: 08 January 2004 15:25 To: Tomcat Users List Subject: RE: Microsoft SQL Server validation query Or even SELECT 1 FROM TABLE. No COUNT overhead, if any. - MOD --- Allistair Crossley wrote: i think you could use anything .. maybe SELECT COUNT(*) FROM table The dual table is an oracle dummy table and is quite handy, but I think the validation query can just be any old select statement that should return true a result always. ADC -Original Message- From: Derek Mahar [mailto:[EMAIL PROTECTED] Sent: 08 January 2004 15:15 To: Tomcat Users List Subject: Microsoft SQL Server validation query Does anyone happen to know which validation query I should use for Microsoft SQL Server? Derek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- QAS Ltd. Developers of QuickAddress Software www.qas.com Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Migrate Apache+Jserv to Tomcat
Hello. I am trying to migrate a web application from Apache+Jserv to Tomcat. Under Apache/htdocs I have a folder with the index.html and the applet in JAR format. The servlet zone folder contains the zone.properties, the servlets in JAR format and some other classes. How to deploy to Tomcat? I created a new context and copied to the document root all those files, but only the index.html and applets are visible! It seems that the servlets are not running. What are the right steps? Thanks in advance, Regards, Marco Roda
Tomcat error when accessing Apache Web Manager
Netware 6.5 Apache/2.0.48 mod_jk/1.2.5 Tomcat/4.1.28 When using the Apache Web Manager, some pages are inaccessible due to 500 errors (exact error follows...). None of the files for Web Admin have been modified nor has Tomcat orApache. One day it worked, the next it didn't. Error: HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:309) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:386) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:673) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:615) at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:786) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666) at java.lang.Thread.run(Thread.java:534) root cause java.lang.ClassCastException at org.apache.jsp.SingleServerStatus_jsp._jspService(SingleServerStatus_jsp.java:49) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416) at
RE: Retrieving the context path from a standalone class
AFAIK there's no way to get the HTML that a JSP page would show without an actual request. Right, which is why we need the context path. I think where we diverge is in our assesment of 'bad practice'. You had mentioned trouble with getRealPath(). Incorrect placement of a method in the API lead to some problems. Was using the API as it stood at the time, a 'bad practice' or was it a bad API decision that lead to problems. I think when something is deprecated, because it's later found out to be 'stoopid' or problematic, that's a bad API that's been fixed. From the API: Deprecated. As of Version 2.1 of the Java Servlet API, use ServletContext.getRealPath(java.lang.String) instead I find it kinda funny it got moved, rather than *re*moved. It's eventual home is more than ironic in the context of this discussion. (If it was in both places, and only one got removed, ignore what I just said). All I'm saying is.. where's the bad practice in trying to obtain a Context path from the ServletContext object? We can already do it from a Request. I agree about the separation of app develop and deployer. The deployer should be able to deploy to ANY context, and we as the developer shouldn't care about where. But that's my point. We don't want to hard code anything, we want to retrieve the appropriate value for one of our processes that *does* care about what the value is. Unless we go through a stupid hack, we're very limited in how we can retrieve this information, run-time. I argue for improved visibility of a method. the hack(s) I've used: Use an init-param, duplicating the information of context path, and no problem, because I'm the deployer AND developer, so I know to set both up correctly. use a starup servlet to request a JSP page. The JSP page now has a Request object. Obtain context path from there, and spin off your standalone class from the JSP. But after all, I've labelled those as 'hack'. It's all solved by having the appropriate method on the appropriate object. But then again, what do I know about it, I'm not part of the JSR, and I haven't been around since before JServ. But of course, this is OT by now, so I promise not to post again on this topic. :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
What replaced ApacheConfig in Tomcat 5
I'm trying to get the Automation of my apache mod_jk2 scripts to work but it seems that things have changed in Tomcat 5. Does anyone know how to do this with tomcat 5. The only thing I can find that comes close to the ApacheConfig class is GeneratorApache2 but from what I can tell this should be called from some other class and not in the server.xml file. Thanks. Matthew Scarrow ComIT Solutions Inc. www.comit.ca Paris: 519-442-0100 Brantford: 519-750-0933 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat 5.0.16 Replication
Hi Filip. I did some profiling of 40mins of tomcat with and without a 2nd node up. here are the results with -Xrunhprof:cpu=samples,thread=y,file=/u01/portal/java.hprof.txt,depth=10: Those number are cpu=times and not samples since the later one freezes on my systems. So that list shows the time spent in each methods. Major difference the some call to the sun.nio.ch.PollArrayWrapper class. I don't know much about those NIOs packages but 819000 call in 40 mins is a lot. The Socket Interface was called more than twice with 2 hosts than with a single one. Which seams normal. Maybe this can help. If you need the complete hprof file I can send them to you. 1 host in cluster: CPU TIME (ms) BEGIN (total = 19701) Thu Jan 8 10:00:59 2004 rank self accum count trace method 1 11.48% 11.48% 5485 java.lang.Object.wait 2 11.46% 22.94% 11786 java.lang.Object.wait 3 10.95% 33.89%4115 215 java.net.PlainDatagramSocketImpl.receive 4 10.93% 44.81%4114 224 java.lang.Thread.sleep 5 10.91% 55.73% 19005 214 sun.nio.ch.PollArrayWrapper.poll0 6 7.37% 63.09% 28 495 java.lang.Object.wait 7 7.24% 70.34% 10 576 java.lang.Object.wait 8 4.57% 74.90% 90 716 java.lang.Thread.sleep 9 4.48% 79.38% 1 909 java.lang.Object.wait 10 4.48% 83.86% 1 908 java.lang.Object.wait 11 4.48% 88.34% 15 810 java.lang.Object.wait 12 4.47% 92.81% 1 910 java.net.PlainSocketImpl.socketAccept 13 0.71% 93.52% 2 623 java.lang.Object.wait 14 0.56% 94.08% 2 706 java.lang.Object.wait 15 0.38% 94.46% 2 914 java.lang.Object.wait 16 0.24% 94.70% 775 913 java.lang.String.toCharArray 17 0.23% 94.93% 3 475 java.lang.Thread.sleep 18 0.16% 95.09% 2 472 java.lang.Object.wait 19 0.15% 95.24% 2 595 java.lang.Thread.sleep 20 0.15% 95.40% 2 586 java.lang.Thread.sleep 21 0.15% 95.55% 2 703 java.lang.Thread.sleep 22 0.15% 95.70% 2 476 java.lang.Thread.sleep 23 0.15% 95.85% 2 692 java.lang.Thread.sleep 24 0.12% 95.97% 218595 385 java.lang.CharacterDataLatin1.toLowerCase 25 0.12% 96.09% 218595 408 java.lang.Character.toLowerCase 26 0.11% 96.20% 218595 433 java.lang.CharacterDataLatin1.getProperties 27 0.10% 96.30% 210925 389 java.lang.String.equalsIgnoreCase 28 0.08% 96.38% 157259 387 java.lang.String.charAt 29 0.08% 96.46% 1 646 java.lang.Thread.sleep 30 0.08% 96.53% 1 634 java.lang.Thread.sleep 31 0.08% 96.61% 1 903 java.lang.Thread.sleep 32 0.08% 96.69% 1 714 java.lang.Thread.sleep 33 0.08% 96.76% 1 811 java.lang.Thread.sleep 34 0.08% 96.84% 1 715 java.lang.Thread.sleep 2 hosts: CPU TIME (ms) BEGIN (total = 37247) Thu Jan 8 11:01:28 2004 rank self accum count trace method 1 9.56% 9.56% 5285 java.lang.Object.wait 2 9.56% 19.12% 2986 java.lang.Object.wait 3 9.30% 28.43% 3 267 java.lang.Object.wait 4 9.25% 37.68%6644 224 java.lang.Thread.sleep 5 9.23% 46.91% 13116 215 java.net.PlainDatagramSocketImpl.receive 6 7.67% 54.58% 3 266 java.lang.Object.wait 7 5.90% 60.47% 39 847 java.lang.Object.wait 8 5.76% 66.24% 12 503 java.lang.Object.wait 9 3.90% 70.14% 145 975 java.lang.Thread.sleep 10 3.90% 74.04% 1 1174 java.lang.Object.wait 11 3.90% 77.94% 1 1173 java.lang.Object.wait 12 3.90% 81.84% 25 973 java.lang.Object.wait 13 3.90% 85.74% 1 1175 java.net.PlainSocketImpl.socketAccept 14 3.88% 89.62% 819692 214 sun.nio.ch.PollArrayWrapper.poll0 15 0.75% 90.37% 2 958 java.lang.Object.wait 16 0.28% 90.65% 2 457 java.lang.Object.wait 17 0.26% 90.91% 2 1181 java.lang.Object.wait Filip Hanik wrote: I'll try to get an instance going today. Will let you know how it goes also, try asynchronous replication, does it still go to 100%? Filip -Original Message- From: Steve Nelson [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 12:08 PM To: 'Tomcat Users List' Subject: RE: tomcat 5.0.16 Replication Okay, did that got this BEGIN TO RECEIVE SENT:Default 1 RECEIVED:Default 1 FROM /10.0.0.110: SENT:Default 2 BEGIN TO RECEIVE RECEIVED:Default 2 FROM /10.0.0.110: SENT:Default 3 BEGIN TO RECEIVE RECEIVED:Default 3 FROM /10.0.0.110: SENT:Default 4 BEGIN TO RECEIVE RECEIVED:Default 4 FROM /10.0.0.110: *shrug* BTW It didn't go to 100% CPU ute before I started using the code from CVS. Of course the Manager would almost always timeout before it would recieve the message. Now it gets the message right away, but maxes my machine out. -Original Message- From: Filip Hanik [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 1:58 PM To: Tomcat Users List Subject: RE: tomcat 5.0.16 Replication 100% cpu can mean that you have a multicast problem, try to run java -cp
Cross Site Scripting
Hi there, I'm using tomcat 4.1.29 (binary distribution) under Solaris 2.9 and I'm wondering, if there's a possibility to disable TRACE methods which are supposed to be enabled. I've been looking araoung the last couple of days and was unable to find anything good enough which would make me understand to solve this problem. Therefore I'd really appreciate your help. Best regards Matt __ Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Migrate Apache+Jserv to Tomcat
Howdy, You need to follow the deployment structure explained here: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/index.html Yoav Shapira Millennium ChemInformatics -Original Message- From: Marco Roda [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 11:11 AM To: [EMAIL PROTECTED] Subject: Migrate Apache+Jserv to Tomcat Hello. I am trying to migrate a web application from Apache+Jserv to Tomcat. Under Apache/htdocs I have a folder with the index.html and the applet in JAR format. The servlet zone folder contains the zone.properties, the servlets in JAR format and some other classes. How to deploy to Tomcat? I created a new context and copied to the document root all those files, but only the index.html and applets are visible! It seems that the servlets are not running. What are the right steps? Thanks in advance, Regards, Marco Roda This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Microsoft SQL Server validation query
off hand I know selecting the date from sybase, sql server and oracle are all different. one way around it is to use a stored procedure, that way you can have the same stored proc in each RDBMS and the java call is the same. I'm sure others have done it a different way, but that's how I've tackled the problem in the past. peter Derek Mahar [EMAIL PROTECTED] wrote: Thank you to all of you for your quick replies. It seems that the connection pool validation query is not specific to any database server implementation unless the query statement itself is server-specific (that is, it refers to a special server system database, table, or function). I like the idea of querying the server for the date, but I'm not sure that the date function is standard SQL and portable across all server implementations. Does anyone know otherwise? Derek - Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes