Re: Tomcat 3.3: ThreadPool bug (IS IT SAFE FOR PRODUCTION USE???)
Are you using Tomcat standalone or with Apache? If standalone, then yes, I would recommend using the latest version of Tomcat 4.x. If you're using Apache, I would stick with 3.3 until the mod_jk code is fully implemented with the 4.x versions. Thanks, --jeff - Original Message - From: [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Saturday, December 29, 2001 2:09 PM Subject: Tomcat 3.3: ThreadPool bug (IS IT SAFE FOR PRODUCTION USE???) Hi there, I am trying to deploy our production service on the Tomcat 3.3 platform (Solaris8, JDK 1.3.1) but am very often facing the instability problems. Somehow, the ThreadPool just runs out of steam and blocks Connectors from receiving any more requests. Looking into the source code, I have noticed some very interesting constructions in the ThreadPool class. Namely, the setters for the maxThreads, maxSpareThreads and minSpareThreads are having very little influence as the start() method is resseting the values to the default constants ?!?! public ThreadPool() { maxThreads = MAX_THREADS; maxSpareThreads = MAX_SPARE_THREADS; minSpareThreads = MIN_SPARE_THREADS; currentThreadCount = 0; currentThreadsBusy = 0; stopThePool = false; } public synchronized void start() { stopThePool=false; currentThreadCount = 0; currentThreadsBusy = 0; maxThreads = MAX_THREADS; maxSpareThreads = MAX_SPARE_THREADS; minSpareThreads = MIN_SPARE_THREADS; adjustLimits(); openThreads(minSpareThreads); monitor = new MonitorRunnable(this); } Also, the situation when there are no more available Threads in the pool is being handled in a special way which JUST BLOCKS IN THE INFINITE LOOP : -((( Is the code of the Tomcat4 equaly immature or there is a fair chance to role a productiv system on top of it? Thanks in advance for any comments Drasko Kokic -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Stability of Tomcat 3.3 vs. 4.0
Unfortunately, Tomcat 4.x doesn't support load-balancing, yet -- even with mod_jk. So, if you need it, you should stick with 3.3. Thanks, --jeff - Original Message - From: Hunter Hillegas [EMAIL PROTECTED] To: Tomcat User List [EMAIL PROTECTED] Sent: Tuesday, December 18, 2001 10:31 AM Subject: Re: Stability of Tomcat 3.3 vs. 4.0 I would suggest Tomcat 4.0 because it is integrated into Jboss which gives you a MAJOR speed up between the servlet layer and the Jboss layer. Major speed up. From: Wilson, Wayne [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] Date: Tue, 18 Dec 2001 13:21:34 -0500 To: Tomcat Users List (E-mail) [EMAIL PROTECTED] Subject: Stability of Tomcat 3.3 vs. 4.0 Hi, Because of some deadlock bugs in Tomcat 3.2.3 that we are experiencing (891, 1006 1798), we are going to have to switch to either Tomcat 3.3 or 4.X. What do people think about the stability of each of these versions? We will be running this on W2K in conjunction with JBoss and because we need load balancing we will be using mod_jk. What do you think? --Wayne -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Ever increasing heap size with Tomcat 3.2.3 !!!
I believe you need to supply the '-server' switch at startup to the JVM to be in server mode. Try dropping that switch, if you're using it. Personally, I recommend you check out the IBM JDK, too. You can install both and easily switch between them by modifying your JAVA_HOME environment variable. Thanks, --jeff - Original Message - From: Hawkins, Keith (Keith) [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, December 18, 2001 10:09 AM Subject: RE: Ever increasing heap size with Tomcat 3.2.3 !!! John, Thanks for the reply. How do I tell whether I am using the server JVM or the client JVM you mentioned? Thanks, Keith -Original Message- From: John Freeborg [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 18, 2001 1:08 PM To: Tomcat Users List Subject: RE: Ever increasing heap size with Tomcat 3.2.3 !!! Which JVM are you using? On Windows 2K w/ SP2 I found that the Sun JDK 1.3.1 server hotspot JVM crashed and burned running Tomcat 4.0.1 this way within 24 hours easily. A few others emailed me about it also. Switching to the Sun JDK 1.3.1 client hotspot JVM magically fixed this. Now my server runs for weeks without crashing. Might be the same issue with Tomcat 3.2.3 - try it. I was going to try an IBM JDK also, but never got around to it once I had it working. - John -Original Message- From: Randy Layman [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 18, 2001 11:07 AM To: Tomcat Users List Subject: RE: Ever increasing heap size with Tomcat 3.2.3 !!! -Original Message- From: Hawkins, Keith (Keith) [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 18, 2001 12:34 PM To: [EMAIL PROTECTED]; tomcat-user Subject: Ever increasing heap size with Tomcat 3.2.3 !!! Are there known issues with Tomcat and heap size?? No. Doing a web search revealed numerous posts with people having similar problems so I believe there is a problem. The standard response these people receive is to increase the heap size via -Xmx But that seems like a band-aid rather than a real solution. That just delays the inevitable. The problem is always that they are holding onto memory that they don't realize they are holding on to, or are expecting to be garbage collected but can't for whatever reason. Here are some suggestions on where to look: 1. Don't use class variables in servlets or JSPs 2. Be careful with sessions. Setting the inactive timeout to nothing allows the sessions to stay around until the server is reset, and sessions last for some time after the last request 3. Understand that it anything has a reference to an object (list, map, array) then it can't be garbage collected 4. Use a program like OptimizeIT! to find your memory leak -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: There's 6 mod_jk's? Which one?
You can also run your httpd binary from the command line with the -V switch: [root@www /root]# httpd -V This will print out all the options that your apache binary was compiled with. If you see a line like this: -D EAPI Then your apache binary was compiled with EAPI and you need the EAPI version of mod_jk. If not, use the noeapi version. Thanks, --jeff - Original Message - From: Allan Tomalesky [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, December 17, 2001 1:41 PM Subject: Re: There's 6 mod_jk's? Which one? Hi, If you are using apache 1.3.x use ap13 (apache 2.0 try ap20). Try each of the two *.so, if it's the wrong one you will get an error message (eapi or noeapi) depending on which apache binary you are using. Good luck. -allan Scott Merritt wrote: Ok... I see in the compiled dir for Linux, 6 mod_jk's... How do I determine if my Apache web server is compiled with eapi or not? Also how do I know if I get the one for ap13 or ap20? I'm using Tomcat 4... mod_jk-3.3-ap13-eapi.so23-Oct-2001 12:52 93K mod_jk-3.3-ap13-eapi.so.asc23-Oct-2001 12:53 285 mod_jk-3.3-ap13-noeapi.so 23-Oct-2001 12:53 93K mod_jk-3.3-ap13-noeapi.so.asc 23-Oct-2001 12:53 285 mod_jk-3.3-ap20.so 23-Oct-2001 12:54 114K mod_jk-3.3-ap20.so.asc Thanks.. -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: How to Increasing Tomcat memory?
Hi Jack, You should use the TOMCAT_OPTS environment variable to set these options. So, create an environment variable called TOMCAT_OPTS and set it equal to the following: -Xms32M -Xmx64M This will set the initial size of the JVM heap to 32MB and the max size to 64MB. Replace these values with whatever you require and you're all set. The startup script for Tomcat looks for the TOMCAT_OPTS env. variable and automatically appends it's contents to the command line when starting the JVM. I recommend that you upgrade to at least version 3.2.4, due to security bugs that have been fixed in 3.2.1 and 3.2.2. None of your configuration files need to be changed. Just swap out the jar files in your TOMCAT_HOME/lib directory with the new ones. Thanks, --jeff - Original Message - From: Jack Li [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 18, 2001 1:44 PM Subject: How to Increasing Tomcat memory? Hi, I need to allocate more memory to Tomcat 3.2.1. How can I do it? I know to put -Xms somewhere. What is the exact lines to put and where to put the line? Thanks, Jack -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: This is unbelievably Hard, please help!!!
Hi Brandon, I recommend that you use the mod_jk from the 3.3 distribution. I'm not sure if all the bug fixes have been back-ported to the 3.2.x version. Also, the 3.3 version lets you restart Tomcat without having to restart Apache. Anyway, download the 3.3 bundle (jakarta-tomcat-3.3-src.tar.gz) from: http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.3/src/ gunzip and untar it and then cd to the src/native/mod_jk/apache1.3 directory. Copy the Makefile.linux to Makefile and then type make. Took about 10 seconds to compile on my stock RedHat 7.1 installation. Copy the resulting mod_jk.so to your apache libexec directory and you should be set. Thanks, --jeff - Original Message - From: Brandon Cruz [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Wednesday, December 12, 2001 9:46 AM Subject: This is unbelievably Hard, please help!!! I am trying to compile mod_jk.c on linux redhat 7.1. I seem to have gotten the file to compile after making some changes in mod_jk.c, the resulting mod_jk.so is 18000 bytes. Apache will not start when using this file. I am using the tomcat 3.2.4 documentation to compile. I see that there is a Makefile.linux in the directory, but this does not work either. Is there anyone that can help me to accomplish this task? I am stuck and have been working on it forever!!! -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Change an include file requires re-compiling all JSP that include it (?)
If your included files don't contain any JSP code, you can use the jsp:include... / directive. This directive includes the file at request time, rather than page translation time -- so changes to your included file will show up immediately. If your included files contain JSP code, then you're stuck with using the %@ include... % and you'll need to recompile all your JSPs whenever the included file changes. Thanks, --jeff - Original Message - From: Scott Hodson [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, December 11, 2001 10:58 AM Subject: RE: Change an include file requires re-compiling all JSP that include it (?) 1) Where do they go? I don't see them anywhere under my webapp's folder (I thought they go in WEB-INF/classes but they're not there) 2) Blech, that's what I do now. If I have 100 JSP files all including the same header file I'm doomed! -Original Message- From: James Chuang [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 11, 2001 10:06 AM To: Tomcat Users List Subject: Re: Change an include file requires re-compiling all JSP that include it (?) A couple of things you can do, both would be easier than resaving all the JSPs 1. Delete the generated class files... 2. Touch the JSP files. - Original Message - From: Scott Hodson [EMAIL PROTECTED] To: Tomcat User [EMAIL PROTECTED] Sent: Tuesday, December 11, 2001 10:00 AM Subject: Change an include file requires re-compiling all JSP that include it (?) I come from an ASP background where we would frequently change include files and see the results immediately. However, in JSP, since JSP pages are compiled into servlet classes, if I change an include file the JSP file including it won't get re-compiled because the JSP hasn't changed, just the include file. Even if I restart Tomcat it still won't recompile the JSPs. So for now every time I make a change to an include file I have to re-save all of my JSPs so Tomcat forces a recompile. That's a big pain. Can somebody help me out here? Is there a way to force re-compilation of JSPs if the files they include ever change? ___ Scott Hodson (949) 709-4496 office (949) 709-3890 fax [EMAIL PROTECTED] http://www.ubero.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Unable to include *.sum files (Again)
Hi Jonathon, Well, obviously, I agree with you. I think the most interesting point you bring up is the fact that %@ include...% works with any file extension, whether or not it has a registered MIME type. Why should jsp:include.../ add additional restrictions? I understand the difference between the two -- page translation time vs. request time -- but don't understand why they act differently. I've gone through the JSP spec for both of them and can find nothing that requires the MIME type of the included file to be a registered text/* type. Can anybody give a plausible reason why one requires the MIME type to be registered while the other does not? Thanks, --jeff - Original Message - From: Kusel, Jonathan J [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Sunday, December 09, 2001 10:14 PM Subject: RE: Unable to include *.sum files (Again) Hi all, Thanks for all the responses(including the debate) to this question! It made some real interesting reading material after the SHORT weekend! To get back to August's suggestion: we've tried it but our problem is that the file content is generated by a VB program and contains some funny characters e.g. CPI rather than CPI. When we translate these to a string it either comes out as ?CPI? or as illustrated in the attached image(This is also how it displays in JBuilder). Regarding the debate I tend to agree with Jeff. If you want to display the pure contents of a file you should be able to include the file using jsp:include without having to define a mime type. I mean what happens if you want to include a code example, for example a code snippet that illustrates how to code something in C,C++,Java etc. If you define the mime type it will try to translate it, which is not what we want in this case... You could define it as type text but now you need to maintain two mime types for one extension? Just doesn't sound right to me. The other thing that bothers me is the fact that it works for the %@ include...% directive but not for the jsp:include.../ surely they should perform similar actions simply using a different syntax? Thanks again, Jonathan -Original Message- From: August Detlefsen [mailto:[EMAIL PROTECTED]] Sent: 09 December 2001 01:53 To: Tomcat Users List Subject: Re: Unable to include *.sum files (Again) If it does use PrintWriter to write the output, then it makes sense for it to only output text. See this from the PrintWriter javadoc: Print formatted representations of objects to a text-output stream. This class implements all of the print methods found in PrintStream. It does not contain methods for writing raw bytes, for which a program should use unencoded byte streams. If you want to include files of non-text types (or types that are text, but not included in your MIME types list), why not just write a utility method that opens a file, reads it and returns its contents as a String? -August --- Micael Padraig Og mac Grene [EMAIL PROTECTED] wrote: At 08:22 PM 12/7/01 -0800, you wrote: Yeah, see my last post. Since JSP output is written with a PrintWriter, the Catalina code is restricting it to only being able to output known text/* MIME types. This just doesn't feel right to me. Thanks, --jeff Well, jeff, then it is not a bug. At best it is a difference of opinion. That makes all the sense in the world to me. If you want to bring in something other than the known 'text/* MIME types, just include the proper code in your include? We have differing intuitions here. I think what Catalina is doing is proper and makes sense. But, at worst for you, it is an inconvenience. Right? -- micael -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] Disclaimer and Confidentiality Note. Everything in this e-mail and attachments relating to the official business of Standard Bank Investment Corporation(Stanbic) is proprietary to the company. It is confidential, legally privileged and protected by law. Stanbic does not own and endorse any other content. Views and opinions are those of the sender unless clearly stated as being that of Stanbic. The person addressed in the e-mail is the sole authorised recipient. Please notify the sender immediately if it has unintentionally reached you and do not read, disclose or use the content in any way. Stanbic can not assure that the integrity of this communication has been maintained nor that it is free of
Re: Unable to include *.sum files (Again)
We're going an awfully long way here to solve what could be cleanly done with a simple: jsp:include page=relativeURL flush=true / Don't you think? All the container has to do is default the MIME type for unknown extensions to text/html. Remember this is a JSP -- a scripting language which was originally designed to simplify life for web designers and other non-programmers. Having to open every included file manually with java code defeats that purpose. Thanks, --jeff - Original Message - From: August Detlefsen [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, December 10, 2001 1:21 PM Subject: RE: Unable to include *.sum files (Again) What text format are your .sum files using? Sounds like it may be UTF8. Try this: /** * Returns the String contents of a UTF8 file. * * This method throws any fileIO errors. * * @param sFileName Full file path. * @return String The contents of the file as a String object. * @throws Exception Any fileIO errors */ public static String getUTF8FileAsString(String sFileName) throws Exception { RandomAccessFile inputFile = new RandomAccessFile(sFileName,r); String output = inputFile.readUTF(); inputFile.close(); return output; } This method should work if your files are in ASCII: /** * Returns the String contents of an ASCII file. * * This method throws any fileIO errors. * * @param sFileName Full file path. * @return String The contents of the file as a String object. * @throws Exception Any fileIO errors */ public static String getFileAsString(String sFileName) throws Exception { RandomAccessFile inputFile = new RandomAccessFile(sFileName,r); byte[] inputbytes = new byte[(int)inputFile.length()]; int numread = inputFile.read(inputbytes); inputFile.close(); return new String(inputbytes); } --- Micael Padraig Og mac Grene [EMAIL PROTECTED] wrote: At 08:14 AM 12/10/01 +0200, you wrote: Hi all, Thanks for all the responses(including the debate) to this question! It made some real interesting reading material after the SHORT weekend! To get back to August's suggestion: we've tried it but our problem is that the file content is generated by a VB program and contains some funny characters e.g. CPI rather than CPI. When we translate these to a string it either comes out as ?CPI? or as illustrated in the attached image(This is also how it displays in JBuilder). Regarding the debate I tend to agree with Jeff. If you want to display the pure contents of a file you should be able to include the file using jsp:include without having to define a mime type. I mean what happens if you want to include a code example, for example a code snippet that illustrates how to code something in C,C++,Java etc. If you define the mime type it will try to translate it, which is not what we want in this case... You could define it as type text but now you need to maintain two mime types for one extension? Just doesn't sound right to me. The other thing that bothers me is the fact that it works for the %@ include...% directive but not for the jsp:include.../ surely they should perform similar actions simply using a different syntax? Thanks again, Jonathan I still don't see, Jonathan, why you don't just use code in your include which catches the mime types and deals with them? Why is the include important to you in the first instance? I think the people in this list might be able to help you, if we knew what the facets of the problem are. This sounds like a problem that can be solved, but I am not sure what the situation is. Micael -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Unable to include *.sum files (Again)
I'm not so sure. The JSP spec doesn't say anything about having to register the MIME type of a file before using it in a jsp:include directive. Consider how difficult that would be if you were generating dynamic filenames with extensions like .001, .002, .003, etc... You could potentially have to register several hundred (even thousand) meaningless MIME types. Also, think about what webservers do when they encounter an unknown MIME type -- they default back to text/html (or whatever you have set as your default...). Why should a JSP be more strict than this with it's include directive? The file you are including is required to be a valid URL -- which means it could be accessed via the webserver anyway. Remember, Tomcat is the RI and should implement the spec as closely as possible. I've gone back and looked through my books on JSP, and every one of them says that you can use any file extension with the jsp:include directive. However, none of them say you have to register that extension as a valid MIME type first. At the very least, it's confusing for someone who expects it to work when it doesn't -- especially when there's no documentation on it. Thanks, --jeff - Original Message - From: Micael Padraig Og mac Grene [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Saturday, December 08, 2001 10:12 AM Subject: Re: Unable to include *.sum files (Again) At 08:22 PM 12/7/01 -0800, you wrote: Yeah, see my last post. Since JSP output is written with a PrintWriter, the Catalina code is restricting it to only being able to output known text/* MIME types. This just doesn't feel right to me. Thanks, --jeff Well, jeff, then it is not a bug. At best it is a difference of opinion. That makes all the sense in the world to me. If you want to bring in something other than the known 'text/* MIME types, just include the proper code in your include? We have differing intuitions here. I think what Catalina is doing is proper and makes sense. But, at worst for you, it is an inconvenience. Right? -- micael -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Unable to include *.sum files (Again)
Ok, but what happens if you don't have control of the included file? Your database or other source produces dynamic reports for you and you need to include them into your JSPs. My question is this: if nearly every webserver on the planet can use a default MIME type of text/html, why can't this? That would solve the problem. Restricting output to registered MIME types seems a little heavy handed to me. Thanks, --jeff - Original Message - From: Micael Padraig Og mac Grene [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Saturday, December 08, 2001 2:58 PM Subject: Re: Unable to include *.sum files (Again) At 02:51 PM 12/8/01 -0800, you wrote: I don't think the spec is that detailed -- I mean, it doesn't come out and say the page attribute of jsp:include has to follow the requirements of the JspWriter. So, I don't know the answer to that. Remember though, we're talking about included files -- by their very nature, they don't necessarily represent *entire* files. They may only be pieces of a bigger file that is ultimately displayed to the surfer. I can understand that the file sent to the browser must have a sensible MIME type, but must all the pieces that the file is built from also have registered MIME types? I'm not sure that makes sense. Also, I always thought MIME types, in this context, were available so the browser could decipher what kind of file was being retrieved and display that file correctly. I never thought MIME types would be used to limit my flexibility with JSPs in this way. Thanks, --jeff I understand what you are saying, Jeff. But the bottom line is that the JspWriter is the source of the out implicit object in this instance. Apparently your bottom line is that you want to use the extension to pass information, instead of an extension in any true sense. I think it is a little harsh to have them expect that use. That said, and I may be wrong, why not toss the 'dynamic values in prior to the extension and trick the JspWriter, e.g. instead of com.site.123 us com.site.123.txt or com.site.123.jsp. You are going to have to have a class read the url in any event. The other way is to put your dynamic information inside the included tidbit. That seems more intuitive to me than using an extension for information anyway. Just a thought. -- micael -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Unable to include *.sum files (Again)
I agree that there are workarounds -- there are always workarounds -- but Tomcat is the RI, so this is the place where we're supposed to figure this stuff out. I guess my argument is that Tomcat is being more restrictive than the spec requires it to be. Whether that's acceptable or not is ultimately up to the tomcat dev team. Thanks, --jeff - Original Message - From: Micael Padraig Og mac Grene [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Saturday, December 08, 2001 4:27 PM Subject: Re: Unable to include *.sum files (Again) At 03:53 PM 12/8/01 -0800, you wrote: If it does use PrintWriter to write the output, then it makes sense for it to only output text. See this from the PrintWriter javadoc: Print formatted representations of objects to a text-output stream. This class implements all of the print methods found in PrintStream. It does not contain methods for writing raw bytes, for which a program should use unencoded byte streams. If you want to include files of non-text types (or types that are text, but not included in your MIME types list), why not just write a utility method that opens a file, reads it and returns its contents as a String? -August Yah, August, we all agree on that. Jeff is thinking that the specifications are not clear enough. Just a difference of style I suppose. Thanks for your input. -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Unable to start tomcat 4
I don't think Tomcat 4 will run with jdk1.1.8. Try upgrading to jdk1.2 or later. --jeff - Original Message - From: Emil Diego [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, December 07, 2001 11:29 AM Subject: Unable to start tomcat 4 Hello all, I have installed Tomcat 4.0.1 onto a Linux box. I am having trouble getting it started. When i type tomcat4 start, I get the following response. Using CLASSPATH:/var/tomcat4/bin/.bootstrap.jar Using CATALINA_BASE:/var/tomcat4 Using CATALINA_HOME:/var/tomcat4 Using JAVA_HOME:/usr/jdk1.1.8/ then when i look at the catalina.log file i see the following entry Unable to initilize threads: cannot find class java/lang/Thread For some reason it is failing. If anyone has any ideas, please let me know. Thanx Emil Diego [EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Unable to include *.sum files (Again)
Nope. I tried it with *.doc files, too, and it still doesn't work. *.doc is defined in web.xml. Besides, it doesn't really make sense for MIME types to affect included files, does it? --jeff - Original Message - From: August Detlefsen [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, December 07, 2001 12:40 PM Subject: Re: Unable to include *.sum files (Again) I am totally guessing, but maybe you have to define a MIME type for .sum files in your web.xml (and perhaps also where Apache configures MIME types?)? HTH, -August --- Kusel, Jonathan J [EMAIL PROTECTED] wrote: Hi all, I've mailed the follwoing to the tomcat users group but nobody has responded yet so I took the liberty of posting it again. Here's the message: I'm trying to include normal text files with .sum extensions using the jsp:include directive: 'jsp:include page=testTxt.sum flush=true /' but tomcat throws an exception(see bottom for the exception). When I change the file's extension to .txt for example it works, but the files that I wan't to include are generated by another program on a daily basis so changing the extension is not an option. When I use the '%@include file=testTxt.sum %' directive it works, but I need to use the jsp:include since the filenames are dynamically generated. Is this a bug or am I doing something wrong? I'm using tomcat4.0 for NT 4.0. THE STACKTRACE: ApplicationDispatcher[/interestrates]: Servlet.service() for servlet default threw exception java.lang.IllegalStateException at org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(Serv letResponseWrapperInclude.java:109) at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.jav a:1143) at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:519) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher. java:679) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatch er.java:570) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher .java:493) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:8 18) at org.apache.jsp.test$jsp._jspService(test$jsp.java:67) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja va:202) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:201) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :163) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at
Re: Unable to include *.sum files (Again)
Hi Micael, Let's make sure we're talking about the same thing. If I include a file like: jsp:include page=./testTxt.sum flush=true / Why does it matter what the file extension of the included file is? Isn't the container just supposed to open the file and output it's contents at that particular spot in my JSP? Now, I agree that the contents of the included file will be affected by the MIME type of the response -- how the browser views those contents. If you include a file that doesn't match the MIME type of your response, it may not appear correctly in your browser. But that's not the point. The JSP spec says the page attribute must evaluate to a String that is a relative URL specification. When I pull up the testTxt.sum file in my browser, it displays correctly (it's only one line of text...). So, I should be able to include it in my JSP with the jsp:include directive. When I change the extension to .txt, .html, or .jsp it works. Anything else, even other registered MIME types like .doc, and it doesn't. (ok, I didn't try them ALL... :) I think this is a bug. The old Java Web Server used to have a similar bug where it would only include .htm and .html files. --jeff - Original Message - From: Micael Padraig Og mac Grene [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, December 07, 2001 1:37 PM Subject: Re: Unable to include *.sum files (Again) At 01:31 PM 12/7/01 -0800, you wrote: Nope. I tried it with *.doc files, too, and it still doesn't work. *.doc is defined in web.xml. Besides, it doesn't really make sense for MIME types to affect included files, does it? --jeff I may be out to lunch here, Jeff, but it seems to me that it makes all the sense in the world for an included file to be affected by its MIME type. -- micael -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Unable to include *.sum files (Again)
If it does, then it's violating the spec. The spec doesn't specify any extensions that can or cannot be included. It just says it has to be a String that is a relative URL. The string ./myText.foo satisfies that and the file myText.foo pulls up correctly in my browser with the following content: This is the myText.foo file! However, when you include the myText.foo file using the jsp:include directive, you get an exception. I think that's a bug. My setup is TC 4.0.1 stand-alone on RedHat 7.1 using the IBM JDK 1.2 -- in case anyone was wondering... --jeff - Original Message - From: August Detlefsen [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, December 07, 2001 2:16 PM Subject: Re: Unable to include *.sum files (Again) It might, if somewhere in the code of the jsp:include tag it specifies to only include a file if it is of a relevant mime type, say JSP, text/xyz, or image/abc. This would prevent the server from sending out potentially damaging stuff with the include tag, like .java or .exe files. Again, I am just speculating... --- Jeff Kilbride [EMAIL PROTECTED] wrote: Nope. I tried it with *.doc files, too, and it still doesn't work. *.doc is defined in web.xml. Besides, it doesn't really make sense for MIME types to affect included files, does it? --jeff - Original Message - From: August Detlefsen [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, December 07, 2001 12:40 PM Subject: Re: Unable to include *.sum files (Again) I am totally guessing, but maybe you have to define a MIME type for .sum files in your web.xml (and perhaps also where Apache configures MIME types?)? HTH, -August --- Kusel, Jonathan J [EMAIL PROTECTED] wrote: Hi all, I've mailed the follwoing to the tomcat users group but nobody has responded yet so I took the liberty of posting it again. Here's the message: I'm trying to include normal text files with .sum extensions using the jsp:include directive: 'jsp:include page=testTxt.sum flush=true /' but tomcat throws an exception(see bottom for the exception). When I change the file's extension to .txt for example it works, but the files that I wan't to include are generated by another program on a daily basis so changing the extension is not an option. When I use the '%@include file=testTxt.sum %' directive it works, but I need to use the jsp:include since the filenames are dynamically generated. Is this a bug or am I doing something wrong? I'm using tomcat4.0 for NT 4.0. THE STACKTRACE: ApplicationDispatcher[/interestrates]: Servlet.service() for servlet default threw exception java.lang.IllegalStateException at org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(Serv letResponseWrapperInclude.java:109) at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.jav a:1143) at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:519) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher. java:679) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatch er.java:570) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher .java:493) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:8 18) at org.apache.jsp.test$jsp._jspService(test$jsp.java:67) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja va:202) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943
Re: Does Tomcat support Server Push?
It's not Tomcat, it's the browser. IE doesn't support server push -- which I think is stupid, but I'm sure there's a reason. Netscape is the only browser I know that supports multipart/x-mixed-replace. --jeff - Original Message - From: Bill Taylor [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, December 07, 2001 10:13 AM Subject: Does Tomcat support Server Push? A content type of multipart/x-mixed-replace;boundary=End\n \n --End\n Content type: text/html\n document --End\n \n Supposedly lets the server push a new page image to the client at will. I have tried to do this with Tomcat by setting the content type and sending successive pages in a loop, but all the pages come out as text at the same time. Is there a known way to support server push with Tomcat? Thanks. Bill Taylor -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Unable to include *.sum files (Again)
Yeah, see my last post. Since JSP output is written with a PrintWriter, the Catalina code is restricting it to only being able to output known text/* MIME types. This just doesn't feel right to me. Thanks, --jeff - Original Message - From: Micael Padraig Og mac Grene [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, December 07, 2001 7:40 PM Subject: Re: Unable to include *.sum files (Again) At 02:21 PM 12/7/01 -0800, you wrote: Hi Micael, Let's make sure we're talking about the same thing. If I include a file like: jsp:include page=./testTxt.sum flush=true / Why does it matter what the file extension of the included file is? Isn't the container just supposed to open the file and output it's contents at that particular spot in my JSP? Now, I agree that the contents of the included file will be affected by the MIME type of the response -- how the browser views those contents. If you include a file that doesn't match the MIME type of your response, it may not appear correctly in your browser. But that's not the point. The JSP spec says the page attribute must evaluate to a String that is a relative URL specification. When I pull up the testTxt.sum file in my browser, it displays correctly (it's only one line of text...). So, I should be able to include it in my JSP with the jsp:include directive. When I change the extension to .txt, .html, or .jsp it works. Anything else, even other registered MIME types like .doc, and it doesn't. (ok, I didn't try them ALL... :) I think this is a bug. The old Java Web Server used to have a similar bug where it would only include .htm and .html files. --jeff Before I look further, have you looked at the source code to see why this is happening? -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Double check idiom broken - Tomcat uses it ?
If you really want the developers to take a look at this, you should probably post it to the tomcat-dev list. It's iffy whether or not they will see it here. Thanks, --jeff - Original Message - From: java programmer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, December 05, 2001 10:44 PM Subject: Double check idiom broken - Tomcat uses it ? Hi all: We all know that the lazy-double-check idiom doesn't apply to Java because of the Java Memory Model (JMM). That is to say, look at code such as: Example a) // Set by any other thread other than #1 volatile boolean stop = false; // Thread #1 runs this as long as // stop is false. Only T1 will call this // method, so not synchronized. hence // broken due to staleness of 'stop'. // synch for _visbility_ ALSO. void foo() { while (!stop ) { //... } } Example b): The lazy double check idiom public static Foo haha = null; public static getFoo() { if (foo == null ) { sychronized (Foo.class) { if (foo == null ) foo = new Foo(); } } return foo; } Both examples are *guaranteed* to be incorrect. Note, this is the case, *even* though I am using 'volatile' for the stop variable. For more on the JMM, consult Item #48 in Effective Java (Josh Bloch), look at Bill Pughs' page at: http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html or check out Doug Lea's stuff. Well, here is the thing: Quite idly, and randomly, I was looking at: org.apache.jasper.servlet.JspServlet and I found: snip outDated = compiler.isOutDated(); if(!jsw.isInstantiated() || outDated ) { synchronized(jsw){ outDated = compiler.compile(); if(!jsw.isInstantiated() || outDated) { if( null ==ctxt.getServletClassName() ) { snip This is a complex use of double check type code and is really hard to analyse because references themselves and what they point to can have different levels of staleness (according to the JMM). So it's a turbo double idiom type usage, possibly incorrect. I just wanted to bring this to the attention of the development team and make sure that *someone* has really analysed this according to the JMM. (and any other code, similar to this). Best regards, [EMAIL PROTECTED] __ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Authentication problem...redirected to /null
You're not supposed to be able to reach the login page, except by accessing a secure page. The container is then responsible for displaying the login page and sending the user to the correct secure page, once they have been authenticated. So, rather than having a link to your login page from your home page, you should have a link to your main welcome page inside your secure area. Tomcat will then send the user to the login page automatically, if they haven't been authenticated. What version of Tomcat are you using? Unfortunately, in TC 3.2.x (possibly others, but I'm not sure) the container *redirects* the user to the login page which makes it possible for the user to then bookmark that page -- thus defeating the idea that they have to access a secure page first. The only way I found to get around this was to put my login page in a separate /login directory and then put an index.jsp file in that directory that redirects to my secure area. That way, anyone who bookmarked the login page was handled correctly. I'm not sure if this will work in other versions of Tomcat, though. Hope this helps! --jeff - Original Message - From: John Mikhail [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, December 05, 2001 5:36 PM Subject: Authentication problem...redirected to /null Hello, I'm wondering if anyone can help me with an issue I'm having with my web app. I have a web application that uses the JDBCRealm and I've defined all the roles and what not. Here's the scenario... If I try to access a secure page, it will take me to the login page. I login with a valid user and then get redirected back to the secure page with no problems now that I'm authenticated. That's not the problem. The problem is I can also login from the home page. If I log in from the home page with the same authenticated user, it tomcat is trying to redirect me to context/null. Why is that? I have a welcome file list defined in my web.xml. If anyone can help, it would be greatly appreciated.. -- John Mikhail Codito, Ergo Sum -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: tomcat configuration error
Hi Larry, I thought for all 3.2.x versions, you could just replace the old jar files with the new ones. Is this not true for 3.2.4? Thanks, --jeff - Original Message - From: Larry Isaacs [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Thursday, December 06, 2001 5:55 AM Subject: RE: tomcat configuration error Note that you say you are configuring Tomcat 3.2.4 but are setting TOMCAT_HOME to tomcat-3.2.1. If you are copying Tomcat 3.2.4 on top of a Tomcat 3.2.1 installation, be aware that this is an untested form of installation. I would recommend installing Tomcat 3.2.4 in a new directory and updating the configuration and web apps to match your 3.2.1 installation. Normally the Unable to set CLASSPATH dynamically ... Setting your CLASSPATH statically message is just a warning. However, in Tomcat 3.2.4 this represents an error. Tomcat 3.2.4 includes JAXP 1.1 as the XML parser (consisting of jaxp.jar and crimson.jar) where Tomcat 3.2.3 and earlier included JAXP 1.0.1 (consisting of jaxp.jar and parser.jar). Note that with 3.2.4, it is crimson.jar that is found in the TOMCAT_HOME/lib, not parser.jar. There is a bug in the tomcat.bat file where it tries to build the CLASSPATH setting staticially, i.e. with a bunch of SET commands. This portion of the batch file is only used on Win9x systems when a directory in the TOMCAT_HOME path isn't a DOS 8.3 name. This portion of tomcat.bat still specifies parser.jar instead of crimson.jar. Change all parser.jar references to crimson.jar in tomcat.bat and you should be okay. You could also do what the message says and manually set your TOMCAT_HOME using DOS 8.3 names, (i.e. SET TOMCAT_HOME=C:\TOMCAT~1 ), or make sure all directories in the path to Tomcat are DOS 8.3 names, (i.e. C:\Jakarta\Tc324 ). This would allow the CLASSPATH to be build automatically to include all jars found in TOMCAT_HOME\lib. Hope this helps. Cheers, Larry -Original Message- From: gaurang khatri [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 06, 2001 1:45 AM To: [EMAIL PROTECTED] Subject: tomcat configuration error hello all, I am gaurang. I am new to this group. I am trying to configure tomcat 3.2.4. My JAVA_HOME is c:\jdk1.3.1_01 and TOMCAT_HOME is tomcat-3.2.1. I have set JAVA_HOME and TOMCAT_HOME in tomcat.bat. I have also tried tomcat~1.4 in TOMCAT_HOME but getting the same result. Now when I am trying to run tomcat start or startup from the bin directory of tomcat, I am getting following error. I dont know why I am getting this error. -- Unable to set CLASSPATH dynamically. Note: To set the CLASSPATH dynamically on Win9x systems only DOS 8.3 names may be used in TOMCAT_HOME! Setting your CLASSPATH statically. Using CLASSPATH: Starting Tomcat in new window -- and the tomcat is not started in new window. I am using the japanese version of windows 98. Can anybody tell me what is wrong with this. It is very urgent. So, please help me. Thanks to all gaurang. __ __ For Stock Quotes, Finance News, Insurance, Tax Planners, Mutual Funds... Visit http://in.finance.yahoo.com/ -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: ONE More Time! why does Tomcat 4 work this way
What about just /images/butterfly.jpg? This assumes that your webapp is rooted at /bbb -- so you don't need to use that as part of your path. This is what I normally use with mod_jk. Don't know if it will work with mod_webapp, though. --jeff - Original Message - From: Brian Adams [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Thursday, December 06, 2001 11:12 AM Subject: RE: ONE More Time! why does Tomcat 4 work this way there must be some sort of filter tag being enforced by tomcat 4.0 that make me define the images directory before I just start using it... any hints? -Original Message- From: Carsten Lingemann [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 06, 2001 1:31 PM To: 'Tomcat Users List' Subject: RE: ONE More Time! why does Tomcat 4 work this way have you tried the following: img border=0 src=%= request.getContextPath() %/images/butterfly.jpg Carsten -Original Message- From: Brian Adams [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 06, 2001 2:04 PM To: '[EMAIL PROTECTED]' Subject: ONE More Time! why does Tomcat 4 work this way I hace Apache with WebApp warping to tomcat my jsp page has this image: img border=0 src=/bbb/images/butterfly.jpg The web-app is named bbb and it has a directory called images. The jsp page WILL NOT SHOW THIS IMAGE!!! If I change it to: img border=0 src=http://localhost/bbb/images/butterfly.jpg; It works fine and fast! WHAT THE F*(* is up with my config or Tomcat??? my warp definition is: everything that has a bbb after the url warps to Tomcat WebAppConnection conn warp localhost:8008 WebAppDeploy examples conn /examples WebAppDeploy bbb conn /bbb Am I missing something in my web.xml that should say how to handle the images folder? B -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Setting the alocated memory to Tomcat 4.0.1
Hi Niclas, You should really do this using the environment variable CATALINA_OPTS. That's what it's designed for. Set up an environment variable called CATALINA_OPTS and set it's value to -Xmssize -Xmxsize. The easiest way to do this is by right-clicking on your My Computer icon and then selecting the Environment tab. Thanks, --jeff - Original Message - From: Niclas Rothman [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Thursday, December 06, 2001 11:30 AM Subject: SV: Setting the alocated memory to Tomcat 4.0.1 Okey Bo! It works now if I startup the Tomcat throug startup.bat but it still doesn´t work when I try to start the beast as a NT service. Any further suggestions? Niclas -Oprindelig meddelelse- Fra: Bo Xu [mailto:[EMAIL PROTECTED]] Sendt: 6. december 2001 19:50 Til: Tomcat Users List Emne: Re: Setting the alocated memory to Tomcat 4.0.1 Hi Niclas, I am not sure because I didn't ever use -Xms/-Xmx to customize catalina.bat, I guess there are two reasons: - did you update all _RUNJAVA/_STARTJAVA... start in catalina.bat? in the the following(from TC4.0), there are 4 _RUNJAVA/_STARTJAVA... start. :doRun if %2 == -security goto doRunSecure %_RUNJAVA% %CATALINA_OPTS% -Dcatalina.base=%CATALINA_BASE% -Dcatalina.home=%CATALINA _HOME% org.apache.catalina.startup.Bootstrap %2 %3 %4 %5 %6 %7 %8 %9 start goto cleanup :doRunSecure %_RUNJAVA% %CATALINA_OPTS% -Djava.security.manager -Djava.security.policy==%CATALINA_B ASE%/conf/catalina.policy -Dcatalina.base=%CATALINA_BASE% -Dcatalina.home =%CATALINA_HOME% org.apache.catalina.startup.Bootstrap %3 %4 %5 %6 %7 %8 %9 start goto cleanup :doStart if %2 == -security goto doStartSecure %_STARTJAVA% %CATALINA_OPTS% -Dcatalina.base=%CATALINA_BASE% -Dcatalina.home=%CATALINA _HOME% org.apache.catalina.startup.Bootstrap %2 %3 %4 %5 %6 %7 %8 %9 start goto cleanup :doStartSecure echo Using Security Manager %_STARTJAVA% %CATALINA_OPTS% -Djava.security.manager -Djava.security.policy==%CATALINA_B ASE%/conf/catalina.policy -Dcatalina.base=%CATALINA_BASE% -Dcatalina.home =%CATALINA_HOME% org.apache.catalina.startup.Bootstrap %3 %4 %5 %6 %7 %8 %9 start goto cleanup - does anybody know if -Xms/-Xmx will increase allocated memory in every JVM/OS combination? or it only work in some of them? Thanks in advance! Bo Dec.06, 2001 - Original Message - From: Niclas Rothman [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Thursday, December 06, 2001 1:27 PM Subject: SV: Setting the alocated memory to Tomcat 4.0.1 Hi Bo! Thank´s for your reply, but I seem to have no luck with this. Have done a little jsp file that prints out the free memory and total memory of the JVM and doesn´t seem to change. Maybe I´ve missunderstood your reply, I´ve just added -Xms -Xmx to the end of the line: %CATALINA_OPTS% -Dcatalina.base=%CATALINA_BASE% -Dcatalina.home=%CATALINA _HOME% org.apache.catalina.startup.Bootstrap %2 %3 %4 %5 %6 %7 %8 %9 start So the result is: %CATALINA_OPTS% -Dcatalina.base=%CATALINA_BASE% -Dcatalina.home=%CATALINA _HOME% org.apache.catalina.startup.Bootstrap %2 %3 %4 %5 %6 %7 %8 %9 start -Xms100663296 -Xmx134217728 What do say is this approach right or wrong? Best regards Niclas Rothman -Oprindelig meddelelse- Fra: Bo Xu [mailto:[EMAIL PROTECTED]] Sendt: 6. december 2001 19:10 Til: Tomcat Users List Emne: Re: Setting the alocated memory to Tomcat 4.0.1 - Original Message - From: Niclas Rothman [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Thursday, December 06, 2001 12:52 PM Subject: Setting the alocated memory to Tomcat 4.0.1 Hi everybody! I´m using Tomcat 4.0.1 and the version with the Windows NT service. Does anybody know where to set the size for the memory to allocate to the Tomcat (-Xms -Xmx), can´t find any documentation about this. Best reqards Niclas Rothman I am not sure, I think you can add it in catalina.bat in CATALINA_HOME/bin, for example, update the following: * _STARTJAVA * %_STARTJAVA% %CATALINA_OPTS% -Dcatalina.base=%CATALINA_BASE% -Dcatalina.home=%CATALINA _HOME% org.apache.catalina.startup.Bootstrap %2 %3 %4 %5 %6 %7 %8 %9 start and add java -Xmsn/-Xmxn into them. Bo Dec.06, 2001 -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To
Re: ONE More Time! why does Tomcat 4 work this way
Dude, you're watching this list WAY too closely! You're average response time is 2.5 minutes... :) --jeff - Original Message - From: Brian Adams [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Thursday, December 06, 2001 12:35 PM Subject: RE: ONE More Time! why does Tomcat 4 work this way I think that is what I would like to do after looking WAY TOO CLOSE at this. Patrick I know your out there *peer* what do you say? Let's move to mod_jk *point* B -Original Message- From: Jeff Kilbride [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 06, 2001 2:57 PM To: Tomcat Users List Subject: Re: ONE More Time! why does Tomcat 4 work this way Personally, I would drop mod_webapp in favor of mod_jk, if you really need to run a separate web server. TC 4 was the first release of mod_webapp, while mod_jk has been around much longer -- and is better tested. AFAIK, there was only one guy working on mod_webapp and he announced he was taking a long vacation a few weeks ago. I don't know if anybody has picked up where he left off. TC 4.0.1 has a configuration line for mod_jk already included in server.xml. Looking through the list lately, a large percentage of the messages I see all relate to problems with mod_webapp. Your call... --jeff P.S. -- I've found TC 4 to be faster without the use of Apache. I use a small footprint webserver (i.e. Acme's thttpd or Dan Bernstein's publicfile) to serve images from another port (81) and let TC handle all the dynamic stuff -- I don't have any non-dynamic html files on my site... - Original Message - From: Brian Adams [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Thursday, December 06, 2001 12:15 PM Subject: RE: ONE More Time! why does Tomcat 4 work this way I tried that and it does not work either. I noticed that the examples that come with tomcat 4 does not show the images also! This is definitely a problem with WebAPP. I can connect to Tomcat directly 8080 and it works fine. I've seen others on the list server asking about the same problem... Who is in charge of WebApp developement? Their List Serve? B -Original Message- From: Jeff Kilbride [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 06, 2001 2:36 PM To: Tomcat Users List Subject: Re: ONE More Time! why does Tomcat 4 work this way What about just /images/butterfly.jpg? This assumes that your webapp is rooted at /bbb -- so you don't need to use that as part of your path. This is what I normally use with mod_jk. Don't know if it will work with mod_webapp, though. --jeff - Original Message - From: Brian Adams [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Thursday, December 06, 2001 11:12 AM Subject: RE: ONE More Time! why does Tomcat 4 work this way there must be some sort of filter tag being enforced by tomcat 4.0 that make me define the images directory before I just start using it... any hints? -Original Message- From: Carsten Lingemann [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 06, 2001 1:31 PM To: 'Tomcat Users List' Subject: RE: ONE More Time! why does Tomcat 4 work this way have you tried the following: img border=0 src=%= request.getContextPath() %/images/butterfly.jpg Carsten -Original Message- From: Brian Adams [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 06, 2001 2:04 PM To: '[EMAIL PROTECTED]' Subject: ONE More Time! why does Tomcat 4 work this way I hace Apache with WebApp warping to tomcat my jsp page has this image: img border=0 src=/bbb/images/butterfly.jpg The web-app is named bbb and it has a directory called images. The jsp page WILL NOT SHOW THIS IMAGE!!! If I change it to: img border=0 src=http://localhost/bbb/images/butterfly.jpg; It works fine and fast! WHAT THE F*(* is up with my config or Tomcat??? my warp definition is: everything that has a bbb after the url warps to Tomcat WebAppConnection conn warp localhost:8008 WebAppDeploy examples conn /examples WebAppDeploy bbb conn /bbb Am I missing something in my web.xml that should say how to handle the images folder? B -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED
Re: ONE More Time! why does Tomcat 4 work this way
Sorry, but I forgot to mention that your other option would be to pull the latest mod_webapp code from CVS and see if that helps. I just checked the dev list and it looks like somebody is working on it -- though I don't know who... --jeff - Original Message - From: Brian Adams [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Thursday, December 06, 2001 12:35 PM Subject: RE: ONE More Time! why does Tomcat 4 work this way I think that is what I would like to do after looking WAY TOO CLOSE at this. Patrick I know your out there *peer* what do you say? Let's move to mod_jk *point* B -Original Message- From: Jeff Kilbride [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 06, 2001 2:57 PM To: Tomcat Users List Subject: Re: ONE More Time! why does Tomcat 4 work this way Personally, I would drop mod_webapp in favor of mod_jk, if you really need to run a separate web server. TC 4 was the first release of mod_webapp, while mod_jk has been around much longer -- and is better tested. AFAIK, there was only one guy working on mod_webapp and he announced he was taking a long vacation a few weeks ago. I don't know if anybody has picked up where he left off. TC 4.0.1 has a configuration line for mod_jk already included in server.xml. Looking through the list lately, a large percentage of the messages I see all relate to problems with mod_webapp. Your call... --jeff P.S. -- I've found TC 4 to be faster without the use of Apache. I use a small footprint webserver (i.e. Acme's thttpd or Dan Bernstein's publicfile) to serve images from another port (81) and let TC handle all the dynamic stuff -- I don't have any non-dynamic html files on my site... - Original Message - From: Brian Adams [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Thursday, December 06, 2001 12:15 PM Subject: RE: ONE More Time! why does Tomcat 4 work this way I tried that and it does not work either. I noticed that the examples that come with tomcat 4 does not show the images also! This is definitely a problem with WebAPP. I can connect to Tomcat directly 8080 and it works fine. I've seen others on the list server asking about the same problem... Who is in charge of WebApp developement? Their List Serve? B -Original Message- From: Jeff Kilbride [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 06, 2001 2:36 PM To: Tomcat Users List Subject: Re: ONE More Time! why does Tomcat 4 work this way What about just /images/butterfly.jpg? This assumes that your webapp is rooted at /bbb -- so you don't need to use that as part of your path. This is what I normally use with mod_jk. Don't know if it will work with mod_webapp, though. --jeff - Original Message - From: Brian Adams [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Thursday, December 06, 2001 11:12 AM Subject: RE: ONE More Time! why does Tomcat 4 work this way there must be some sort of filter tag being enforced by tomcat 4.0 that make me define the images directory before I just start using it... any hints? -Original Message- From: Carsten Lingemann [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 06, 2001 1:31 PM To: 'Tomcat Users List' Subject: RE: ONE More Time! why does Tomcat 4 work this way have you tried the following: img border=0 src=%= request.getContextPath() %/images/butterfly.jpg Carsten -Original Message- From: Brian Adams [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 06, 2001 2:04 PM To: '[EMAIL PROTECTED]' Subject: ONE More Time! why does Tomcat 4 work this way I hace Apache with WebApp warping to tomcat my jsp page has this image: img border=0 src=/bbb/images/butterfly.jpg The web-app is named bbb and it has a directory called images. The jsp page WILL NOT SHOW THIS IMAGE!!! If I change it to: img border=0 src=http://localhost/bbb/images/butterfly.jpg; It works fine and fast! WHAT THE F*(* is up with my config or Tomcat??? my warp definition is: everything that has a bbb after the url warps to Tomcat WebAppConnection conn warp localhost:8008 WebAppDeploy examples conn /examples WebAppDeploy bbb conn /bbb Am I missing something in my web.xml that should say how to handle the images folder? B -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL
Re: ONE More Time! why does Tomcat 4 work this way
I believe it's in the jakarta-tomcat-connectors module. --jeff - Original Message - From: Brian Adams [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Thursday, December 06, 2001 1:17 PM Subject: RE: ONE More Time! why does Tomcat 4 work this way clue please. were is mod_webapp code? no see cvs module -Original Message- From: Jeff Kilbride [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 06, 2001 3:09 PM To: Tomcat Users List Subject: Re: ONE More Time! why does Tomcat 4 work this way Sorry, but I forgot to mention that your other option would be to pull the latest mod_webapp code from CVS and see if that helps. I just checked the dev list and it looks like somebody is working on it -- though I don't know who... --jeff - Original Message - From: Brian Adams [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Thursday, December 06, 2001 12:35 PM Subject: RE: ONE More Time! why does Tomcat 4 work this way I think that is what I would like to do after looking WAY TOO CLOSE at this. Patrick I know your out there *peer* what do you say? Let's move to mod_jk *point* B -Original Message- From: Jeff Kilbride [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 06, 2001 2:57 PM To: Tomcat Users List Subject: Re: ONE More Time! why does Tomcat 4 work this way Personally, I would drop mod_webapp in favor of mod_jk, if you really need to run a separate web server. TC 4 was the first release of mod_webapp, while mod_jk has been around much longer -- and is better tested. AFAIK, there was only one guy working on mod_webapp and he announced he was taking a long vacation a few weeks ago. I don't know if anybody has picked up where he left off. TC 4.0.1 has a configuration line for mod_jk already included in server.xml. Looking through the list lately, a large percentage of the messages I see all relate to problems with mod_webapp. Your call... --jeff P.S. -- I've found TC 4 to be faster without the use of Apache. I use a small footprint webserver (i.e. Acme's thttpd or Dan Bernstein's publicfile) to serve images from another port (81) and let TC handle all the dynamic stuff -- I don't have any non-dynamic html files on my site... - Original Message - From: Brian Adams [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Thursday, December 06, 2001 12:15 PM Subject: RE: ONE More Time! why does Tomcat 4 work this way I tried that and it does not work either. I noticed that the examples that come with tomcat 4 does not show the images also! This is definitely a problem with WebAPP. I can connect to Tomcat directly 8080 and it works fine. I've seen others on the list server asking about the same problem... Who is in charge of WebApp developement? Their List Serve? B -Original Message- From: Jeff Kilbride [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 06, 2001 2:36 PM To: Tomcat Users List Subject: Re: ONE More Time! why does Tomcat 4 work this way What about just /images/butterfly.jpg? This assumes that your webapp is rooted at /bbb -- so you don't need to use that as part of your path. This is what I normally use with mod_jk. Don't know if it will work with mod_webapp, though. --jeff - Original Message - From: Brian Adams [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Thursday, December 06, 2001 11:12 AM Subject: RE: ONE More Time! why does Tomcat 4 work this way there must be some sort of filter tag being enforced by tomcat 4.0 that make me define the images directory before I just start using it... any hints? -Original Message- From: Carsten Lingemann [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 06, 2001 1:31 PM To: 'Tomcat Users List' Subject: RE: ONE More Time! why does Tomcat 4 work this way have you tried the following: img border=0 src=%= request.getContextPath() %/images/butterfly.jpg Carsten -Original Message- From: Brian Adams [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 06, 2001 2:04 PM To: '[EMAIL PROTECTED]' Subject: ONE More Time! why does Tomcat 4 work this way I hace Apache with WebApp warping to tomcat my jsp page has this image: img border=0 src=/bbb/images/butterfly.jpg The web-app is named bbb and it has a directory called images. The jsp page WILL NOT SHOW THIS IMAGE!!! If I change it to: img border=0 src=http://localhost/bbb/images/butterfly.jpg; It works fine and fast! WHAT THE F*(* is up with my config or Tomcat??? my warp definition is: everything that has a bbb after the url warps to Tomcat WebAppConnection conn warp localhost:8008 WebAppDeploy examples conn
Re: benchmarking Tomcat4?
Not free, but you can get a free trial: http://www.webperformanceinc.com/ Thanks, --jeff - Original Message - From: Matt Egyhazy [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, November 29, 2001 5:52 AM Subject: Re: benchmarking Tomcat4? http://jakarta.apache.org/jmeter/index.html matt - Original Message - From: J. Eric Smith [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 27, 2001 5:06 PM Subject: benchmarking Tomcat4? Has anyone tried benchmarking Tomcat4 versus some of the commercial engines like Websphere or Weblogic? If so, what did you find out? Also, I'd like to bench my setups to get a feel for where they top out. Any suggestions on what to use? We've used the gasp Microsoft web stress tool up to this point in informal testing of Weblogic and such and it's been quite good on Weblogic, but the results it gives using Tomcat4 are not repeatable and are very ambiguous. Anything out there better that's free? J. Eric Smith [EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Tomcat 4.01 classloader - HELP!
Hi Chris, I don't know the answer to this, but you may be better off posting it to the tomcat-dev list. Thanks, --jeff - Original Message - From: Chris Malley [EMAIL PROTECTED] To: tomcat-user [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, November 29, 2001 8:31 AM Subject: Tomcat 4.01 classloader - HELP! I've posted this query a couple of times with no response. (See subject Tomcat 4.01 classloader problem?.) One last try before I give up on Tomcat 4.01... I'm experiencing a problem with SOAP message-style services when using Tomcat 4.01. Folks on the soap-user mailing list suggested that this may be a classloader problem in Tomcat 4.01. When trying to access any message-style SOAP service, my client receives a no signature match fault. I have no problem with RPC-style SOAP services, the same message-style SOAP services work fine with Tomcat 3.2.3, and the signature of the my message-style services is of the correct form; ie: public void serviceName( Envelope env, SOAPContext req, SOAPContext res ) throws IOException, MessagingException; What makes me think that this is a classloader problem is that I can make the fault go away by removing $CATALINA_HOME/webapps/soap/WEB-INF/classes/org/. But I don't understand why this makes the fault go away, and it's clearly an unacceptable hack. Is anyone else experiencing this problem? Complete details, source example, and steps to reproduce were in my previous post, which I can post again if someone is willing to look at this. Thanks, -Chris -- Chris Malley PixelZoom, Inc. Voice: +1.303.494.8849 835 Orman Drive EMail: [EMAIL PROTECTED] Boulder CO 80303-2616 -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Tomcat 3.2.3 Memory Exception running on HP-UX 11
For Tomcat 3.2.x, the environment variable is TOMCAT_OPTS. Thanks, --jeff - Original Message - From: Chris Newland [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, November 29, 2001 8:40 AM Subject: RE: Tomcat 3.2.3 Memory Exception running on HP-UX 11 Hi Mike, If you are not explicitly setting the JVM initial heap size and maximum heap size then they will take the default values which are quite small (64MByte max I think?). If you want the JVM to use more of the system's memory then start it up using the switches: -Xms initial heap size -Xmx maximum heap size (This is for the Sun 1.3 JVM, but I expect the HP JVM has an equivalent) so for 100MB initial heap, 150MB maximum heap you would change your startup script to override the defaults: java -Xms100M -Xmx150M classname In catalina.sh (Tomcat 4) there is an environment variable CATALINA_OPTS that will add extra parameters to the java command so I just set CATALINA_OPTS= -Xms500M -Xmx1000M. There may be a similar option in Tomcat 3.2.3. Hope this helps, Chris -Original Message- From: Michael S. Ricker [mailto:[EMAIL PROTECTED]] Sent: 29 November 2001 16:01 To: [EMAIL PROTECTED] Subject: Tomcat 3.2.3 Memory Exception running on HP-UX 11 Hello, Attempted to make 5 simultaneous connections to Tomcat 3.2.3 on HP-UX 11 and received the following exception. Tomcat is being run with HP Java 1.3 without any specific command line parameters. The HP server had 200mb real/300mb virtual memory free when monitoring with the top command. Any suggestions to prevent this exception? 2001-11-29 16:39:54 - ThreadPool: Caught exception executing org.apache.tomcat.service.TcpWorkerThread@dc81fb1e, terminating thread - java.lang.OutOfMemoryError: can't create another thread at java.lang.Thread.start(Native Method) at org.apache.tomcat.util.ThreadPool$ControlRunnable.init(ThreadPool.java, Compiled Code)at org.apache.tomcat.util.ThreadPool.openThreads(ThreadPool.java, Compiled Code) at org.apache.tomcat.util.ThreadPool.runIt(ThreadPool.java, Compiled Code) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java, Compiled Code) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code) at java.lang.Thread.run(Unknown Source) Mike -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: CVS
Anybody interested in CVS should take a look at the online version of Karl Fogel's book: cvsbook.red-bean.com It helped me get up and running with CVS in about a day. Thanks, --jeff - Original Message - From: Ralph Einfeldt [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Tuesday, November 20, 2001 7:54 AM Subject: AW: CVS See below: -Ursprüngliche Nachricht- Von: Laurent Michenaud [mailto:[EMAIL PROTECTED]] Gesendet: Dienstag, 20. November 2001 16:12 An: Tomcat Users List Betreff: RE: CVS We prefer to use cvs rather than Ms SafeSource. I was asking still questions : - What's better ? a repository for each project or a module for each project ? We don't use either, the projects are simple sub directories under one root in the repository. - Is it a good idea to use CVS for binary files ? i was thinking about class files, and all the jpeg/gif files... In general yes. But I would just put class files in the repository if they are not build from sources. And make shure that you use/configure cvs correct to handle binaries. (Otherwise you might expierence some surprises.) - What would do the site construction script ? pre-compile the jsp and the servlet maybe ? Have u got examples of script that i could see ? Checkout all needed files for a given tag. Compile the java classes, make a jar of them, fill a test database. In our environment we have several files that are the same over the project that are placed outside the project directory. Our installation script copies these files in the deployment site where our webserver runs and mixes them withe project specific files. We have automated the setup of a webserver, so that we can setup a new instance of the same project in few minutes once we have defined all configration parameters. (Even the initial setup of new project doesn't take much longer) This we use to build the web server up to several times a day. The examples won't help you much because they still work with good old JServ. - I think we will need differents branches : - one for each stable release - one for a beta developpement but fonctionnal, few bugs. - one for an alpha developpment, used to backup the progress I wouldn't do to much branches. Just use Tags to mark this versions. works( i am hesitating here with a branch for each developper ). A clear NO! to this approach. For example, a developper that has not finished a work at the end of the day will update the alpha branch. If a developer isn't ready, the he shouldn't checkin. So the your alpha branch is just the developers workplace in my world. (What do you win with this checkin ?) A developper will update the beta branch when he thinks his source is quite ok. The stable release will be built after hard testing of the global application. - Last question : which utils do u use for cvs ? there is wincvs, i've seen webcvs too. Are there any others ? We use WinCVS, XEmacs and the command line interface -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: LinkageError running 4.0.1 on IBM 1.3.0 VM
Hi Robin, I'm using the IBM JDK on Linux (RH7.1 w/2.4.14 kernel) with TC 4.0.1 without any problems. The only difference I can see from your setup is that my JAVA_HOME variable points to the toplevel of the IBM directory structure: /usr/local/java/IBMJava2-13 not /usr/local/java/IBMJava2-13/jre I get this output when I run startup.sh: --- Using CLASSPATH: /usr/local/java/jakarta-tomcat-4.0.1/bin/bootstrap.jar:/usr/local/java/IBMJa va2-13/lib/tools.jar Using CATALINA_BASE: /usr/local/java/jakarta-tomcat-4.0.1 Using CATALINA_HOME: /usr/local/java/jakarta-tomcat-4.0.1 Using JAVA_HOME: /usr/local/java/IBMJava2-13 --- Notice that the CLASSPATH contains the tools.jar file. On yours it doesn't. Don't know if this will make a difference or not, but I don't see anything else that's obvious. Thanks, --jeff - Original Message - From: robin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, November 19, 2001 10:09 AM Subject: LinkageError running 4.0.1 on IBM 1.3.0 VM Hi, I'm trying to run Tomcat 4.0.1 under the IBM JVM 1.3.0. If I start by unpacking the archive, and then use the startup.sh script, after setting my path and unsetting my classpath I get the following output from the scripts: Starting... Using CLASSPATH: /usr/local/jakarta-tomcat//bin/bootstrap.jar Using CATALINA_BASE: /usr/local/jakarta-tomcat/ Using CATALINA_HOME: /usr/local/jakarta-tomcat/ Using JAVA_HOME: /usr/local/IBMJava2-13/jre/ This seems healthy enough, but logs/catalina.out contains: Catalina.start: LifecycleException: start: : java.lang.LinkageError: Class java/net/URL violates loader constraints LifecycleException: start: : java.lang.LinkageError: Class java/net/URL violates loader constraints at java.lang.Throwable.init(Throwable.java:84) at java.lang.Exception.init(Exception.java:35) at org.apache.catalina.LifecycleException.init(LifecycleException.java:126) at org.apache.catalina.loader.WebappLoader.start(WebappLoader.java:641) [ etc. etc. ] Which is decidedly less healthy, and the server won't respond to any requests. I tried the same thing using sun's jdk 1.2.2, and got: Starting... Using CLASSPATH: /usr/local/jakarta-tomcat//bin/bootstrap.jar:/usr/local/jdk1.2.2//lib/tools. jar Using CATALINA_BASE: /usr/local/jakarta-tomcat/ Using CATALINA_HOME: /usr/local/jakarta-tomcat/ Using JAVA_HOME: /usr/local/jdk1.2.2/ from the script, and a working server. The platform is linux 2.2.12-20 on a PIII. After I hit this problem, I tried building from source under the IBM jvm, mainly to see whether it would throw up anything useful. I hit on a 'sealing violation' right at the beginning of the build, in ANT, and this reproduced on the sun jvm . I am aware that this means that there are more than one jar containing members of a package and at least one of them is sealed. I tried clearing the classpath altogether, but got the same problem. In any case - all I want is a binary version which works with the IBM vm. Am I doing something obviously wrong? Thanks. -Robin Barooah -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: AW: Java program interferring with Tomcat
Sure it does. Changing the transaction isolation level affects how data is read from the database. TRANSACTION_READ_COMMITTED waits for a read lock before reading data and ensures that the data being read is in a consistent state. Lower isolation levels may allow data to be read that's inconsistent -- data from a transaction that hasn't been committed, yet, and therefore may be rolled back. However, that doesn't mean lower isolation levels are bad. They can relieve a lot of locking contention on the database when used with queries that don't need perfectly consistent data. It just depends on how critical the info you're pulling with this particular query is. For example: are you tallying the number of visitors to your website or are you doing financial transactions? With the former, reading dirty data may not matter that much. With the latter, it may be critical that you have consistent data. If your data's not that critical, you may get a lot of benefit from lowering your transaction isolation level. Thanks, --jeff - Original Message - From: David Frankson [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, November 19, 2001 11:42 AM Subject: Re: AW: Java program interferring with Tomcat Not with SQL Server. If thread A has a write lock on a table, thread b will wait until the write is completed before reading. If thread A is in a transaction that is long running then a perfectly funcitoning application can seem to hang. Its also possible that some form of infinite loop or deadlock in thread A could cause it to never release the transaction, making you either kill the application or use Enterprise Manager to kill the lock. Does changing the transaction isolation level affect things? The tomcat application is a high traffic transactional system, and the commandline app is a read-only data export tool that fires off twice a day. Both are set to TRANSACTION_READ_COMMITTED. Dave -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Does jakarta-tomcat-service work for *nixes?
I know why Java can't do this inherently. I was hoping for some sort of tricky wrapper in the j-t-s code. Lots of security reasons to *not* change to a non-root user? You're saying it's more secure to run Tomcat as root? I would think it would be the other way around. Can you elaborate? Thanks, --jeff - Original Message - From: Randy Layman [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Monday, November 19, 2001 3:54 AM Subject: RE: Does jakarta-tomcat-service work for *nixes? -Original Message- From: Jeff Kilbride [mailto:[EMAIL PROTECTED]] Sent: Sunday, November 18, 2001 2:41 AM To: [EMAIL PROTECTED] Subject: Does jakarta-tomcat-service work for *nixes? I went through the archives trying to figure out how to run Tomcat (4.0.1) as a non-root user on port 80. I found references to the jakarta-tomcat-service module in the CVS, so I logged in and downloaded it. Unfortunately, there doesn't seem to be much info on how to set it up -- at least, not for a Linux/Unix environment. Does jakarta-tomcat-service work for Linux? It looks like it may only work for WinNT. If it doesn't work for Linux, is there any other method for starting Tomcat non-root on port 80? No it doesn't work for Linux. And no, there is no way for Tomcat to run as a non-root user on port 80 - because Tomcat is written in Java and Java doesn't provide the setUID/setGID system calls there is no way to capture port 80 as root and then change the user to something else (which is how the other major servers do it - C/C++ provides access to the system call). By the way there are lots of security reasons to not do this. Randy Thanks, --jeff -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Common Problem with Tomcat/Apache (processer sticks at 97% on linux)
- Original Message - From: Brandon Cruz [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Friday, November 16, 2001 7:01 AM Subject: RE: Common Problem with Tomcat/Apache (processer sticks at 97% on linux) Thank you for the suggestions, so to upgrade to a newer version of tomcat 3.2.x, all I have to do is switch jar files in tomcat_home/lib? Do you think that may help with the 97% processor problem? That's what the Readme file that comes with the distribution says -- and it worked for me. I remember 3.2.1 (and possibly 3.2.2) having a known runaway processor problem, but I don't remember what caused it. Something to do with mapping a servlet incorrectly could cause a runaway, I think. I believe it was fixed by 3.2.3. As I said, I think 3.2.4 is going to be released very soon, so you might wait for that distro. As far as garbage collection, this condition stays this way, even after 12 hours. Would that be an indication of garbage collection or an endless loop somewhere? If it is in our developers code, then I would expect this to reproduce on any machine, development on win2k, or production on linux-apache-tomcat. Still can only find this on the linux-apache machine. I will try the upgrade and reading up some information on garbage collection. If anyone else has seen this condition and been able to fix it, please let me know what you did! I doubt that it's a garbage collection issue. Try upgrading TC first to see if it resolves your problems. Thanks Again! Brandon --jeff -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Common Problem with Tomcat/Apache (processer sticks at 97% on linux)
At the very least, upgrade to the latest stable 3.2.x version. 3.2.1 is quite old and had several security problems. I'm pretty sure they are about to release 3.2.4, so that might be a good incentive. You don't have to change any of your config files, just replace the jar files in your TOMCAT_HOME/lib directory with the new ones. Thanks, --jeff - Original Message - From: Brandon Cruz [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Thursday, November 15, 2001 5:08 PM Subject: Common Problem with Tomcat/Apache (processer sticks at 97% on linux) I am using Tomcat 3.2.1 connected to Apache via mod_jk. For some reason, every once in a while, my java (Tomcat) process in linux goes up to 97% and stays there until I try to stop tomcat. Even though tomcat shuts down, that process still stays all of the way up at 97% and can only be stopped by executing the kill command. Does anyone know a fix for this problem, upgrade tomcat, upgrade linux version, upgrade jre, etc.? I have seen many posts on this subject before, but never a definate answer. I see that many people say check the code, so I am doing that for now. The only strange thing is that I can't figure out exactly what causes this to happen, and it can't be duplicated on development machines running tomcat stand alone on win2k. Any help would REALLY be appreciated!!! -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Wrap an HttpServletRequest
Hi Diego, You can also do this by adding query string data to the URL you are forwarding to, for example: - String myPage = /path/myPage.jsp; String myForward = myPage + ?newParam1=value1newParam2=value2; RequestDispatcher rd = getServletContext().getRequestDispatcher(myForward); rd.forward(request, response); - This way, your new info is added to the request as additional query string data. Your existing JSP pages can access the info with the normal request.getParameter() calls. They don't have to know that the request has been wrapped. Thanks, --jeff - Original Message - From: Diego del Río [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Wednesday, November 14, 2001 6:39 AM Subject: Re: Wrap an HttpServletRequest Thank you Thomas and Martin, our problem is that the target servlet, i.e. the servlet that would receive the 'wrapped request' forwarded by the first servlet (in this case, the target servlet is a jsp page), shouldn't know that the request is wrapped. We have already implemented a lot of jsp pages (servlets at last) that aren't aware about attributes in the request they process. I know that this functionality is provided by 'filters' in the servlet 2.3 spec.; unfortunately we are using Tomcat 3.2.3, a servlet 2.2 engine. Hi Diego, do it like Martin described. Or try out the RequestDispatcher: request.setAttribute(key1, value1); request.setAttribute(key2, value2); [...] RequestDispatcher rd = getServletContext().getRequestDispatcher(myServletUrl); rd.forward(request, response); Thomas -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
Re: Is there a way to make a default web.xml? --Tomcat 3.x
Hi Rob, 3.2.x still has web.xml in $TOMCAT_HOME/conf. I haven't tried 3.3 yet. Thanks, --jeff - Original Message - From: Rob S. [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 24, 2001 7:42 AM Subject: Re: Is there a way to make a default web.xml? --Tomcat 3.x Someone correct me if I'm wrong plz =) but I believe the web.xml in $TOMCAT_HOME/conf is applied to all web apps. I think I read on the dev list (from Larry) that this feature was removed in 3.x to increase app portability === that relying on a default web.xml reduces the portability of an application. However, this behavior is indeed present in TC4. - r On Fri, 24 Aug 2001 09:22:32 -0500 [EMAIL PROTECTED] wrote: Sorry, forgot to mention tomcat version 3.x -Original Message- From: Brandon Cruz [mailto:[EMAIL PROTECTED]] Sent: Friday, August 24, 2001 9:17 AM To: [EMAIL PROTECTED] Subject: Is there a way to make a default web.xml? Is there a way to make a default web.xml file that will work across all contexts/virtual hosts? Brandon
Re: VHosts causing app to load twice
Hi Steve, If you must be able to pull this site up by it's IP Address, then you must not be VHosting any other domains on this IP. Is that correct? If so, you should be using IP-based VHosting instead of Name-based. IP-based VHosting will associate one IP with one domain name. Tomcat shouldn't have a problem once it's set up this way. Check out: http://httpd.apache.org/docs/vhosts/ip-based.html Thanks, --jeff - Original Message - From: Steve Heard [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, August 20, 2001 9:39 AM Subject: VHosts causing app to load twice I have a servlet based application that needs to be accessed using both the the server IP address and the server domain name. The problem is that because I have two host entries for the same application tomcat loads them twice. Not only does this leave me with two instances of the servlets, but the ones I have marked to load on init have their code called twice which interferes with itself. I have tried every combination of VirtualHosts I can think of and always run into the issue of in order for Tomcat to recognize that it should handle the request to the servlet I have to add a Host entry in server.xml. If I leave out the entry for the IP address Apache passes the request along to tomcat fine, but then Tomcat doesn't recognize it. Likewise for the domain name. Any thoughts or help? I have included snippets of what I think are the relevant config files and how they should look. -Steve -- From http.conf: ... NameVirtualHost 111.22.33.44 VirtualHost 111.22.33.44 ServerName 111.22.33.44 ErrorLog /usr/local/apache/logs/error_log DocumentRoot /usr/local/apache/htdocs JkMount /*.servlet ajp13 /VirtualHost VirtualHost 111.22.33.44 ServerName www.foo.com ErrorLog /usr/local/apache/logs/error_log DocumentRoot /usr/local/apache/htdocs JkMount /*.servlet ajp13 /VirtualHost -- -- From server.xml: ... Host name=111.22.33.44 Context path= docBase=/usr/local/apache/servlets / /Host Host name=www.foo.com Context path= docBase=/usr/local/apache/servlets / /Host ... --
Re: VHosts causing app to load twice
Hi Steve, I ran into the same problem when trying to configure mydomain.com and www.mydomain.com under the same VHost. I was using the ServerAlias directive in Apache. Tomcat (3.2.x) needed two Host directives to deal with both names, which would give me two instances of my webapp. I finally gave up and only implemented the www.mydomain.com I'm under the impression that TC 4.0b7 has the ability to add aliases much like Apache using an Alias directive in server.xml. You might want to check that out. Also, someone posted a patch for 3.2.x to the tomcat-dev list a month or so ago that allowed you to use a list of domain names in your Host directive, like: Host name=mydomain.com www.mydomain.com 111.222.333.444 You might want to search the dev archives and try this patch. I haven't tried it yet, so I don't know if it works. Thanks, --jeff - Original Message - From: Steve Heard [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, August 20, 2001 10:43 AM Subject: Re: VHosts causing app to load twice Jeff, I am indeed running other hosts on this guy, just didn't include them in the snippet! Sorry about that. Thanks, steve on 8/20/01 1:07 PM, Jeff Kilbride at [EMAIL PROTECTED] wrote: Hi Steve, If you must be able to pull this site up by it's IP Address, then you must not be VHosting any other domains on this IP. Is that correct? If so, you should be using IP-based VHosting instead of Name-based. IP-based VHosting will associate one IP with one domain name. Tomcat shouldn't have a problem once it's set up this way. Check out: http://httpd.apache.org/docs/vhosts/ip-based.html Thanks, --jeff - Original Message - From: Steve Heard [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, August 20, 2001 9:39 AM Subject: VHosts causing app to load twice I have a servlet based application that needs to be accessed using both the the server IP address and the server domain name. The problem is that because I have two host entries for the same application tomcat loads them twice. Not only does this leave me with two instances of the servlets, but the ones I have marked to load on init have their code called twice which interferes with itself. I have tried every combination of VirtualHosts I can think of and always run into the issue of in order for Tomcat to recognize that it should handle the request to the servlet I have to add a Host entry in server.xml. If I leave out the entry for the IP address Apache passes the request along to tomcat fine, but then Tomcat doesn't recognize it. Likewise for the domain name. Any thoughts or help? I have included snippets of what I think are the relevant config files and how they should look. -Steve -- From http.conf: ... NameVirtualHost 111.22.33.44 VirtualHost 111.22.33.44 ServerName 111.22.33.44 ErrorLog /usr/local/apache/logs/error_log DocumentRoot /usr/local/apache/htdocs JkMount /*.servlet ajp13 /VirtualHost VirtualHost 111.22.33.44 ServerName www.foo.com ErrorLog /usr/local/apache/logs/error_log DocumentRoot /usr/local/apache/htdocs JkMount /*.servlet ajp13 /VirtualHost -- -- From server.xml: ... Host name=111.22.33.44 Context path= docBase=/usr/local/apache/servlets / /Host Host name=www.foo.com Context path= docBase=/usr/local/apache/servlets / /Host ... --
Re: VHosts causing app to load twice
Hi Larry, It doesn't really make sense to set up Name-based virtual hosting this way. In essence, your saying all requests for 111.22.33.44 should go to the same place as all requests for www.foo.com (in httpd.conf). In that case, I think you should stick with IP-based vhosts. Your Apache config would then be: VirtualHost 111.22.33.44 /VirtualHost With this setup, the host header is ignored and all requests to 111.22.33.44, no matter what domain they come in on, will go to the right place -- from Apache's standpoint, I don't know if it's handled correctly in Tomcat. You should be able to set up your Host directive in server.xml to catch the IP Address and make it work that way, though. I think the real problem with Name-based vhosts comes when you're trying to point more than one domain name at the same Tomcat webapp: NameVirtualHost 111.22.33.44 VirtualHost 111.22.33.44 ServerName foo.com ServerAlias www.foo.com ... /VirtualHost VirtualHost 111.22.33.44 ServerName bar.com ServerAlias www.bar.com ... /VirtualHost Now, if you want foo.com, www.foo.com, bar.com, and www.bar.com to all point at the same webapp, there's no way to do it without having four different instances of your webapp -- at least not in TC 3.2.x. I don't know about 3.3, but I think 4.0 has an Alias directive. I'm not sure if it's actually implemented, though. It may be kind of extreme to have different vhosts pointing at the same webapp, however I think it's pretty common to want foo.com and www.foo.com to point to the same place. It's really unfortunate that Tomcat (3.2.x) doesn't handle this without having to instantiate two different webapps. I'd be interested in fixing this in 3.2.x, if development wasn't already frozen... Thanks, --jeff - Original Message - From: Larry Isaacs [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, August 20, 2001 11:23 AM Subject: RE: VHosts causing app to load twice In Tomcat 3.3 I have made changes to ApacheConfig.java to try to address this. I think with Tomcat 3.2.2 you will need to do the Apache part manually, which it seems you may already be doing. I haven't done much with Vhosts on Apache beyond my tests while playing with ApacheConfig. If I am in error, someone let me know. It is my understanding that what you want is: server.xml Host name=www.foo.com Context ... / /Host httpd.conf or an include: NameVirtualHost 111.22.33.44 VirtualHost 111.22.33.44 ServerName www.foo.com ... /VirtualHost For me, this works under Tomcat 3.3. Both http://111.22.33.44/...; and http://www.foo.com/...; come over to Tomcat as www.foo.com. I haven't tried this with Tomcat 3.2.x. I also haven't tried this with *nix, just Win2k and Win98. One additional note. I had lots of trouble dealing with the root contexts. Your httpd.conf below says the root context (i.e. DocumentRoot) is at /usr/local/apache/htdocs and Tomcat thinks it is at /usr/local/apache/servlets. I think this situation is ripe for problems. Not knowing your application, it is hard to say what the best approach would be. Larry -Original Message- From: Steve Heard [mailto:[EMAIL PROTECTED]] Sent: Monday, August 20, 2001 1:44 PM To: [EMAIL PROTECTED] Subject: Re: VHosts causing app to load twice 3.2.2 on 8/20/01 12:53 PM, Larry Isaacs at [EMAIL PROTECTED] wrote: Which version Tomcat are you using? I have tried to deal with this issue in Tomcat 3.3. Larry -Original Message- From: Steve Heard [mailto:[EMAIL PROTECTED]] Sent: Monday, August 20, 2001 12:39 PM To: [EMAIL PROTECTED] Subject: VHosts causing app to load twice I have a servlet based application that needs to be accessed using both the the server IP address and the server domain name. The problem is that because I have two host entries for the same application tomcat loads them twice. Not only does this leave me with two instances of the servlets, but the ones I have marked to load on init have their code called twice which interferes with itself. I have tried every combination of VirtualHosts I can think of and always run into the issue of in order for Tomcat to recognize that it should handle the request to the servlet I have to add a Host entry in server.xml. If I leave out the entry for the IP address Apache passes the request along to tomcat fine, but then Tomcat doesn't recognize it. Likewise for the domain name. Any thoughts or help? I have included snippets of what I think are the relevant config files and how they should look. -Steve -- From http.conf: ... NameVirtualHost 111.22.33.44 VirtualHost 111.22.33.44 ServerName 111.22.33.44 ErrorLog /usr/local/apache/logs/error_log DocumentRoot
Re: VHosts causing app to load twice
Hi Larry, My comments are interspersed... :) - Original Message - From: Larry Isaacs [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, August 20, 2001 12:48 PM Subject: RE: VHosts causing app to load twice Hi Jeff, Maybe I can increase my understanding here, since I not that experienced with the Apache side. The point of: NameVirtualHost 111.22.33.44 VirtualHost 111.22.33.44 ServerName www.foo.com ... /VirtualHost was that mod_jk would identify the host as www.foo.com for both Both http://111.22.33.44/...; and http://www.foo.com/...;. Thus, Tomcat could match it to a single context identified by www.foo.com. I can't claim to understand the NameVirtualHost directive very well, but without it, I believe that mod_jk would identify the host as 111.22.33.44 instead of www.foo.com for httpd://111.22.33.44/ Ok, now I see the problem that you're describing. However, I still think this can be solved with an IP-based vhost where the config would be: VirtualHost 111.22.33.44 ServerName www.foo.com /VirtualHost Notice there's no NameVirtualHost directive. Here we're telling Apache that every request that comes in on this IPAddress will have it's ServerName set to www.foo.com. The only time you would need the NameVirtualHost directive is if you want to set up more domains with the same IP. For example: NameVirtualHost 111.22.33.44 VirtualHost 111.22.33.44 ServerName www.foo.com . /VirtualHost VirtualHost 111.22.33.44 ServerName www.bar.com . /VirtualHost Now, Apache will use the host header supplied by the browser to figure out which vhost to send the request to. If no host header is supplied, I believe it defaults to the first vhost in the list -- problematic for browsers that don't supply a host header. I don't think there's that big of a difference between the way you had it and my first config above, just saves a bit of typing in httpd.conf and looks cleaner from an Apache point of view. The results are probably the same... Obviously, I'm coming at this from the point of view of keeping mod_jk and Tomat happy, and not necessarily what is normal for Apache. By the way, ApacheConfig in Tomcat 3.3 also supports the following for ServerAlias: server.xml: Host name=www.foo.com address=111.22.33.44 Alias name=www.bar.com / Context ... / /Host which would generate conf/auto/mod_jk.conf: NameVirtualHost 111.22.33.44 VirtualHost 111.22.33.44 ServerName www.foo.com ServerAlias www.bar.com ... /VirtualHost Cheers, Larry Cool! This is what I was looking for in 3.2.x. Any hopes of migrating this back into 3.2.4 or later? Kinda silly not to have this functionality. Also, can you have multiple Alias directives? (I'm not even sure if you can do that in Apache...) Thanks, --jeff
Re: db connection denied access
You need to read chapters 4.2 and 4.3 of the MySQL manual: http://www.mysql.com/doc/P/r/Privilege_system.html http://www.mysql.com/doc/U/s/User_Account_Management.html MySQL has a somewhat strange privilege system for granting access to the database. But it's very flexible, once you learn it. If you're going to be using MySQL, do yourself a favor and buy this book: http://www.amazon.com/exec/obidos/ASIN/0735709211/qid=997901246/sr=2-2/107-4 535935-5049369 It's invaluable. --jeff - Original Message - From: Richard Draucker [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 15, 2001 8:04 AM Subject: db connection denied access This is odd and I'm stumped. I have a simple db connection class in a jar under ~app/WEB-INF/lib. I have a servlet under ~app/WEB-INF/classes that imports this connection class. The mm.mysql driver jar also resides in this WEB-INF/lib. The servlet accesses the connection class just fine. But, when the connection class attempts a connection to the database I get the error: java.sql.SQLException: Server configuration denies access to data source However, if I cut 'n paste the code from the connection class into the servlet I have no problem with the connection or data retrieval. FYI: RH7.1 new installation jdk 1.3.1 Tomcat 3.2.1 MySQL 3.2.2 -- Richard Draucker [EMAIL PROTECTED] Protected-Data.Com www.protected-data.com Remote Data Support For Web Developers
Cookie Exception: java.lang.IllegalArgumentException
Has anyone seen this type of Exception before? I'm running: RH 6.2 (2.4.7 kernel) IBMJava2_13 Tomcat 3.2.3 Apache 1.3.19 mod_jk This is a light to moderately loaded webserver (50,000 hits/day) and I'm getting 20 or 30 of these in my logs each day. I am also seeing errors where the message says Cookie name path is a reserved token. From tracing through the code, it seems that org.apache.tomcat.util.RequestUtil.processCookies is trying to create a cookie named Expires or path. (It takes the cookie header string, tokenizes it, and creates Cookie objects based on name=value pairs.) I've never seen Expires or path in a cookie header. Is this happening because the browser is sending a bad cookie header, or is it some other problem? Thanks, --jeff 2001-08-08 20:40:15 - Ctx( www..com: ): Exception in: R( + /servlet/x + null) - java.lang.IllegalArgumentException: Cookie name Expires is a reserved token at javax.servlet.http.Cookie.init(Cookie.java(Compiled Code)) at org.apache.tomcat.util.RequestUtil.processCookies(RequestUtil.java(Compiled Code)) at org.apache.tomcat.core.RequestImpl.getCookieCount(RequestImpl.java(Compiled Code)) at org.apache.tomcat.session.StandardSessionInterceptor.requestMap(StandardSess ionInterceptor.java(Compiled Code)) at org.apache.tomcat.core.ContextManager.processRequest(ContextManager.java(Com piled Code)) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java(Co mpiled Code)) at org.apache.tomcat.core.ContextManager.service(ContextManager.java(Compiled Code)) at org.apache.tomcat.service.connector.Ajp13ConnectionHandler.processConnection (Ajp13ConnectionHandler.java:160) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501) at java.lang.Thread.run(Thread.java:498)
Re: Cookie Exception: java.lang.IllegalArgumentException
Hi Larry, I can put some logging statements in and see if I can find out more about what's going on. However, I think the call creating the new cookie should at least be wrapped in a try/catch to prevent the exception from blowing that particular request. I'll do that and submit it to the Dev list. Thanks, --jeff - Original Message - From: Larry Isaacs [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 09, 2001 7:05 AM Subject: RE: Cookie Exception: java.lang.IllegalArgumentException This bug appears more than once in Bugzilla. So far, attempts to duplicate it haven't been successful, so it has never been tracked down. Cookie handling has been rewritten in Tomcat 3.3 and the bugs have been resolved as being fixed in 3.3. If you are interested, I can try to supply advice about preparing a slightly customized Tomcat 3.2.3 that dumps additional information. Maybe we can get a clue about what is going wrong. I'd offer to do more, but my hands are full with Tomcat 3.3. Cheers, Larry -Original Message- From: Jeff Kilbride [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 09, 2001 4:27 AM To: [EMAIL PROTECTED] Subject: Cookie Exception: java.lang.IllegalArgumentException Has anyone seen this type of Exception before? I'm running: RH 6.2 (2.4.7 kernel) IBMJava2_13 Tomcat 3.2.3 Apache 1.3.19 mod_jk This is a light to moderately loaded webserver (50,000 hits/day) and I'm getting 20 or 30 of these in my logs each day. I am also seeing errors where the message says Cookie name path is a reserved token. From tracing through the code, it seems that org.apache.tomcat.util.RequestUtil.processCookies is trying to create a cookie named Expires or path. (It takes the cookie header string, tokenizes it, and creates Cookie objects based on name=value pairs.) I've never seen Expires or path in a cookie header. Is this happening because the browser is sending a bad cookie header, or is it some other problem? Thanks, --jeff 2001-08-08 20:40:15 - Ctx( www..com: ): Exception in: R( + /servlet/x + null) - java.lang.IllegalArgumentException: Cookie name Expires is a reserved token at javax.servlet.http.Cookie.init(Cookie.java(Compiled Code)) at org.apache.tomcat.util.RequestUtil.processCookies(RequestUtil. java(Compiled Code)) at org.apache.tomcat.core.RequestImpl.getCookieCount(RequestImpl. java(Compiled Code)) at org.apache.tomcat.session.StandardSessionInterceptor.requestMa p(StandardSess ionInterceptor.java(Compiled Code)) at org.apache.tomcat.core.ContextManager.processRequest(ContextMa nager.java(Com piled Code)) at org.apache.tomcat.core.ContextManager.internalService(ContextM anager.java(Co mpiled Code)) at org.apache.tomcat.core.ContextManager.service(ContextManager.j ava(Compiled Code)) at org.apache.tomcat.service.connector.Ajp13ConnectionHandler.pro cessConnection (Ajp13ConnectionHandler.java:160) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoin t.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPo ol.java:501) at java.lang.Thread.run(Thread.java:498)
Re: JDBC
No. You need to download the mysql drivers from http://mmmysql.sourceforge.net/ Put the jar file in your classpath and you're set. Thanks, --jeff - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 09, 2001 1:47 PM Subject: JDBC Does Tomcat have all the necessary JDBC drivers installed to successfully connect to a mysql database? I will be installing Tomcat on Linux Mandrake 8with Apache shortly. And I will be developing JSP programs that use MySql. Thanks, Michael Johnson - This message was sent using Endymion MailMan. http://www.endymion.com/products/mailman/
Re: Fine tuning my Apache -Tomcat Server
Turn off servlet auto-reloading as well. I would recommend upgrading to 3.2.3, because of security problems and other bug fixes with 3.2.1 and 3.2.2. Just copy the new .jar files from 3.2.3 to your 3.2.1 installation and restart. It's that simple. (It's outlined in the 3.2.3 release notes...) --jeff - Original Message - From: Martin van den Bemt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, August 08, 2001 7:13 AM Subject: RE: Fine tuning my Apache -Tomcat Server Which connector are you using (ajp12 or ajp13). The last one should be a lot faster (ajp12 is frozen anyway). Also turning of unecessary debugging / logging in this area will speed up the process.. Mvgr, Martin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 08, 2001 4:12 PM To: [EMAIL PROTECTED] Subject: Fine tuning my Apache -Tomcat Server Hi, I have Apache and Tomact running on Linux server. The following are the details of the same Apache: Version : Apache_1.3.12-i686 Tomcat: Version: Jakarta-tomcat-3.2.1 Linux: Version :6.2 Java: Version : JDK 1.2.2 Hardware Configuration: Processor : Intel PIII CPU Cycles : 733 M Hz. RAM:256MB Hard Disk : 256 MB Applications : Technology : Java Servlet's Users: 100 users for every 10 minutes (approx) Network : Leased Line Band Width : 2 MegaBytes/Second My Current Problem: There are constant complaints that the server is slow in delivering the response to the users. But all the applications are working fine. Please help me out in fine tuning my Apache -Tomcat Server. Any inputs for improving server performance are highly appreciated. Thanks and Regards Srinivas Chebolu
Re: jasper: weird behaviour
You might be interested in this post from Tomcat-dev. --jeff --- Hi All! Different encodings support in Servlet/JSP is an ancient well-known problem. The setCharacterEncoding() method of HttpServletRequest allows to change request encoding before reading parameters. Thus, servlet is able to change encoding in accordance with its needs. (Small lyrical digression: what does this encoding mean? I'll post my thoughts about it separately) Howevet the problem still exists in JSP (there were several postings about the problem in this maillist). The purpose of this mail is to propose a solution for encodings support in JSP. Problem description === A JSP programmer is not able to change request encoding for incoming JSP request, since "This method [setCharacterEncoding] must be called prior to parsing any post data or reading any input from the request. Calling this method once data has been read will not affect the encoding." (Servlet 2.3 Spec). This happens because request parameters being read inside org.pache.jasper.servlet.JspServlet, before calling generated JSP-servlet. As a result we have the following behaviour of compiled JSP for non-English environments: 1) incoming request being read using 'ISO-8859-1' 2) getParameter() method returns a value in 'ISO-8859-1', but JSP-servlet suppose the return value has JVM default encoding (say "KOI8-R") -- here is ??? instead of real parameter value. Here is a problem. Problem solution There should be a configurable optional parameter for JspServlet (say 'requestEncoding') to change request encoding. According to this parameter JspServlet should call setCharacterEncoding() before processing request. It does not conflict with JSP 1.2 Spec, since there are now any words about default encoding of incoming request over there. I have made neccessary changes to implement this feature in tomcat-4.0-20010807. It works fine with different Cyrillic encodings. (Suppose the same result for the rest of non-Latin1 encodings). I clearly understand that proposed solution is not a panacea and it's a subject to discuss. Regards, Andrey Aristarkhov Diffs are followed (also as attachments). I have also attached a sample JSP for encoding testing. file: org/apache/jasper/EmbededServletOptions.java 147a148,152 * Java platform encoding for incoming request. */ private String requestEncoding; /** 219a225,228 public String getRequestEncoding() { return requestEncoding; } 320a330 this.requestEncoding = config.getInitParameter("requestEncoding"); file: org/apache/jasper/EmbededServletOptions.java 144a145,149 /** * Java platform encoding for incoming request. */ public String getRequestEncoding(); file: org/apache/jasper/servlet/JspServlet.java 422c422,426 String includeUri --- // According to section 4.9 of Servlet 2.3 spec we have to // setCharacterEncoding() before reading any parameter if (options.getRequestEncoding()!=null) request.setCharacterEncoding(options.getRequestEncoding()); String includeUri
Re: PLEASE UNSUBSCRIBE ME
Since we filtered HTML, can we filter any message with 'unsubscribe' in the subject? --jeff - Original Message - From: Olivier LAUDREN [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, August 07, 2001 5:11 AM Subject: RE: PLEASE UNSUBSCRIBE ME This could be found in the mail's header: list-unsubscribe: mailto:[EMAIL PROTECTED] -Message d'origine- De : Jockel, Jeff [mailto:[EMAIL PROTECTED]] Envoyé : mardi 7 août 2001 14:11 À : [EMAIL PROTECTED] Objet : PLEASE UNSUBSCRIBE ME -Original Message- From: Beth Kelly [mailto:[EMAIL PROTECTED]] Sent: Monday, August 06, 2001 6:19 PM To: [EMAIL PROTECTED] Subject: Re: JDBC Realms Actually, I see why you would not want the passwords in memory. Kyle Wayne Kelly (504)391-3985 http://www.cs.uno.edu/~kkelly - Original Message - From: Michael Wentzel [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, August 06, 2001 12:13 PM Subject: RE: JDBC Realms Advantage: You don't lose existing session data Disadv : You're not actually re-authenticating (not really authenticating, you lost me) After looking at some code I figured something out... I was thinking about this architecture wrong. Kyle was right just using: session.setAttribute(j_password, sPassword); will provide a hook for password changes. --- Michael Wentzel Software Developer Software As We Think - http://www.aswethink.com
Re: Servllet
FWIW, I had to write a class to invoke a method on a given object at timed intervals using the Reflection API. I use it to automatically refresh bean info from my database at set intervals. I'm attaching the code, called TimedMethodInvoker.java, and a simple example. Works like a charm for me. Hope it helps. --jeff - Original Message - From: Michael Wentzel [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, August 06, 2001 5:27 AM Subject: RE: Servllet Maybe do a sleep instead of busy waiting (looping takes up too much cpu time). How about running an application that periodically posts to the servlet? How can a servlet be automatically be invoked by itself, say peroidically? Usul I think a better way is to write a servlet which is configured as a load on startup servlet which forks a separate scheduler thread which then defines tasks to be completed at specified interval(using a properties file or init params...). The Thread(Runnable) will essentially be a infinite loop which will check to see if it's time to run certain tasks. i.e. while(1) { if ( /*somethings true 1*/ ) { /*perform task 1*/ } if ( /*somethings true 2*/ ) { /*perform task 2*/ } // ... } Yeah, that's the general idea. That was the //... part any additional cleanup between states and a wait state. Otherwise the process, depending on the performance of your separate scheduled jobs and the frequency of them, could pretty much lock the processor down. This is meant as a rudamentary example. This is the generic model of a scheduling thread/server. --- Michael Wentzel Software Developer Software As We Think - http://www.aswethink.com TimedMethodInvoker.java ExampleBean.java
Re: Upgrade to Tomcat DECREASES Performance?
Good enough to have answered this question several times. Have you checked the archives? http://mikal.org/interests/java/tomcat/archive/view?mesg=35371 http://mikal.org/interests/java/tomcat/archive/view?mesg=33145 http://mikal.org/interests/java/tomcat/archive/view?mesg=30821 http://mikal.org/interests/java/tomcat/archive/view?mesg=26859 Other things I would suggest: -- If you're using ajp13, you can tune down the number of threads for your ajp12 connector -- Use the mod_jk module that comes with TC 3.3. It allows you to stop and start TC without restarting Apache. You can download the 3.3 distribution and make it yourself, or just use the pre-compiled binary for Linux (which is what I use). It's compatible with 3.2.x and can be found here: http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.3-b1/bin/linux/i3 86/ -- Upgrade to 3.2.3. It's really easy. You just copy the jar files into your existing installation. The release notes explain it. -- Monitor the tomcat-dev list. You learn a lot more there than you do on the user list (even though you don't normally post there...) Thanks, --jeff - Original Message - From: Dwight Powell [EMAIL PROTECTED] To: Tomcat Users [EMAIL PROTECTED] Sent: Monday, July 30, 2001 10:09 AM Subject: Upgrade to Tomcat DECREASES Performance? OK, let's see how good you folks are: I work for a large national not-for profit membership organization. We've got a large database application that we serve to our members from a small group of servers out of our national office. About a week ago, we upgraded our servers, moving from Apache JServ/mod_jserv/AJP12 to Tomcat/mod_jk/AJP13. Ever since the upgrade, our servers have been HIGHLY unstable (our 3 busiest servers have each crashed at least once a day for the last week) and we're HIGHLY confused. The only real change has been the move to Tomcat, which we thought was a large upgrade, but our app has been acting as if we downgraded! Before the upgrade, application was having some performance issues (record locking, result set not found errors), probably caused by the large load on our servers combined with some inefficiencies in the code. After the upgrade, the same performance errors exist, but seem to be magnified, as if Tomcat is working SLOWER than JServ. But here's the worst part: At least once a day (usually after running for a while), the application will simply stop responding - users will attempt to save forms and/or navigate between pages and will never get a respond (eventually they'll get a Page Cannot Be Displayed Error). When the server is in this state, we check the running processes and we see lots of java threads loaded and waiting for response, but none of them is RUNNING, so I don't THINK this is a runaway thread problem. Once the server hangs like this, our processor usage by the JVM will go down to 0% and stay there until we restart Apache and Tomcat. Here's our specs: SERVER SPECS (average): Dual Pentiums (1 Ghz) 2.5 GB RAM Red Hat Linux 7.1 OLD CONFIGURATION: Apache 1.3.14 Apache JServ (with mod_jserv and ajp12) IBM JDK 1.3-5 Cloudscape 3.5 NEW CONFIGURATION: Apache 1.3.14 Jakarta Tomcat 3.2.2 (with mod_jk and ajp13) IBM JDK 1.3-9 Cloudscape 3.5 So... does anyone out there have any idea why we're seeing these problems? Where should we focus our investigation? Should we just go back to JServ, or is Tomcat REALLY better? Thanks to one and all... *** Dwight Powell Manager of Systems / Lead Programmer NACCRRA (www.naccrra.org) [EMAIL PROTECTED]
Re: Apache cannot connect to Tomcat
If you're using mod_jk, you have to add the connector to your server.xml file. I'm not sure why you *haven't* done that. Apache and Tomcat won't be able to communicate without it. So, I would suggest starting there. --jeff - Original Message - From: Kelly E. Grooms [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, July 28, 2001 2:50 PM Subject: Apache cannot connect to Tomcat Hello, I've scoured the web and all the Tomcat lists that I can find and still cannot solve this error. Everything works fine through port 8080 as stand-alone, but when I try accessing Tomcat through Apache the page times out with no output from the JSP. Afterward my mod_jk.log file contains: [jk_connect.c (143)]: jk_open_socket, connect() failed errno = 110 [jk_ajp12_worker.c (152)]: In jk_endpoint_t::service, Error sd = -1 I compiled mod_jk.so myself. I've added mod_jk.conf-auto to my httpd.conf file. I altered workers.properties to reflect my JAVA_HOME, TOMCAT_HOME and file separator (/). I have _not_ added the connector for ajp13 to my server.xml file. Here is my configuration: Mandrake Linux 8.0 Apache 1.3.19 Java 1.3.1 (from Sun) Tomcat 3.2.3 I've installed older versions of Tomcat on other configurations in the past and did not have this much trouble. I'm beginning to feel very discouraged. Can anyone help? Thanks. Kelly E. Grooms [EMAIL PROTECTED]
Re: HTML in Messages and politeness
[X] 0 - I don't give a damn shit. I do, however, agree with the points on politeness. I think if you reject HTML-only messages, a lot of new subscribers are not going to be able to figure out why they can't post to the list. Most probably don't even realize they are doing it, since the newer email clients default that way. How do I turn off HTML formatting? might be a good addition to the FAQ and the auto-generated email that goes out when you sign up, if it's not already there. Thanks, --jeff
Re: Apache cannot connect to Tomcat
You're right, Andrew! I misread and thought Kelly hadn't added _any_ connectors to server.xml. My mistake. Kelly, I have JSP's running with 3.2.3 on RedHat Apache 1.3.19. Can you post the relevant parts of your server.xml, httpd.conf and web.xml files? --jeff - Original Message - From: Andrew Robson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, July 29, 2001 12:56 PM Subject: Re: Apache cannot connect to Tomcat Hang on Jeff this isn't correct is it? mod_jk can support either the ajp12 or ajp13 protocol so adding the ajp13 connector to server.xml isn't likely to help. I'm afraid I can't help with the jsp side of things as I only ever write servlets. Might be interesting to see if you can get a servlet to work to see if JSP issue. andrew On Sun, 29 Jul 2001, you wrote: If you're using mod_jk, you have to add the connector to your server.xml file. I'm not sure why you *haven't* done that. Apache and Tomcat won't be able to communicate without it. So, I would suggest starting there. --jeff - Original Message - From: Kelly E. Grooms [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, July 28, 2001 2:50 PM Subject: Apache cannot connect to Tomcat Hello, I've scoured the web and all the Tomcat lists that I can find and still cannot solve this error. Everything works fine through port 8080 as stand-alone, but when I try accessing Tomcat through Apache the page times out with no output from the JSP. Afterward my mod_jk.log file contains: [jk_connect.c (143)]: jk_open_socket, connect() failed errno = 110 [jk_ajp12_worker.c (152)]: In jk_endpoint_t::service, Error sd = -1 I compiled mod_jk.so myself. I've added mod_jk.conf-auto to my httpd.conf file. I altered workers.properties to reflect my JAVA_HOME, TOMCAT_HOME and file separator (/). I have _not_ added the connector for ajp13 to my server.xml file. Here is my configuration: Mandrake Linux 8.0 Apache 1.3.19 Java 1.3.1 (from Sun) Tomcat 3.2.3 I've installed older versions of Tomcat on other configurations in the past and did not have this much trouble. I'm beginning to feel very discouraged. Can anyone help? Thanks. Kelly E. Grooms [EMAIL PROTECTED] -- Andrew Robson tel: (0141) 424 0607 mobile: 07759 430234 email: [EMAIL PROTECTED]
Re: How to forward with new request/query string?
Hi Erin, You can't change the original request (at least, I don't think you can...) -- but you can add info to the request before forwarding it on to your jsp page. Just add the extra info to the query string of the jsp your forwarding to: String location = myForward.jsp?foo=barbaz=1; RequestDispatcher rd = request.getRequestDispatcher(location); rd.forward(request, response); The parameters foo and baz will now be available in myForward.jsp, along with all the original request params. If foo and baz exist in the original request, calling request.getParameter() will return the newly set value and calling request.getParameterValues() will return all values for that parameter. You can also store info in the request object using setAttribute() and retrieve them in the jsp by using getAttribute(): (in servlet) request.setAttribute(key, value); (in jsp -- if the value is a String object) String value = (String)request.getAttribute(key); Notice that you have to cast the object back to the correct type in your jsp. Hope this helps. --jeff - Original Message - From: Erin Lester [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 19, 2001 1:36 PM Subject: How to forward with new request/query string? I was wondering how you go about transferring control from a servlet to another page (in this case a jsp page) before committing the response. I need to send request variables to this new page. I've tried using a request dispatcher, but I believe that this just sends the request that the servlet got and not a new one with the querystring values (which are appended to the url I want to forward to) in it. Can someone tell me how to do this? Also, what's the difference between sendRedirects, dispatcher forwards, etc. ? and is there any way to transfer control to another page and have the user's location bar reflect the address of the new page? Any help would be appreciated! - Erin
Re: How to change the IP address
The PoolTCPConnector class has a parameter called inet that's not really documented. I used this parameter to make my ajp12 and ajp13 connectors listen only on the localhost interface -- by default, they listen on all interfaces, even external, which is bad. I don't know if it will work, but you could try including the inet param in the definition of the Normal HTTP connector inside your server.xml file. Maybe like this: --- !-- Normal HTTP -- Connector className=org.apache.tomcat.service.PoolTcpConnector Parameter name=handler value=org.apache.tomcat.service.http.HttpConnectionHandler/ Parameter name=inet value=127.0.0.1 Parameter name=port value=8080/ /Connector --- Just replace 127.0.0.1 with the IPAddress you want to use. Thanks, --jeff - Original Message - From: Neelu Shah [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 16, 2001 3:51 PM Subject: How to change the IP address Hi All, could someone tell me how to change the default IP address for tomcat (no apache used) from localhost to another IP address. im running tomcat on Windows NT. thanks N
Re: How to change the IP address
Whoops, forgot the closing / for the inet param. Should be: Parameter name=inet value=127.0.0.1/ Thanks, --jeff - Original Message - From: Jeff Kilbride [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 17, 2001 11:33 PM Subject: Re: How to change the IP address The PoolTCPConnector class has a parameter called inet that's not really documented. I used this parameter to make my ajp12 and ajp13 connectors listen only on the localhost interface -- by default, they listen on all interfaces, even external, which is bad. I don't know if it will work, but you could try including the inet param in the definition of the Normal HTTP connector inside your server.xml file. Maybe like this: --- !-- Normal HTTP -- Connector className=org.apache.tomcat.service.PoolTcpConnector Parameter name=handler value=org.apache.tomcat.service.http.HttpConnectionHandler/ Parameter name=inet value=127.0.0.1 Parameter name=port value=8080/ /Connector --- Just replace 127.0.0.1 with the IPAddress you want to use. Thanks, --jeff - Original Message - From: Neelu Shah [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 16, 2001 3:51 PM Subject: How to change the IP address Hi All, could someone tell me how to change the default IP address for tomcat (no apache used) from localhost to another IP address. im running tomcat on Windows NT. thanks N
Re: Need workaround for Tomcat security.
Andrew, What version of Tomcat did this affect Form-based authentication on? I tried the URL patterns mentioned on my Form-based Realm, and the Realm worked correctly -- no security problems. I'm using TC 3.2.2 on Linux. Thanks, --jeff - Original Message - From: Andrew Robson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 16, 2001 7:29 AM Subject: Re: Need workaround for Tomcat security. Hi, No workaround I'm afraid. I can confirm that the problem affects form - based JDBCRealm as well. Tried putting */admin/* into url pattern and broke security completely. I wonder whether a JkMount directive with approriately placed wildcards might work but haven't had time to try. I'd be very interested if you find a solution. Presumably no-one on the list has one? andrew On Sun, 15 Jul 2001, you wrote: Ok, i needed to put some security constraints to a dircetory, so I added this to my web.xml: security-constraint display-nameUQoS Amin Area/display-name web-resource-collection web-resource-nameUQoS Amin Area/web-resource-name url-pattern/admin/*/url-pattern /web-resource-collection I use BASIC authentication using the memory realm. Works like it supposed to when someone goes to my http://xxx/webapp/Admin/ or something below, HOWEVER, if they type http://xxx/webapp//Admin/ (or even more slashes), all security checkings are bypassed, anyone arr let right in ! (same things happens always, try it with the 'security' example shipped with Tomcat. Sever bug!, I have posted it to BugZilla. This applies to atleast Tomcat 3.2.1 and 3.2.2. And I need it fixedas soon as possible. Does anyone know a workaround to thisone.(I'd rather not upgrade to Tomcat 4 yet,seems like its fixed here.) -- Nils O. Selåsdal -- Andrew Robson
Re: ajp13 dies unexpectately
How many threads have you specified as max_threads in your PoolTCPConnector for ajp13 in your server.xml file? If you haven't done this, and you're running a reasonably high load, you should take a look at the minimal TC user's guide here: http://jakarta.apache.org/tomcat/tomcat-3.2-doc/uguide/tomcat_ug.html The last example at the bottom of the page shows how to configure max_threads, max_spare_threads, and min_spare_threads for the PoolTCPConnector class. Tomcat doesn't react gracefully if the max_threads number is ever reached and exceeded. I believe the default max is 50 threads. If you're getting more than 50 concurrent connections, you need to raise this number or you'll have problems. Thanks, --jeff - Original Message - From: maarten hartsuijker [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 16, 2001 2:00 AM Subject: ajp13 dies unexpectately we have been running tomcat 3.2.2 with apache, mod_jk and ajp13 support for about 3 weeks now. In those weeks it has died 2 times unexpectately and the only thing the mod_jk.og is showing me is a jk_ajp13_worker.c (586)]: Error connecting to the Tomcat process. With a netstat I can see that 8009 is not up anymore, so both times I have issued a shutdown and a start. That works but (ofcourse) I'd rather not have this problem at all. Anyone had this before and, better yet, found a solution? kind regards, Maarten Hartsuijker
Re: Need workaround for Tomcat security.
Hi Andrew, I know that there were some security-related problems with 3.2.1 and certain URLs. I think a bug was found and fixed right around the time of 3.2.2 beta 5. I would suggest upgrading to 3.2.2. It's very painless -- all config files stay the same, just copy your old ones into your 3.2.2 install directory and change TOMCAT_HOME. I'm not seeing the problem on my installation (TC 3.2.2, Linux, apache, mod_jk). Thanks, --jeff - Original Message - From: Andrew Robson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 16, 2001 1:39 PM Subject: Re: Need workaround for Tomcat security. Jeff, TC 3.2.1 on linux. Apache and mod_jk It seems to me (without having had a chance to check) that this must be a misconfig at the apache and apache/tomcat end of things rather than a tomcat bug as such. Any thoughts? It would be a pretty big hole if it was a genuine bug. andrew On Mon, 16 Jul 2001, you wrote: Andrew, What version of Tomcat did this affect Form-based authentication on? I tried the URL patterns mentioned on my Form-based Realm, and the Realm worked correctly -- no security problems. I'm using TC 3.2.2 on Linux. Thanks, --jeff - Original Message - From: Andrew Robson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 16, 2001 7:29 AM Subject: Re: Need workaround for Tomcat security. Hi, No workaround I'm afraid. I can confirm that the problem affects form - based JDBCRealm as well. Tried putting */admin/* into url pattern and broke security completely. I wonder whether a JkMount directive with approriately placed wildcards might work but haven't had time to try. I'd be very interested if you find a solution. Presumably no-one on the list has one? andrew On Sun, 15 Jul 2001, you wrote: Ok, i needed to put some security constraints to a dircetory, so I added this to my web.xml: security-constraint display-nameUQoS Amin Area/display-name web-resource-collection web-resource-nameUQoS Amin Area/web-resource-name url-pattern/admin/*/url-pattern /web-resource-collection I use BASIC authentication using the memory realm. Works like it supposed to when someone goes to my http://xxx/webapp/Admin/ or something below, HOWEVER, if they type http://xxx/webapp//Admin/ (or even more slashes), all security checkings are bypassed, anyone arr let right in ! (same things happens always, try it with the 'security' example shipped with Tomcat. Sever bug!, I have posted it to BugZilla. This applies to atleast Tomcat 3.2.1 and 3.2.2. And I need it fixedas soon as possible. Does anyone know a workaround to thisone.(I'd rather not upgrade to Tomcat 4 yet,seems like its fixed here.) -- Nils O. Selåsdal -- Andrew Robson --
Re: help..
The MySQL JDBC driver is a type 4 driver, so it will work on Windows and Linux. Just put the MySQL jar file in your classpath on your Windows machine. Thanks, --jeff - Original Message - From: Ben Kimball [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, July 15, 2001 11:24 AM Subject: Re: help.. You will need to install the MySQL JDBC driver on every box that will be connecting to the SQL server. Go to the mysql web site and look for the (I assume wondog means windows?) Windows driver. Or in some situations you can use a Type 4 JDBC driver which can be downloaded by your users from your web server, but probably easier to use the dedicated Windows JDBC driver (aka a Type 2 JDBC driver) to get started and make sure everything works. On Sunday 15 July 2001 10:51, you wrote: Hi i have a linux-box with java+tomcat+jdbcand working fine... question : how can i connect from other computer system to my linux box through jdbc? Do i need to install another driver to the other one? i was trying to connect from my windog98se to my server... so.. compiled some simple connection java code on wondog box, then i have an error message org.gjt.mm.mysql.Driver No suitable driver... How can i make them connect each other other? Thanks in advance..
Re: Okay. this is getting annoying.
From your previous posts, you're server.xml entry is not correct. You can't reference multiple IP's, domains, etc.. in the Host directive. - My most recent attempt had this in server.xml Host name=206.180.224.76 : www.pedsforless.com : pedsforless.com debug=0 appBase=/home/peds/public_html unpackWARs=true Context path= docBase=/home/peds/public_html debug=0/ /Host - If you want to access this as www.pedsforless.com and pedsforless.com, you need to set up two independent Host directives. (I'm assuming you're using TC3.2.2) Also realize that this will instantiate all of your servlets twice under two different contexts. Go to the archives here: http://mikal.org/interests/java/tomcat/index.jsp and search on virtual host jeff. This will pull up all my previous posts on virtual hosting, including examples of my config. Thanks, --jeff - Original Message - From: Chuck Cochems [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, July 15, 2001 2:09 PM Subject: Okay. this is getting annoying. I've posted the snippets from my conf files, and still haven't gotten an answer to why i cannot access a virtual host's servlets and JSPs except by IP address. I haven't seen the problem discussed in the archives either. I know this mailing list is pretty busy, but i don't have time to wait around forever. To sum up. I f I put the virtual hosts IP address in a context, I can access JSP via the IP address, whether or not the virtualhost directive has the IP address, or the domain name. If I only put a context for the domain name, I cannot access it via IP address OR domain name. If I put contexts for both, in anu order, the IP address works, the domain does not. My syntax has all been lifted straight form the samples in the docs on the site. What could possibly be wrong?
Re: apache + tomcat + virtual hosts
Hi Connie, I think the first thing you should do is read the Apache docs on virtual hosting here: http://httpd.apache.org/docs/vhosts/index.html Then go to the archive here: http://mikal.org/interests/java/tomcat/index.jsp and do a search on virtual host jeff -- this will pull up all my previous posts on virtual hosting, including examples of my config. Thanks, --jeff - Original Message - From: Connie Chan [EMAIL PROTECTED] To: Jack Hui [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, July 13, 2001 6:04 AM Subject: RE: apache + tomcat + virtual hosts Jack, I try a few configuration settings: Configuration 1: I put the default server name in the NameVirtualHost and then create the virutal host tag for the virtual host VirtualHost defaultServerName /VirtualHost. It does not work. When I browse the default web server, the virtual host displays. Configuration 2: I put the default server name in the NameVirtualHost and then create the virutal host tag for the default server VirtualHost defaultServerName /VirtualHost and the virtual host VirtualHost defaultServerName /VirtualHost. It does not work. When I browse the default web server, I get 403 Forbidden error (The error displays You don't have permission to access / on this server). Configuration 3: I put '*' in the NameVirtualHost and then create the virutal host tags for the default server VirtualHost * /VirtualHost and the virtual host VirtualHost * /VirtualHost. It does not work. Both servers give me 403 Forbidden error. Is the configuration 2 correct? Should I create another server name as the default server name and then have different name for my default web server? Please help. Thanks, Connie -Original Message- From: Jack Hui [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 12, 2001 9:32 PM To: '[EMAIL PROTECTED]'; Connie Chan Subject: RE: apache + tomcat + virtual hosts Connie, Your default server and virtual server are using the SAME IP AND SAME PORT no., right ? What did you put in the NameVirtualHost ? should be the IP of the default server, right ? According to the documentation, you have to set the IP to either way ( not 100% sure, but I read before ) But, why don't you put your default sever into the virtual host too ?? If it can be only recognize by the NAME the client enter in the browser. Another solution is you are going to set another IP for all virtual host, but it involves modifying the DNS entries. Jack -Original Message- From: Connie Chan [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 12, 2001 9:25 PM To: [EMAIL PROTECTED] Subject: apache + tomcat + virtual hosts Hi, Currently, I'm using apache with tomcat. I have set up the server such that it serves a default web server, ssl server (being set up as a virtual host with using port 443), and a virtual host (with using port 80). But the document root for default web server and virtual host is mixed up. My virtual host and default web server are using the same IP address. When I type the default web server, the welcome file for virtual host displays. When I type the virtual host, the welcome file for the virtual host displays as well. However, if I specify port 8080 (the HTTP port for tomcat) in the url (for testing tomcat only without going thru apache), the default web url would display the correct welcome page. In my httpd.conf, I have declared DocumentRoot d:/jakarta-tomcat/webapps/myapp AND VirtualHost dev.mycomp.com:80 ServerName vh1.mycomp.com DocumentRoot d:/jakarta-tomcat/webapps/vh1 JkMount /*.jsp ajp12 JkMount /servlet/* ajp12 JkMount /email/* ajp12 Directory d:/jakarta-tomcat/webapps/vh1/META-INF/ AllowOverride None deny from all /Directory Directory d:/jakarta-tomcat/webapps/vh1/WEB-INF/ AllowOverride None deny from all /Directory /VirtualHost Do I miss anything? Thanks, Connie
Re: java-linux-tomcat configuration problem
I would try the IBM JDK before Blackdown (before Sun, too...), but that's just my personal choice. The Blackdown port can be found at www.blackdown.org. --jeff - Original Message - From: Adam Fowler [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, July 14, 2001 3:47 AM Subject: Re: java-linux-tomcat configuration problem Hi, Many ppl using 1.3.1 specifically have noted huge memory usage increases (leaks) which either take a long time to clean themselves up or are permanent. The issue has been reported by ppl using JNI, tomcat, app contexts etc etc so is a JDK bug. Sun still haven't fixed it (I just checked) Maybe 1.4 fixes it, but that is still in Beta so I wouldn't use it on a deployed platform just yet. Apparently using 1.3 fixes it, but its a real pain to find. Sun don't actually advertise its whereabouts on their site. The blackdown JDK doesn't seem to have this problem so you could try that (I don't know where it can be found) Hope that helps, Adam. Adam Fowler Help Desk Live Project Information Services University of Wales, Aberystwyth Web guy+author on the TomcatBook Project http://tomcatbook.sourceforge.net e-mail: [EMAIL PROTECTED] On Friday 13 July 2001 16:33, you wrote: What is the infamous bug for jdk? Thanks! Dan From: Adam Fowler [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: java-linux-tomcat configuration problem Date: Thu, 12 Jul 2001 22:09:53 + Hi, You have two versions of httpd running!?! Make sure that if you have two version using tomcat then you have two tomcat's running. That might answer it. Otherwise it might be the infamous bug to do with the 1.3.1 JDK (although, again, I had no problems on Mandrake! Must be the pretty penguins) You ould try the 1.3 JDK (if u can find it!) or *cringe* the 1.4 JDK - although not supported. Adam. On Thursday 12 July 2001 13:01, you wrote: Hello again: Quick thanks for your responses .. now more background, as requested. a) The contexts that I am running are the ones that came with apache, outlined in server.xml. I was able to start up those instances with jre (but not the example jsps, another problem). b) I am running Red Hat 6.2. c) I am using Sun's jdk 1.3.1 d) Adam, here is the top and ps -x output (the java threads are towards the end in ps -x, and are at the top of top): PID TTY STAT TIME COMMAND 1 ?S 0:02 init 2 ?SW 0:00 [kflushd] 3 ?SW 0:01 [kupdate] 4 ?SW 0:00 [kpiod] 5 ?SW 0:00 [kswapd] 6 ?SW0:00 [mdrecoveryd] 7 ?SW0:00 [raid1d] 8 ?SW0:00 [raid1d] 9 ?SW0:00 [raid1d] 10 ?SW0:00 [raid1d] 171 ?S 0:00 syslogd -m 0 180 ?S 0:00 klogd 209 ?S 0:00 /usr/sausalito/sbin/cced 586 ?S 0:00 crond 598 ?S 0:00 inetd 628 ?S 0:00 named 644 ?S 0:00 /usr/sbin/dhcpd -q eth0 649 ?S 0:01 /usr/sbin/ahttpd -f /etc/admserv/conf/httpd.conf 673 ?S 0:01 /usr/sbin/httpd -f /etc/httpd/conf/httpd.conf 705 ?S 0:00 sendmail: accepting connections 717 ?S 0:00 sh /usr/bin/safe_mysqld --datadir=/var/lib/mysql --pi 784 ?S 0:00 /usr/sbin/atalkd 807 ?S 0:00 smbd -D 816 ?S 0:00 nmbd -D 825 ?S 0:00 /sbin/lcdsleep 867 ?S 0:00 /sbin/consoled /sbin/getty ttyS0 115200 904 ?S 0:00 /usr/sbin/afpd -U uams_clrtxt.so,uams_dhx.so -g guest 1353 ?S 0:00 in.telnetd: 10.6.18.30 1354 pts/0S 0:00 login -- admin 1758 ?S 0:00 in.telnetd: 10.6.18.30 1759 pts/1S 0:00 login -- admin 1793 pts/1S 0:00 su 1794 pts/1S 0:00 bash 1952 ?S 0:00 smbd -D 2283 pts/0S 0:00 su 2284 pts/0S 0:00 bash 2403 pts/0R 2:07 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtom 2448 pts/0S 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtom 2449 pts/0S 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtom 2450 pts/0S 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtom 2451 pts/0S 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtom 2452 pts/0S 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtom 2453 pts/0S 0:00 /usr/java/jdk1.3.1/bin/i386/native_threads/java -Dtom 2454 pts/0S 0:00
Re: List traffic et al
I'm not sure that I agree with the idea that I have to wade through all these messages for the good of the list. As I said, I have no experience with Tomcat on Windows, so I'm not interested in Windows specific issues nor can I help to solve them. Splitting along platform lines should retain a relatively good mix of newbies and experienced developers in each list, so I don't see the problem you are pointing out. In any event, even if the list is split on basic vs. advanced topics, advanced users who wanted to help the community could subscribe to all lists. I don't think it's necessarily bad to want to subscribe only to the lists you feel you can learn from. I've been lurking and posting for about 9 months now and it seems that the same basic group of people answer a majority of the questions. I used to answer a lot more than I do now, but I'll admit that I get pretty frustrated answering the same questions over and over when I know the answers can be easily found in the archive. Is it selfish or bad of me to skip over questions I used to answer, or should more responsibility be placed on the person asking the question? (rhetorical, because there's no way to control whether or not people actually search the archives before posting...) A digest version is already available for this list. --jeff From: Dmitri Colebatch [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] Date: Fri, 6 Jul 2001 16:03:14 +1000 To: [EMAIL PROTECTED], Jeff Kilbride [EMAIL PROTECTED] Subject: Re: List traffic et al I think the big problem with splitting the list is that everyone is going to be interested in their own little niche. I for instance learn nothing by answering many questions that I answer, but I do learn things from reading other answers. If the list was split, I would (potentially) have the option to only see the messages that I would learn from. This disadvantages other people on the list. And this is going to occur at all levels. Even relative newbies should be capable of answering some questions that they have just dealt with the day before. If we want to reduce traffic surely a digest is the option. The JBoss list has a _lot_ more traffic than this one, and I am able to receive that in digest mode quite happily. anyway, my 2c cheesr dim On Fri, 6 Jul 2001 15:45, Jeff Kilbride wrote: Even if the list is not split into these specific sub-topics, I would certainly like to see it split along Windows/Unix lines. I use Unix exclusively and I skip over 99% of the Windows questions, because I don't have any experience with Tomcat on that platform. I'm sure Windows users feel the same way about Unix related questions. Thanks, --jeff From: Hemant Singh [EMAIL PROTECTED] Organization: Supportscape Inc. Reply-To: [EMAIL PROTECTED] Date: Wed, 4 Jul 2001 13:39:13 +0530 To: [EMAIL PROTECTED] Subject: Re: List traffic et al HI: Heartly agree with yur idea and before this also i keep on getting agree with same kind of ideas but i just dont know who is the moderator of this group and how this can be acheived. Regards Hemant - Original Message - From: Milt Epstein [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 03, 2001 10:41 PM Subject: Re: List traffic et al On Tue, 3 Jul 2001, Sam Newman wrote: Given the huge amount of traffic this list generates, I can rarely get involved with the discussions that take place. It occurs to me that there sems to be three major discussion themes on the list as a whole: 1.) General servlet/jsp development issues and how tomcat affects them 2.) General tomcat configuration issues 3.) Webserver integration issues I guess as documentation improves (e.g. tomcat book, work by people like Mike Slinn) points 23 will become less of an issue. I'm just wondering if there is any millage in perhaps splitting the list into 2 or 3 lists? Personally, I've got no issues with getting tomcat up and running and so don't care too much about that end of things, however the servlet/jsp development issues is more interesting to me. I don't have too strong an opinion on it, its just that I worry I'm missing some interesting topics because I don't have the time to work though all the posts This idea has come up before, and I think it's one of the best for dealing with the high volume on this list (I guess it's one of the two or three highest volume apache lists). I even volunteered to take the lead in doing this. So I sent a note to the list owner explaining the idea. Unfortunately, I never heard anything back. Without the list owner's cooperation/participation (or someone who can modify the apache/jakarta mailing lists), it won't be possible to do this. So, we could do some work on this (i.e. figuring out what separate lists to have), but unless we know that it's going to come to something, it doesn't make sense to do too much work on it. Milt Epstein Research Programmer Software
Re: AW: List traffic et al
In a perfect world, yes, I totally agree. However, in the real world, who's going to enforce the guidelines? (we already have guidelines that few people pay attention to...) Reposting the guidelines and links to the FAQ and archive on a regular basis would probably help, and I agree that it should be done. Personally, I don't care about the volume on the list. I have a broadband connection and it only takes me a couple of seconds to download all the daily messages. However, I think Tomcat is a broad enough subject to warrant more than just one generic list. I think a couple of focused lists would help people with non-generic questions. And, as Milt Epstein points out in a later post, involvement may actually increase on smaller, focused lists. I don't think the volume on the tomcat-user list will decrease much at all, even if it is split. However, splitting will allow people with focused interests beyond getting Tomcat up and running to participate without being deluged with messages they may not be interested in. More choices are usually better than less. --jeff From: Nico Wieland [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] Date: Fri, 6 Jul 2001 13:17:13 +0200 To: [EMAIL PROTECTED] Subject: AW: List traffic et al i agree 100%. i think a _good_ thing would be to include these guidelines in the confirmation message one receives after subscribing to the list. this is the way how it's done eg. on sun-managers, they post the guidelines once a month. it's the most disciplined list i know. -nico Rather let all of us try to reduce volume(both in size and number), it does not require much effort. Lets just try to follow the following. [snip]
Re: List traffic et al
Even if the list is not split into these specific sub-topics, I would certainly like to see it split along Windows/Unix lines. I use Unix exclusively and I skip over 99% of the Windows questions, because I don't have any experience with Tomcat on that platform. I'm sure Windows users feel the same way about Unix related questions. Thanks, --jeff From: Hemant Singh [EMAIL PROTECTED] Organization: Supportscape Inc. Reply-To: [EMAIL PROTECTED] Date: Wed, 4 Jul 2001 13:39:13 +0530 To: [EMAIL PROTECTED] Subject: Re: List traffic et al HI: Heartly agree with yur idea and before this also i keep on getting agree with same kind of ideas but i just dont know who is the moderator of this group and how this can be acheived. Regards Hemant - Original Message - From: Milt Epstein [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 03, 2001 10:41 PM Subject: Re: List traffic et al On Tue, 3 Jul 2001, Sam Newman wrote: Given the huge amount of traffic this list generates, I can rarely get involved with the discussions that take place. It occurs to me that there sems to be three major discussion themes on the list as a whole: 1.) General servlet/jsp development issues and how tomcat affects them 2.) General tomcat configuration issues 3.) Webserver integration issues I guess as documentation improves (e.g. tomcat book, work by people like Mike Slinn) points 23 will become less of an issue. I'm just wondering if there is any millage in perhaps splitting the list into 2 or 3 lists? Personally, I've got no issues with getting tomcat up and running and so don't care too much about that end of things, however the servlet/jsp development issues is more interesting to me. I don't have too strong an opinion on it, its just that I worry I'm missing some interesting topics because I don't have the time to work though all the posts This idea has come up before, and I think it's one of the best for dealing with the high volume on this list (I guess it's one of the two or three highest volume apache lists). I even volunteered to take the lead in doing this. So I sent a note to the list owner explaining the idea. Unfortunately, I never heard anything back. Without the list owner's cooperation/participation (or someone who can modify the apache/jakarta mailing lists), it won't be possible to do this. So, we could do some work on this (i.e. figuring out what separate lists to have), but unless we know that it's going to come to something, it doesn't make sense to do too much work on it. Milt Epstein Research Programmer Software/Systems Development Group Computing and Communications Services Office (CCSO) University of Illinois at Urbana-Champaign (UIUC) [EMAIL PROTECTED]
Re: tomcat 3.2.2 session already invalidated-serious problem
Why not wrap your call to invalidate() in a try-catch clause? If the exception occurs, the session is already invalidated -- which is what you're trying to accomplish anyway. try { oldSession.invalidate(); } catch ( IllegalStateException ise ) { ; } --jeff - Original Message - From: Its Me.. Karthik [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 26, 2001 3:15 AM Subject: tomcat 3.2.2 session already invalidated-serious problem Hi, im usuing tomcat 3.2.1..when i invalidate my session im getting error.. this is my piece of code if(monitor.containsKey(uname)){ HttpSession oldSession = (HttpSession)monitor.get(uname); oldSession.invalidate(); } the error is Internal Servlet Error: javax.servlet.ServletException: setAttribute: Session already invalidated at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp l.java:459) at karthik._0002fkarthik_0002fpage_00031_0002ejsppage1_jsp_2._jspService(_0002f karthik_0002fpage_00031_0002ejsppage1_jsp_2.java:129) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.ja va:130) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja va:282) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405) at org.apache.tomcat.core.Handler.service(Handler.java:287) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79 7) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC onnectionHandler.java:213) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501) at java.lang.Thread.run(Thread.java:484) Root cause: java.lang.IllegalStateException: setAttribute: Session already invalidated at org.apache.tomcat.session.StandardSession.setAttribute(StandardSession.java: 721) at karthik._0002fkarthik_0002fpage_00031_0002ejsppage1_jsp_2._jspService(_0002f karthik_0002fpage_00031_0002ejsppage1_jsp_2.java:111) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.ja va:130) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja va:282) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405) at org.apache.tomcat.core.Handler.service(Handler.java:287) at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372) at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79 7) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743) at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC onnectionHandler.java:213) at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416) at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501) at java.lang.Thread.run(Thread.java:484) please help me..very urgent karthik -- -- Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
Re: limiting instances of java
max_threads max_spare_threads min_spare_threads They're all parameters of the PoolTCPConnector class. If you're trying to configure the number of threads Tomcat is using, you should probably read about all three of them. They're all listed in the same section of the User's Guide. If you only configure max_spare_threads, you're not doing anything to limit the total number of threads Tomcat can spawn. You're just adjusting the number of idle threads it keeps in it's pool waiting for requests. --jeff - Original Message - From: Charles Williams (CEO) [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, June 24, 2001 11:05 PM Subject: Re: limiting instances of java Actually, I believe that it's max_spare_threads. chuck - Original Message - From: Jeff Kilbride [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, June 24, 2001 8:53 PM Subject: Re: limiting instances of java Try the manual. (do a find on max_threads) http://jakarta.apache.org/tomcat/tomcat-3.2-doc/uguide/tomcat_ug.html --jeff - Original Message - From: Dino Ming [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, June 24, 2001 8:53 AM Subject: Re: limiting instances of java I have over 35+ instances...too.. Yes, how can we reduce the number of java instances ? - Original Message - From: Charles Williams (CEO) [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, June 24, 2001 11:29 PM Subject: limiting instances of java hey, I just noticed that there are over 20 instances of java running when i do a ps call. How can I cut that down? chuck
Re: how to determine if tomcat is running
Have you tried 'man ps' on the systems in question to see what the options should be? --jeff - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: Thomas Fischer [EMAIL PROTECTED] Sent: Sunday, June 24, 2001 5:10 AM Subject: Re: how to determine if tomcat is running thanks for your response, but this method is not working on all unix systems because some of them only show .../java as result of the ps command (even with the options you mentioned). does anybody know anything else how i can be sure if tomcat is running or not??? thanks, thomas. Am Samstag, 23. Juni 2001 um 20:17 schrieb Jeff Kilbride: You should have a java process running 'org.apache.tomcat.startup.Tomcat' when Tomcat is running. For example, when I run the 'ps' command I see the following: /usr/local/java/IBMJava2-13/jre/bin/exe/java -Xms64M -Xmx128M -Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol -Dtomcat.home=/usr/local/java/jakarta-tomcat-3.2.2 org.apache.tomcat.startup.Tomcat This is all on one line, of course, and I have to use 'ps awx --cols=250' (Linux) in order to see the entire command line. Hope this helps. Thanks, --jeff - Original Message - From: Thomas Fischer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, June 23, 2001 10:34 AM Subject: how to determine if tomcat is running i'm writing a script (on a unix-system) which should do different tasks wether tomcat is running or not. to do so the script has to figure out the status of tomcat. most daemons use .pid-files or anything similar. but i found nothing for tomcat. i've looked all through the documentation but found nothing about the runtime status of tomcat. how can i find out if tomcat is already running? thanks for any responses, thomas.
Re: limiting instances of java
Try the manual. (do a find on max_threads) http://jakarta.apache.org/tomcat/tomcat-3.2-doc/uguide/tomcat_ug.html --jeff - Original Message - From: Dino Ming [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, June 24, 2001 8:53 AM Subject: Re: limiting instances of java I have over 35+ instances...too.. Yes, how can we reduce the number of java instances ? - Original Message - From: Charles Williams (CEO) [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, June 24, 2001 11:29 PM Subject: limiting instances of java hey, I just noticed that there are over 20 instances of java running when i do a ps call. How can I cut that down? chuck
Re: Mapping with InvokerServlet in Tomcat 3.2.1
I was under the impression that to change the default servlet mapping, you change the 'prefix' setting of org.apache.tomcat.request.InvokerInterceptor in your server.xml file. I haven't needed to do it, though, so I don't know if this is correct. Give it a try. Thanks, --jeff - Original Message - From: Andy Raffle [EMAIL PROTECTED] To: Tomcat User [EMAIL PROTECTED] Sent: Saturday, June 23, 2001 12:02 AM Subject: Mapping with InvokerServlet in Tomcat 3.2.1 I've spent quite a few hours trying to migrate an existing Jserv 1.0 servlet configuration to Tomcat 3.2.1, and I only have one question... Where is org.apache.tomcat.servlets.InvokerServlet ?? According to the cvs, it was dropped a year ago, and yet in all the places that I've seen where it shows you how to change the servlet mapping (eg. from /servlet/* to /jbin/* in my case), it says to do this... servlet servlet-name invoker /servlet-name servlet-class org.apache.tomcat.servlets.InvokerServlet /servlet-class /servlet servlet-mapping servlet-name invoker /servlet-name url-pattern /jbin/* /url-pattern /servlet-mapping For me, this doesn't work. I can do something specific, such as: servlet servlet-name /jbin/xyz /servlet-name servlet-class xyz /servlet-class /servlet That works. But the generic doesn't. I can't find InvokerServlet anywhere in the source or binaries, nor can I find any mention of the ...servlets package it's in. So it's either accidentally missing, or only the name is there for backwards compatibility, or the remapping mechanism is fundamentally broken. Or I've missed something! And yes, I have the directory structure right. I'm not looking for specific advice, unless it differs from the above. But it would be nice if someone who is 'in the know' would explain (a) where the InvokerServlet has gone, and (b) how the example above (almost verbatim from the FAQ) is ever supposed to work! Cheers! Andy.
Re: how to determine if tomcat is running
You should have a java process running 'org.apache.tomcat.startup.Tomcat' when Tomcat is running. For example, when I run the 'ps' command I see the following: /usr/local/java/IBMJava2-13/jre/bin/exe/java -Xms64M -Xmx128M -Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol -Dtomcat.home=/usr/local/java/jakarta-tomcat-3.2.2 org.apache.tomcat.startup.Tomcat This is all on one line, of course, and I have to use 'ps awx --cols=250' (Linux) in order to see the entire command line. Hope this helps. Thanks, --jeff - Original Message - From: Thomas Fischer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, June 23, 2001 10:34 AM Subject: how to determine if tomcat is running i'm writing a script (on a unix-system) which should do different tasks wether tomcat is running or not. to do so the script has to figure out the status of tomcat. most daemons use .pid-files or anything similar. but i found nothing for tomcat. i've looked all through the documentation but found nothing about the runtime status of tomcat. how can i find out if tomcat is already running? thanks for any responses, thomas.
Re: Apache Default Document is .jsp?
You could also have an index.html that uses the meta-refresh tag to automatically redirect to your login.jsp. This might be a lot easier than mod_rewrite. Either way, I would turn off directory browsing in Apache, unless that's what you really want. --jeff - Original Message - From: Jason Koeninger [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 18, 2001 6:25 PM Subject: Re: Apache Default Document is .jsp? Dig through the documentation on mod_rewrite and/or look at the Redirect command for Apache. One or both of those two should be capable of accomplishing what you want. Best Regards, Jason Koeninger JJ Computer Consulting http://www.jjcc.com On Mon, 18 Jun 2001 17:40:02 -0700, Scott Jones wrote: Hello, I'm getting ready to setup tomcat and Apache on seperate machines. Before getting started on that project, on my development machine, I set the default DocumentRoot for apache to a different directory (for static content) than my webapp (which will eventually sit on a different machine). I'd like to have my login.jsp be my default document, but was only able to get it to work by putting a dummy login.jsp in the HTML directory... Otherwise, Apache would just show a normal index of the directory... Is this the only way to get this to work? Or am I missing somthing? BTW, I'm on Tomcat 3.2.1 and Apache 1.3.19... Thanks for any ideas. Cheers, Scott
Re: xtags: Unable to load class
Where did you put the taglib tld file and the taglib jar file? What does your web.xml look like? The order of the definitions in web.xml is also important. When I first set up my taglibs, I had the taglib definition in my web.xml at the end of the file after a security-constraint definition and it didn't work. Check out tomcat.mslinn.com for an explanation of the web.xml file. --jeff - Original Message - From: William C. Robertson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 18, 2001 10:47 PM Subject: xtags: Unable to load class -Original Message- From: William C. Robertson [mailto:[EMAIL PROTECTED]] Sent: Monday, June 18, 2001 4:37 PM To: [EMAIL PROTECTED] Subject: xtags: Unable to load class Has anyone else had a problem with taglibs? I have everything configured correctly (pretty sure) and I get the following error when using any of the tomcat taglibs (except for the example tagliv which can with tomcat and works fine): Error: 500 Location: /examples/init_onlyImports.jsp Internal Servlet Error: org.apache.jasper.compiler.CompileException: /usr/local/jakarta-tomcat-3.2.2/webapps/examples/init_onlyImports.jsp(4,0) Unable to load class org.apache.taglibs.xtags.tags.ParseTag at org.apache.jasper.compiler.TagBeginGenerator.init(TagBeginGenerator.java, Compiled Code) I hope the problem is obvious to someone. Thanks..
Re: omegacms, thanks and a new problem: compile errors
Hi Vinny, The %= opening jsp tag is for single expression evaluation, while the % is for scriptlets. So, you could do this two ways: % out.print(!); % or %= ! % As you've seen, the %= wraps whatever's inside it in an out.print() statement -- so you're own out.print() is redundant in this case. --jeff - Original Message - From: Vinny [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 19, 2001 9:27 AM Subject: Re: omegacms, thanks and a new problem: compile errors Thank you very much, I had to explicitly put the omega jar and the directory containing the property file in my unix shell's classpath. Now the problem I'm running into is that some pages are getting compile error messages. 2001-06-19 12:07:40 - Ctx( /omega ): JasperException: R( /omega + /admin/hello.jsp + null) Unable to compile class for JSP/usr/local/jakarta-tomcat-3.2.2/work/localhost_8080%2Fomega/_0002fadmin_0 002fhello_0002ejsphello_jsp_0.java:61: Incompatible type for method. Can't convert void to char[]. out.print( out.print(!) ); the hello.jsp file contains: h2Hello World %=out.print(!) % /h2 what's going on? Thanks again in advance. Randy Layman wrote: If you're on UNIX, add it to TOMCAT_HOME/classes, if you're on NT you'll need to modify the tomcat.bat file so that Tomcat adds this directory to its automatically built classpath. Another option it to add the conf.properties to the CLASSPATH environment variable. In either case, there are some ways that you can request resources that cause the wrong class loader to be used, which it seems is happening here. Since its closed source, there really is no way around this. Randy -Original Message- From: Vincent Stoessel [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 19, 2001 11:17 AM To: Tomcat Users
Re: request and jsp:include
You're missing an = in your jsp:include statement. Try this: jsp:include page=%= request.getParameter(pagina) % / You have it correct in your second example, which is why that one works. Thanks, --jeff - Original Message - From: Antoni Reus [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 18, 2001 4:58 AM Subject: request and jsp:include Hi, first of all I would like to excuse for my poor english. I'm using tomcat 3.2.2 in a Win NT 4 I'm trying to do some kinda printing template, so calling de template ( imprimir.jsp ) with a parameter for the page to show it whould display it in a printer friendly way. In imprimir.jsp is something like this: html ... ... jsp:include page=%request.getParameter(pagina) % / ... .. /html when I call localhost:8080/imprimir.jsp?pagina=listado.jsp I get a tomcat exception when parsing imprimir.jsp, saying that pagina has no value. But if I write imprimr.jsp this way: html ... ... %! String pagina = request.getParameter(pagina); % jsp:include page=%=pagina % / ... .. /html it works!! Someone could explain this???
Re: Tomcat hangs if I refer to a context that doesn't exist
Actually, yes -- read the release notes for 3.2.1 that come with the distribution. --jeff - Original Message - From: Jeff Trent [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, June 13, 2001 5:30 AM Subject: Re: Tomcat hangs if I refer to a context that doesn't exist Actually, no - otherwise, I wouldn't have asked. I did, however, find my answer in the bugzilla database. For those of you who are wondering, this problem occurs under 3.2.1 if you remove the ROOT context / webapp. -jeff - Original Message - From: Thomas Bezdicek To: [EMAIL PROTECTED] Sent: Wednesday, June 13, 2001 4:03 AM Subject: AW: Tomcat hangs if I refer to a context that doesn't exist Hi, you find it in the tomcat-documentation very easy. regards, tom -Ursprüngliche Nachricht- Von: Jeff Trent [mailto:[EMAIL PROTECTED]] Gesendet: Mittwoch, 13. Juni 2001 06:40 An: [EMAIL PROTECTED] Betreff: Tomcat hangs if I refer to a context that doesn't exist If I refer to a nonexistant webapp, I find that Tomcat pins my CPU (doesn't really hang). I need to stop tomcat and restart for the CPU to return to normal. I couldn't find any information on this problem in the archives. Anybody else see this or know what the problem might be? I'm using 3.2.1 on NT2000. thanks, jeff
Re: mod_jk and mod_perl
I would go with option #1 -- build apache with mod_perl statically and mod_so, then load mod_jk dynamically. I think you're going to have a lot of work trying to get mod_jk to compile statically with apache, because the developers haven't released an easy static version. You'd have to integrate the mod_jk code into the apache source yourself. The reason you can't use perl 5.005 may be your apache version (or apxs version). You may also be able to switch to an older version of apache to compile mod_perl as a DSO. The other option is to upgrade perl. It's really not that hard and shouldn't cause any major problems. You may want to try that first. (personally, I think it's easier to upgrade perl than to install apache for the first time...) Thanks, --jeff - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 05, 2001 5:12 PM Subject: RE: mod_jk and mod_perl We're running perl 5.005_03 on Solaris 2.6/sparc. When I go to build mod_perl as a DSO, I get: * ERROR * Your current configuration will most likely trigger core dumps, suggestions: *) Do not configure mod_perl as a DSO *) Upgrade your Perl version to 5.6.0 or higher (w/ -Ubincompat5005) *) Configure Perl with -Uusemymalloc (not recommended for performance) * ERROR * We're not in a position to upgrade perl or reconfigure perl. So I can't build mod_perl as a DSO. My options are (in order of preference): - build apache with mod_perl (statically) and mod_so. Then to load mod_jk with apxs. - build apache with mod_perl and mod_jk statically. - run two apache instances. The first one will have mod_so and mod_jk and will handle requests for servlets and static pages. The second will have mod_perl and will handle perl requests. If you, or anyone else, has any advice, I'd be stoked. Thanks, * * * John -Original Message- From: Jeff Kilbride [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 05, 2001 4:53 PM To: [EMAIL PROTECTED] Subject: Re: mod_jk and mod_perl I've run both mod_jk and mod_perl as dynamically linked modules in the past, but not statically. The dynamic modules were very easy to get running. Any reason it has to be statically compiled? Thanks, --jeff - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 05, 2001 3:48 PM Subject: mod_jk and mod_perl Hello, I'm trying to build a statically linked version of apache v1.3.19 with mod_jk (from tomcat v3.2.1) and mod_perl v1.25 for Solaris 2.6/sparc. Has anyone successfully done this before? I can build apache with mod_jk and apache with mod_perl, but I haven't been able to build apache with both modules. I've searched this mailing list and several others and have made no progress. My next step is to deconstruct the mod_jk makefile to fit the source into $APACHE_SRC/src/modules/jk. Any hints are appreciated. Thanks, * * * John Ubante
Re: Tomcat dying: solution!!
I'm glad to hear this worked! Thanks, --jeff - Original Message - From: Joe Howes [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 04, 2001 10:18 PM Subject: Tomcat dying: solution!! Don't know if this will help any of you who have had tomcat die mysteriously, but it sure seems to have stabilized my installs. I followed Jeff's advice and upped the max_threads (server.xml file, see http://jakarta.apache.org/tomcat/tomcat-3.2-doc/uguide/tomcat_ug.html and grep for max_threads.) My jakarta instances on three machines would die on a very regular basis...each machine at least one or two times an hour. I specified all the options for the PoolTcpConnector (actually just used exactly the settings from the above web page) and none of them have died since. Hopefully when I get in tomorrow they'll still be up and running :) But this seems to have done it. - Joe Jeff Kilbride wrote: I seem to remember something from the tomcat-dev list about 3.2.x dying less than gracefully if the max_threads parameter for PoolTCPConnector is ever exceeded. I believe the default is 50, so if you're ever hitting more than 50 concurrent threads, maybe this is the problem. If you're using Tomcat with Apache, try upping your max_threads parameter to match the max number of child processes your Apache installation allows (MaxClients in httpd.conf). If you're running standalone, up max_threads to a reasonable number you don't think you'll hit. If I remember correctly, this solved the problem for someone else -- or at least significantly prolonged Tomcat's life cycle. I'd really be interested in hearing if this helps. Thanks, --jeff - Original Message - From: Hunter Hillegas [EMAIL PROTECTED] To: Tomcat User List [EMAIL PROTECTED] Sent: Friday, June 01, 2001 12:20 PM Subject: 3.2.2 Dies After Prolonged Use... You may remember my posts about Tomcat dying on me... Well I upgraded to 3.2.2 and it is still happening. It only seems to happen after prolonged periods (lots of hits)... I increased the heap to 256MB with a max of 512MB. We're not using sessions on the site and the session timeout is set to 5 minutes anyway... What could be going on? Hunter
Re: mod_jk and mod_perl
I've run both mod_jk and mod_perl as dynamically linked modules in the past, but not statically. The dynamic modules were very easy to get running. Any reason it has to be statically compiled? Thanks, --jeff - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 05, 2001 3:48 PM Subject: mod_jk and mod_perl Hello, I'm trying to build a statically linked version of apache v1.3.19 with mod_jk (from tomcat v3.2.1) and mod_perl v1.25 for Solaris 2.6/sparc. Has anyone successfully done this before? I can build apache with mod_jk and apache with mod_perl, but I haven't been able to build apache with both modules. I've searched this mailing list and several others and have made no progress. My next step is to deconstruct the mod_jk makefile to fit the source into $APACHE_SRC/src/modules/jk. Any hints are appreciated. Thanks, * * * John Ubante
Re: 3.2.2 Dies After Prolonged Use...
Check out the User's Guide: http://jakarta.apache.org/tomcat/tomcat-3.2-doc/uguide/tomcat_ug.html and do a find in your browser for max_threads. Thanks, --jeff - Original Message - From: Joe Howes [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, June 02, 2001 10:03 AM Subject: Re: 3.2.2 Dies After Prolonged Use... Thanks for the suggestion, Jeff. Stupid question...I've grepped all over hell and back and I can't find a max_threads param in any config files :) Where do I find it? - Joe Jeff Kilbride wrote: I seem to remember something from the tomcat-dev list about 3.2.x dying less than gracefully if the max_threads parameter for PoolTCPConnector is ever exceeded. I believe the default is 50, so if you're ever hitting more than 50 concurrent threads, maybe this is the problem. If you're using Tomcat with Apache, try upping your max_threads parameter to match the max number of child processes your Apache installation allows (MaxClients in httpd.conf). If you're running standalone, up max_threads to a reasonable number you don't think you'll hit. If I remember correctly, this solved the problem for someone else -- or at least significantly prolonged Tomcat's life cycle. I'd really be interested in hearing if this helps. Thanks, --jeff - Original Message - From: Hunter Hillegas [EMAIL PROTECTED] To: Tomcat User List [EMAIL PROTECTED] Sent: Friday, June 01, 2001 12:20 PM Subject: 3.2.2 Dies After Prolonged Use... You may remember my posts about Tomcat dying on me... Well I upgraded to 3.2.2 and it is still happening. It only seems to happen after prolonged periods (lots of hits)... I increased the heap to 256MB with a max of 512MB. We're not using sessions on the site and the session timeout is set to 5 minutes anyway... What could be going on? Hunter
Re: ** JVM and Processes
When Java first came to the Linux platform (via the Blackdown port), green-threads were the only option. Native threads took a little longer to implement, but are a much better option for the reasons listed in the previous message. So, I would recommend avoiding green-threads unless you have a specific reason for using them. A lot of people freak out when they see the number of processes being reported by ps or top, without realizing that these are merely threads and not full-blown processes. If you have a lightly loaded Tomcat, you can tune down the number of threads being spawned by using the max_threads, max_spare_threads, and min_spare_threads parameters of the PoolTCPConnector in your server.xml file. For an example of this, take a look at the tomcat user's guide: http://jakarta.apache.org/tomcat/tomcat-3.2-doc/index.html Do a find in your web browser for max_threads. I use this to limit the number of ajp12 threads and maximize ajp13 threads -- because I'm using ajp13 for my servlets and ajp12 only for startup/shutdown of Tomcat. Conversely, if you have a heavily loaded Tomcat, you should use these parameters to increase performance. Thanks, --jeff - Original Message - From: Michael Jennings [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, June 01, 2001 9:32 AM Subject: Re: ** JVM and Processes RE: ** JVM and ProcessesMy understanding of green vs. native threads is as follows: With native threads, an actual system thread is created when a Java thread is created. On linux a system thread takes the form of another process, but one that shares memory etc. with another process. This is why if you create a program that allocates 100 megs of memory, then spins off 10 threads, it looks like 10 processes each taking up 100 megs of memory, when in fact the amount of memory is 100 megs + 10*overhead for each thread (not much more than 100 megs). On WIN32 systems, threads do not show up as separate processes, they are separate threads of execution inside the same process (essentially the same as the Linux implementation with differences too subtle to care about) Green threads on the other hand use timers, signals, setjmp etc. voodoo to simulate threads within one process. Essentially taking over the scheduling from the kernel. I believe the command-line option for green threads is simply -green as in java -green MyThreaddedApp If you have a multi-cpu system, green threads will only take advantage of one cpu, whereas native threads will use all the cpus on your system (that's the theory anyway) I've heard of problems with blocking I/O with green threads, but have no first hand knowledge. Hope this helps. -Mike Jennings - Original Message - From: BARRAUD Valérie To: '[EMAIL PROTECTED]' Sent: Friday, June 01, 2001 9:01 AM Subject: RE: ** JVM and Processes http://java.sun.com/products/jdk/1.1/packs/native-threads/README -Message d'origine- De: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] Date: vendredi 1 juin 2001 17:46 À: [EMAIL PROTECTED] Objet: RE: ** JVM and Processes Randy, Thanks for the advice. Could you be a little more specific, though, about how to use green threads instead of native threads and possibly differences between the two? Thanks. - Adam At 10:59 AM 6/1/2001 -0400, you wrote: Don't use ps - these are actually threads. ps is showing them as processes because that is what it does. If you use green thread (as opposed to the native threads you are using now), the display will go away, but you will experience a slowdown (how much depends on your operating system and other activity on the system). Randy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, June 01, 2001 10:37 AM To: [EMAIL PROTECTED] Subject: ** JVM and Processes Hi, For a particular web server we are running with Tomcat 3.1, we are having an issue with the java servlets that are running. What appears to be happening is that each time a servlet is called from the web site, a new process is created to run the java program. When I view processes with ps ax, I see dozens of instances of: /usr/java/jdk1.3/bin/i386/native_threads/java It was briefly stated in Java Servlet Programming by Hunter Crawford, (c) Oreilly that 'most servlet containers execute all servlets in a single JVM ... the exception being high-end containers that support execution across multiple backend servers...' We are only using 1 web server with an average weekly load of a couple of hundred visitors. Any ideas as to why we would be seeing so many identical processes and if so, how to modify that? Thanks in advance. -Adam
Re: ** JVM and Processes
Hi Adam, No, the garbage collector runs as a low priority background process and, on a lightly loaded server, may never get called because the server's not using enough resources to warrant it. I really wouldn't worry about it too much and I would definitely avoid killing threads individually, especially since you're now utilizing a Pool connector. (you don't want to kill threads that are marked as available in the pool...) The min_spare_threads and max_spare_threads settings are supposed to take care of cleaning up any extra unused threads that are laying around. I think the best benefit you could do yourself would be to upgrade your 3.1 version of Tomcat to the newly released 3.2.2 final to take advantage of upgrades and bug fixes. Thanks, --jeff - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, June 01, 2001 11:03 AM Subject: Re: ** JVM and Processes Jeff, Thanks a bunch. Your answer appears to be the best so far. I have implemented the PoolTCPConnector in the server xml file and it appears to be limiting the number of threads as it should. However, something that has been happening (even before switching to PoolTCPConnector) is that when running multiple java servlets the threads stay alive long after they should have died or been garbage collected. Even after a long wait, the only way (apparently) to get rid of them is to go through and kill them one at a time. Is there a setting somewhere that is telling the java threads to stay alive indefinitely? Thanks for your help, - Adam At 10:34 AM 6/1/2001 -0700, you wrote: When Java first came to the Linux platform (via the Blackdown port), green-threads were the only option. Native threads took a little longer to implement, but are a much better option for the reasons listed in the previous message. So, I would recommend avoiding green-threads unless you have a specific reason for using them. A lot of people freak out when they see the number of processes being reported by ps or top, without realizing that these are merely threads and not full-blown processes. If you have a lightly loaded Tomcat, you can tune down the number of threads being spawned by using the max_threads, max_spare_threads, and min_spare_threads parameters of the PoolTCPConnector in your server.xml file. For an example of this, take a look at the tomcat user's guide: http://jakarta.apache.org/tomcat/tomcat-3.2-doc/index.html Do a find in your web browser for max_threads. I use this to limit the number of ajp12 threads and maximize ajp13 threads -- because I'm using ajp13 for my servlets and ajp12 only for startup/shutdown of Tomcat. Conversely, if you have a heavily loaded Tomcat, you should use these parameters to increase performance. Thanks, --jeff - Original Message - From: Michael Jennings [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, June 01, 2001 9:32 AM Subject: Re: ** JVM and Processes RE: ** JVM and ProcessesMy understanding of green vs. native threads is as follows: With native threads, an actual system thread is created when a Java thread is created. On linux a system thread takes the form of another process, but one that shares memory etc. with another process. This is why if you create a program that allocates 100 megs of memory, then spins off 10 threads, it looks like 10 processes each taking up 100 megs of memory, when in fact the amount of memory is 100 megs + 10*overhead for each thread (not much more than 100 megs). On WIN32 systems, threads do not show up as separate processes, they are separate threads of execution inside the same process (essentially the same as the Linux implementation with differences too subtle to care about) Green threads on the other hand use timers, signals, setjmp etc. voodoo to simulate threads within one process. Essentially taking over the scheduling from the kernel. I believe the command-line option for green threads is simply -green as in java -green MyThreaddedApp If you have a multi-cpu system, green threads will only take advantage of one cpu, whereas native threads will use all the cpus on your system (that's the theory anyway) I've heard of problems with blocking I/O with green threads, but have no first hand knowledge. Hope this helps. -Mike Jennings - Original Message - From: BARRAUD Valérie To: '[EMAIL PROTECTED]' Sent: Friday, June 01, 2001 9:01 AM Subject: RE: ** JVM and Processes http://java.sun.com/products/jdk/1.1/packs/native-threads/README -Message d'origine- De: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] Date: vendredi 1 juin 2001 17:46 À: [EMAIL PROTECTED] Objet: RE: ** JVM and Processes Randy, Thanks for the advice. Could you be a little more specific, though, about how to use green threads instead of native threads and possibly differences between the
Re: Virtual Host Context Aliasing
Hi Daniel, I have the same problem -- wanting to alias more than one host name to a single context. Unfortunately, there is no way to do this. I've heard that the 4.0 version of Tomcat may have some abilities for doing this, but it's not nearly as straightforward as Apache's ServerAlias directive. For now, I've turned off zzz.net (using your example) in my DNS and am only serving www.zzz.net. I do a lot of connection pooling and other shared resources, so I can't afford to have 2 versions of all my contexts running at the same time. This is a totally unsatisfactory solution, but it's my only choice for the moment. Thanks, --jeff - Original Message - From: Daniel Zen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, May 29, 2001 8:55 AM Subject: Virtual Host Context Aliasing I would think this would be a common question, but I couldn't find it documented, nor asked on this list. Very often domains are served from 2 urls (www.zzz.net zzz.net) with the same functionality. When I configure my virtual hosts in Apache's httpd.conf this is easy: VirtualHost _default_:80 ServerName www.zzz.net ServerAlias zzz.net DocumentRoot /home/httpd/html/zzz Directory /home/httpd/html/zzz/WEB-INF Options None Deny from all /Directory JkMount /*.jsp ajp13 JkMount /servlet/* ajp13 /VirtualHost The following properly placed in server.xml creates 2 seperate contexts for the same set of servlets and JSPs. Functional, but a little wasteful. Host name=www.zzz.net Context path= docBase=/home/httpd/html/zzz crossContext=true debug=0 reloadable=true trusted=false / /Host Host name=zzz.net Context path= docBase=/home/httpd/html/zzz crossContext=true debug=0 reloadable=true trusted=false / /Host Now, I how do I do an alias Context in Tomcat's server.xml so that there is only one Host/Context with multiple names?? Thank you in advance. Daniel Zen
Re: Apache + Tomcat with mod_jk and Virtual Hosts
Yes. See the mail archive for a generic version of my setup: http://mikal.org/interests/java/tomcat/archive/view?mesg=24718 http://mikal.org/interests/java/tomcat/archive/view?mesg=24420 http://mikal.org/interests/java/tomcat/archive/view?mesg=24256 Thanks, --jeff - Original Message - From: Adrian Almenar [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, May 31, 2001 7:03 AM Subject: Apache + Tomcat with mod_jk and Virtual Hosts Please i need help with this can anyone anwser me about this issue ?? With Apache and tomcat working with mod_jk: Its possible to map every virtual host (On Apache) to a different webapp on tomcat ??? I.E. Apache Virtual Host: 123.myhost.com ip: 10.0.0.2 Tomcat Webbapp : tomcat33\webapps\123 Apache Virtual Host: 789.myhost.com ip: 10.0.0.2 Tomcat Webbapp : tomcat33\webapps\789 thanks in advance !!!
Re: Tomcat 3.2.2 bug ???
I think I saw something about this on the tomcat-dev mailing list. Try changing your 404.html file to 404.jsp. You don't need to change the file at all, just rename it with the new extension. Then change the location tag to /404.jsp. Thanks, --jeff - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, May 31, 2001 1:01 PM Subject: Tomcat 3.2.2 bug ??? When i request a non-existing jsp page, the server crash... web.xml error-page error-code404/error-code location/404.html/location /error-page I think the problem is web.xml file in error-page tag.. It do not accept static error pages... Does anybody know the solution?
Re: How to debug a missing servlet error?
Hi Chris, Tomcat should recognize /servlet/briefXSL without the explicit servlet-mapping you are using -- but I don't know if that is what's causing your problem. For all my servlets, I have the following type of entry: servlet servlet-namebriefXSL/servlet-name servlet-classcom.smartbrief.BriefXSL.Servlet/servlet-class /servlet The default Invoker automatically sets up /servlet/ as a mapping for all your defined servlets. So, the above should be enough to get /servlet/briefXSL to pull up correctly -- without the servlet-mapping you have below. Maybe the explicit servlet-mapping you are doing is somehow messing with the default Invoker on Linux, but that's only speculation... Thanks, --jeff - Original Message - From: Chris McNeilly [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, May 31, 2001 1:15 PM Subject: How to debug a missing servlet error? Hi, I have a development environment that works correctly (Win 98), but when I move the code over to my QA environment (Linux) tomcat can no longer find the servlet. I have a web.xml file in the Web-Inf directory that has the following: web-app servlet servlet-name briefXSL /servlet-name servlet-class com.smartbrief.BriefXSLServlet /servlet-class /servlet servlet-mapping servlet-namebriefXSL/servlet-name url-pattern/servlet/briefXSL/url-pattern /servlet-mapping /web-app Tomcat receives the request from apache, but doesn't know what to do with it and spits back a 404. It's almost as if tomcat isn't reading the web.xml file at all. Thanks, Chris
Re: Virtual Host Context Aliasing
What version of Tomcat is supposed to have this Alias / tag? Thanks, --jeff - Original Message - From: Christian Parpart [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, May 31, 2001 5:56 PM Subject: Re: Virtual Host Context Aliasing On Friday 01 June 2001 02:40, you wrote: I have been told from a collegue of mine that an alias tag can be used. I have not tested this though, let me know if this works :) Host name=www.mycompany.com ... ... Alias name=mycompany.com/ ... /Host I've tested it without any success. Unfortunately. But exactly that's it what has been said in the tomcat-server-howto. Is it a bug? It must be Thanks, Christian Parpart http://www.surakware.net --Marcus On Thu, 31 May 2001, Jeff Kilbride wrote: Date: Thu, 31 May 2001 11:12:38 -0700 From: Jeff Kilbride [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Virtual Host Context Aliasing Hi Daniel, I have the same problem -- wanting to alias more than one host name to a single context. Unfortunately, there is no way to do this. I've heard that the 4.0 version of Tomcat may have some abilities for doing this, but it's not nearly as straightforward as Apache's ServerAlias directive. For now, I've turned off zzz.net (using your example) in my DNS and am only serving www.zzz.net. I do a lot of connection pooling and other shared resources, so I can't afford to have 2 versions of all my contexts running at the same time. This is a totally unsatisfactory solution, but it's my only choice for the moment. Thanks, --jeff - Original Message - From: Daniel Zen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, May 29, 2001 8:55 AM Subject: Virtual Host Context Aliasing I would think this would be a common question, but I couldn't find it documented, nor asked on this list. Very often domains are served from 2 urls (www.zzz.net zzz.net) with the same functionality. When I configure my virtual hosts in Apache's httpd.conf this is easy: VirtualHost _default_:80 ServerName www.zzz.net ServerAlias zzz.net DocumentRoot /home/httpd/html/zzz Directory /home/httpd/html/zzz/WEB-INF Options None Deny from all /Directory JkMount /*.jsp ajp13 JkMount /servlet/* ajp13 /VirtualHost The following properly placed in server.xml creates 2 seperate contexts for the same set of servlets and JSPs. Functional, but a little wasteful. Host name=www.zzz.net Context path= docBase=/home/httpd/html/zzz crossContext=true debug=0 reloadable=true trusted=false / /Host Host name=zzz.net Context path= docBase=/home/httpd/html/zzz crossContext=true debug=0 reloadable=true trusted=false / /Host Now, I how do I do an alias Context in Tomcat's server.xml so that there is only one Host/Context with multiple names?? Thank you in advance. Daniel Zen
Re: Setting up Virtual Hosts
Yes: NameVirtualHost 111.222.333.444 VirtualHost www.mydomain.com server.xml: Host www.mydomain.com This is how I have it set up and it works for about 10 domains. --jeff From: Glen Eustace [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] Date: Wed, 23 May 2001 05:28:13 GMT To: [EMAIL PROTECTED] Subject: Re: Setting up Virtual Hosts Apache: VirtualHost www.mydomain.com server.xml: Host www.mydomain.com In your config, you're using an IP in the Apache VirtualHost directive and a hostname in your server.xml config. I have a feeling that may be causing your problems. Try changing your Apache config to use the host name in the VirtualHost directive, rather than the IPAddress and see if that makes a difference. Jeff, can you please confirm that you have the following directive ( with a different IP number of course ) NameVirtualHost 210.55.214.169 in your apache config, and that you have multiple hosts using that same IP number, and that these hosts are the same ones in you tomcat server.xml config. My experimentation would still suggest that tomcat is not doing named virtual hosts. Glen.
Re: Setting up Virtual Hosts
I'm not sure how Apache forwards the host info to Tomcat. If you're using an IP Address in your VirtualHost directive in Apache, then Apache may be sending the IPAddress to Tomcat as opposed to the hostname specified by the ServerName attribute. So, if you're trying to catch host names in your server.xml file, rather than IPAddresses, it may not work. However, this is all speculation and I don't know if that's how it really works. It would make sense, though. The docBase is where Tomcat serves all your files from for that particular webapp. Check out the Developing applications with Tomcat Howto in the docs for an example of setting up source and deployment directories. --jeff From: Glen Eustace [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] Date: Mon, 21 May 2001 05:16:01 GMT To: [EMAIL PROTECTED] Subject: Re: Setting up Virtual Hosts I don't know if it makes a difference or not, but I've always had the same host names in my Apache VHost config and my server.xml file. In your config, you're using an IP Address in Apache and a name in server.xml. You might try using the IP in server.xml instead. All my vhosts use the same IP number as they are all named hosts. Using the IP number in the VirtualHost header just saves a DNS lookup and make starting the server faster. The host: header is matched against the ServerName attribute. Nothing else really jumps out at me. For an example of my config, search the mail archive at: http://mikal.org/interests/java/tomcat/index.jsp Look for Virtual Host or my name. Will do. Thanks. This is very frustrating. Another thought I had was whether the docBase directory must have some special format. The webapps one in the tomcat directory has a bunch of .war files ( which I have no idea what they are for ). Glen.
Re: Setting up Virtual Hosts
Hi Glen, It definitely works with name-based hosts, because that's how I do it. However, I set mine up like this: Apache: VirtualHost www.mydomain.com server.xml: Host www.mydomain.com In your config, you're using an IP in the Apache VirtualHost directive and a hostname in your server.xml config. I have a feeling that may be causing your problems. Try changing your Apache config to use the host name in the VirtualHost directive, rather than the IPAddress and see if that makes a difference. Thanks, --jeff From: Glen Eustace [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] Date: Mon, 21 May 2001 08:26:22 GMT To: [EMAIL PROTECTED] Subject: Re: Setting up Virtual Hosts http://mikal.org/interests/java/tomcat/index.jsp Look for Virtual Host or my name. Will do. Thanks. This is very frustrating. Having browsed around in the archives, I have come to the ( possibly erroeous ) conclusion that tomcat does not support NAMED virtual hosts, but that they are actually IP based. Can someone confim whether tomcat really does use the Host: header to determine the virtual host or is it resolving the host in the URL to an IP number and then finding a host definition that matches it. Thanks. -- Glen Eustace, GodZone Internet Services, a div. of AGRE Enterprises Ltd., P.O. Box 8020, Palmerston North, New Zealand 5301 Tel/Fax: +64 6 357 8168, Mob: +64 21 424 015 E-mail: [EMAIL PROTECTED] Website: http://www.godzone.net.nz
Re: 3.2.1 Dies
It's not necessary to use nohup, but it's a good idea to redirect your standard out and standard error to a logfile when starting up. I use the following line in my startup script called jkup which I placed in /usr/local/bin: $TOMCAT_HOME/bin/startup.sh /var/log/tomcat/startup.log My logs directory in $TOMCAT_HOME is a soft link to /var/log/tomcat, where I keep all my Tomcat related logs. --jeff From: Boris Niyazov [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] Date: Mon, 21 May 2001 15:59:43 -0400 (EDT) To: [EMAIL PROTECTED] Subject: Re: 3.2.1 Dies Why use nohup if you can configure tomcat to log into a file? Logger name=tc_log path=logs/tomcat.log verbosityLevel = DEBUG / * * Boris NiyazovPh: 212-854-4094 Fax: 212-854-1749 * * Systems Manager Email: [EMAIL PROTECTED] * * Columbia Law School URL: http://www.law.columbia.edu * * STDOUT STDERR messages go to nohup.log. In your case you might be loosing those messages as you logged off (they will be sent to /dev/null - trash). Sri At 10:54 AM 05/21/2001 -0700, Hunter Hillegas wrote: What does running with nohup do for you? I usually start Tomcat using tomcat.sh start and then just log out... Hunter From: Srinadh Karumuri [EMAIL PROTECTED] Date: Mon, 21 May 2001 13:43:53 -0400 To: Hunter Hillegas [EMAIL PROTECTED], Tomcat User List [EMAIL PROTECTED] Subject: Re: 3.2.1 Dies - I am running the tomcat using 'nohup' (UNIX command) on Solaris. My OutOfMemory errors were logged in nohup.log Srinadh Karumuri Senior Programmer/Analyst Business Apps. BBN Technologies (Verizon) Ph:(617)873-2841
Re: Setting up Virtual Hosts
Hi Glen, I don't know if it makes a difference or not, but I've always had the same host names in my Apache VHost config and my server.xml file. In your config, you're using an IP Address in Apache and a name in server.xml. You might try using the IP in server.xml instead. Nothing else really jumps out at me. For an example of my config, search the mail archive at: http://mikal.org/interests/java/tomcat/index.jsp Look for Virtual Host or my name. Thanks, --jeff - Original Message - From: Glen Eustace [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, May 19, 2001 6:08 PM Subject: Re: Setting up Virtual Hosts As requested, here are the respective configs. I still think there is something fundamental that I have missed. :-) Apache.conf NB: I have tried with and without the explicit KnMount in the VirtualHost definition. # # mod jk configuration # IfModule mod_jk.c JkWorkersFile /usr/local/tomcat/conf/workers.properties JkLogFile /usr/local/tomcat/logs/mod_jk.log JkLogLevel error JkMount /*.jsp ajp13 JkMount /servlet/* ajp13 /IfModule VirtualHost 210.55.214.169 ServerAdmin [EMAIL PROTECTED] ServerName www-dev.godzone.net.nz DocumentRoot /home/GodZone SetEnv isDevelopment 1 RewriteEngine on RewriteRule (^.+)/gzlogo\.gif$ $1/gzlogo_dev.gif [P] JkMount /*.jsp ajp13 /VirtualHost I added the following definition to server.xml Host name=www-dev.godzone.net.nz Context path= debug=2 docBase=/home/GodZone / /Host I get the following in the tomcat.log 2001-05-20 01:05:29 - ContextManager: Adding context Ctx( /examples ) 2001-05-20 01:05:29 - ContextManager: Adding context Ctx( /admin ) 2001-05-20 01:05:29 - Ctx( ): Set debug to 2 2001-05-20 01:05:29 - ContextManager: Adding context Ctx( www-dev.godzone.net.nz: ) 2001-05-20 01:05:29 - ContextManager: Adding context Ctx( ) 2001-05-20 01:05:29 - ContextManager: Adding context Ctx( /test ) 2001-05-20 01:05:29 - ContextManager: Adding context Ctx( /GodZone ) 2001-05-20 01:05:30 - Ctx( www-dev.godzone.net.nz: ): XmlReader - init /home/GodZone 2001-05-20 01:05:30 - Ctx( www-dev.godzone.net.nz: ): Loading -2147483646 jsp 2001-05-20 01:05:30 - PoolTcpConnector: Starting Ajp12ConnectionHandler on 8007 2001-05-20 01:05:31 - PoolTcpConnector: Starting Ajp13ConnectionHandler on 8009 2001-05-20 01:05:57 - Ctx( www-dev.godzone.net.nz: ): 404 R( + /dates.jsp + null) JSP file not found when I try to access http://www-dev.godzone.net.nz/dates.jsp which definitinetly exists T2.(agree-6)conf: la /home/GodZone/date.jsp -rw-r--r--1 geustace gzsys1043 May 17 19:25 /home/GodZone/date.jsp
Re: Setting up Virtual Hosts
Post the relevant pieces of your apache config and server.xml. Thanks, --jeff - Original Message - From: Glen Eustace [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, May 19, 2001 2:31 PM Subject: Setting up Virtual Hosts I am trying to establish a number of virtual hosts such that the majority of each site is serverd by Apache as usual but the .jsp pages are handled by hosts ../ in tomcat. I have followed the varioss examples in the documentation, but am not having any success. I would appreciate someone who has this working corresponding with me to help me work out what I am missing. I have Apache 1.3.12, tomcat 3.2.1, mod_jk, jdk 1.3 I can not seem to set the docBase in the host context such that the tomcat process can find the existing files, which are in the respective users directories in /home. I have tried the obvious /home/user and that doesn't work, which makes me wonder whether / is / or is somehow relative to the tomcat directories. I am guessing I have made an assumption somewhere that is fundamentally incorrect as this is my first attempt at using tomcat. Any help would be much appreciated. Glen. -- Glen Eustace, GodZone Internet Services, a div. of AGRE Enterprises Ltd., P.O. Box 8020, Palmerston North, New Zealand 5301 Tel/Fax: +64 6 357 8168, Mob: +64 21 424 015 E-mail: [EMAIL PROTECTED] Website: http://www.godzone.net.nz
Re: RequestDispatcher.forward()
Check out the HttpMessage and HttpsMessage classes in the com.oreilly.servlet package available from Jason Hunter at www.servlets.com. Does the same basic connection stuff and returns an InputStream which you can wrap in a BufferedReader like Eric does below. The nice thing is that it does secure ssl (https) connections also with the JSSE jar files -- and it's very easy to setup and use. Thanks, --jeff - Original Message - From: Eric Lubin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, May 18, 2001 8:58 AM Subject: Re: RequestDispatcher.forward() package com.ibm.servconn; import java.net.*; import java.io.*; import java.util.*; import com.ibm.aurora.*; public class URLForward { private String theURL; private String method; public URLForward( String theURL ) { this(theURL,POST); } public URLForward( String theURL, String method ) { this.theURL = theURL; this.method = method; } public String[] execute() throws BehaviorException { Vector v = new Vector(); try { URL theServlet = new URL(theURL); // establish a connection with the server, but do not connect to the servlet yet HttpURLConnection theConnection = (HttpURLConnection)theServlet.openConnection(); theConnection.setRequestMethod(method); // now we can connect to the page theConnection.connect(); // read the results from the servlet as a String BufferedReader in = new BufferedReader(new InputStreamReader(theConnection.getInputStream())); String inputLine; while ((inputLine = in.readLine()) != null) { v.addElement(inputLine); } in.close(); String da[] = new String[v.size()]; v.copyInto(da); return da; } // have to handle these somehow catch( MalformedURLException mue ) { throw new BehaviorException(Malformed URL address,ServConnBhvrErrors.MALFORMED_URL,mue); } catch( IOException ioe ) { throw new BehaviorException(IOException - the translator might be down,ServConnBhvrErrors.CANT_CONNECT_TO_SERVER,ioe); } } } Eric Lubin T/L 443-6954 External: 561-443-6954 Notes ID: elubin@ibmusm20External: [EMAIL PROTECTED] Sebastian Schulz [EMAIL PROTECTED] on 05/18/2001 10:58:33 AM Please respond to [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc: Subject: RequestDispatcher.forward() hi, has somebody a work-around to produce the same behavior as if RequestDispatcher.forward() would work with absolute URL's? tanks in advance! basti
Re: Bean Choices (code question)
Hi Charlie, Thanks for confirming this! I was under the impression that static methods were loaded once and never unloaded, but I wasn't sure. On the same subject, are class constructors called when static methods are accessed? Right now, in my all static method classes, I'm doing my initialization in static blocks. I'm wondering if I can move that initialization into the class constructor, but I'm not sure if/when the constructor is called when a static method is called. Any insight on this point, also, is greatly appreciated. Thanks, --jeff - Original Message - From: Cox, Charlie [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, May 18, 2001 4:28 AM Subject: RE: Bean Choices (code question) there is no gc on static objects. static objects(methods,fields, or classes) are created once on startup and there is only one instance of the method or field ever created that all requestors to your class will use. But with Tomcat I do believe that if you have the same class in 2 different contexts, that it will load two separate instances of your bean due to the different class loaders. This also means that if you are writing to the static fields on the first(or any) call, make sure to synchronize the write, in case 2 calls occur at the same time. Charlie -Original Message- From: Jeff Kilbride [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 17, 2001 8:56 PM To: [EMAIL PROTECTED] Subject: Re: Bean Choices (code question) Yeah, I know, but it's tempting to write all the methods as public static. Then I don't have to create the object at all, but I don't know the affects on garbage collection. --jeff - Original Message - From: Ross Dyson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, May 17, 2001 5:24 PM Subject: RE: Bean Choices (code question) If you make the bean class have a private constructor and a static reference to an instance of its own class, then there will always be a strong reference from the class itself to the instance of the class. (The first call to bean.getInstance() instantiates the private static member variable which is your singleton instance of your bean, the contructor does the db work etc.) Therefore, it won't get gc'd. That's the way I do my classes that do that kind of stuff, anyway. -Original Message- From: Jeff Kilbride [mailto:[EMAIL PROTECTED]] Sent: Friday, 18 May 2001 9:35 AM To: [EMAIL PROTECTED] Subject: Bean Choices (code question) I'm sorry if this is a little off-topic, since it is more about java code, but I thought Tomcat users would be interested/knowledgeable about the way beans work. I have a lot of informational beans that hold static reference data (think ISO codes, State abbreviations, etc...) With these types of beans, I have the choice of instantiating a singleton object reference to the bean and accessing the methods through the object, or making all the methods public static so I can access them via BeanName.method(). For the former, the bean does all of it's initialization and database access in it's constructor and my JSP's have something like the following at the top: %! private static BeanName bean = BeanName.getInstance(); % For the latter, the bean does all of it's initialization and database access in a static block: static { // bean initialization and DB access } and my JSPs reference the static methods: %= BeanName.method() % My question concerns the way beans with all public static methods are instantiated and garbage collected. Because these beans hold unchanging reference info, I only want the data loaded from the database once the first time the bean is referenced. For beans with all public static methods, since there are no object references to them, when are they garbage collected? Is it possible that the bean will be unloaded and the code in my static block will be re-run when the bean is next referenced? Or do these all static objects somehow stick around forever? For the singleton, I know the object will last as long as the JSP is loaded, because there is a definite object reference to the singleton. I'm a little unclear as to what happens with a bean that has all public static methods, though. Can anyone shed some light on this? Thanks, --jeff
Re: Bean Choices (code question)
That's what I thought, too. I guess I'll have to leave my initialization code inside the static blocks. Right now, I'm only using these classes in one context, so the classloader issues don't apply. (yet...) Thanks Charlie and Bo! --jeff - Original Message - From: Cox, Charlie [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, May 18, 2001 11:21 AM Subject: RE: Bean Choices (code question) -Original Message- From: Bo Xu [mailto:[EMAIL PROTECTED]] Sent: Friday, May 18, 2001 1:47 PM To: [EMAIL PROTECTED] Subject: Re: Bean Choices (code question) Jeff Kilbride wrote: Hi Charlie, [...] On the same subject, are class constructors called when static methods are accessed? Right now, in my all static method classes, I'm doing my initialization in static blocks. I'm wondering if I can move that initialization into the class constructor, but I'm not sure if/when the constructor is called when a static method is called. Any insight on this point, also, is greatly appreciated. Thanks, --jeff [...] Hi :-) I did a test, I find: - when I invoke a static method with className.methodName(...), constructor and non-static init-block will not be invoked That's what I thought. The constructor is not invoked because there is no instance of the class. Basically, if it's not static, it won't/can't run until an instance is created. Therefore static methods can only call other static methods in the same class. - it doesn't metter that if this class is a all static method style class or Not,i.e., this class can have all of the following: % static init-block/non-static init-block % static field/non-static(instance) filed % static method/non-static method - only when this class is being loaded into the classloader, static init-block will be invoked(i.e., normally, static init-block only will be invoked One time), now we only have a Class object of my-class, we don't have the instance object of my-class. - I am not sure if the above is righ when Java Reflection is used to find/load this class(like a Servlet container does) I think this is where the classloader(s) issue comes into account and that separate instances in different contexts would be considered different classes. There was a very good explaination of tomcat's classloading discussed in a previous thread : http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg13260.html Bo May.18, 2001 Charlie
Re: Changing Tomcat's User ID
Correct me if I'm wrong, but if you're running with Apache and ajp12 or ajp13, you shouldn't have any problems because Tomcat is only responding on ports 8007 and 8009. You only have problems when you're running Tomcat stand-alone and you want it to respond on the normal http (80) and https (443) ports. However, I've heard it's kind of a nightmare getting all the directory and file permissions correct for the non-root user. --jeff - Original Message - From: Tim O'Neil [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, May 18, 2001 4:00 PM Subject: Re: Changing Tomcat's User ID At 03:05 PM 5/18/2001 -0700, you wrote: I'm running tomcat 3.2.1 on Solaris. It is started in an rc2.d/ script by root, and therefore runs as root. We'd like to be able to have it run as nobody like apache does. Is there a way to do this? I read through the documentation on it, and it mentioned using su inside of the start scripts, but that method did not work. Any help would be greatly appreciated. Thanks, Jason Majors You can't do that, unless you're willing to run it on a port 1024. Remember, ports below 1024 are root access only. Apache gets away with it because it's an admin process that runs as root + a web server process + its native code. Tomcat, being Java, is going to have a hard enough time without a root process to kick it off.
Re: Struts, Velocity, JSP, XSLT?
Speed is one consideration. XML and XSLT are great, but are very processor intense for all the translation/transformation that is done on the fly. --jeff - Original Message - From: Richard Draucker [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, May 16, 2001 9:18 PM Subject: Struts, Velocity, JSP, XSLT? I've been happily using servlets with Tomcat for some time. I'm now happily using XSLT for output (Xalan/Xerces) mostly cause, oh hell, cause 'everyone' says XML is the way to go. The question is... is Velocity vs. XSLT simply a religeous difference? I mean, is there something Velocity and Struts offer over XML/XSLT? Thanks, Richard
Re: Cookies
Look at the session-timeout directive in your web.xml file. The default is 30 minutes. --jeff - Original Message - From: Oki DZ [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, May 16, 2001 10:26 PM Subject: Cookies Hi, I use JDBCRealm and I'd like to have the connection times out after a certain period of time. Currently, it seems that once you have logged in, as long as you don't exit from your browser, the servlets can be run forever. Is there anything I can set in server.xml? TIA, Oki