Re: OutputStream Already in USE ..!!!!
Thanks Benoit , But since i am generating the graph image dynamically and the output of the ACME encoded Gif is directly to the client browser window, i will not be certainly knowing the size. So there is no way i can guess the size. It will always be a blind solution. And also one more query.. How to avoid the Exception error ("..IllegalStateException..OutputStream is already been used..") in the Tomcat window. Please reply soon. Thanks for the Time. Regards.. [ Benoit this time Michael wont be annoyed..Right Michael ;-) ] L G Goundalkar Intertec Communications Pvt Ltd INDIA - Original Message - From: "Benot Jacquemont" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, April 06, 2001 4:14 PM Subject: RE: OutputStream Already in USE .. Usually, you don't set the Content-Length because that's generated pages, and if you set a Content-Length higher than the real size of the generated gif, I don't know how IE or Netscape will react... But you can try it. I think you just have to set the Content-Length the same way you set the Content-Type. Hope that'll help. Benot Ps: Please, try to send your mail in plain text format, otherwise, you annoy Michael ;-) -Message d'origine- De : Lakshmeenrayana [mailto:[EMAIL PROTECTED]] Envoy : vendredi 6 avril 2001 21:26 : [EMAIL PROTECTED]; [EMAIL PROTECTED] Objet : Re: OutputStream Already in USE .. Thanks Benoit and Michael It works in Netscape. But one more strange problem has arrived. If the Size of the graph ( image ) is less..approximately less than 5k or so... The same problem persists..(ASCII Characters output). So how to set the content length..? since i don't know the content length of the graph image generated by the GIF encoder. Please help again. Thanks for the time. Regards.. L G Goundalkar Intertec Communications Pvt Ltd INDIA - Original Message - From: Benot Jacquemont To: [EMAIL PROTECTED] Sent: Friday, April 06, 2001 2:18 PM Subject: RE: OutputStream Already in USE .. I don't know why you get a OutputStream already in use, but the reason why it works with IE and not with Netscape may be because you do not set properly the Content-type of your image. Indeed, IE seems to be a little bit cleverer than Netscape because it interprets the real content of a file before displaying it instead of only looking at the Content-type header property. So you have to be more explicit with Netscape. Benot I am using Tomcat and trying to write a Gif file to client browser window using JSP. I use ACME - GifEncoder to convert the picture to GIF. The Encoder needs OutputStream type object as one of the parameter in its constructor. I am using ServletOutputStream object for this, which i got through response.getOutputStream(). But the tomcat gives Error as "OutputStream already been used." But the GIF image is Displayed properly in IE 5.0. It gives ASCII charactes in Netscape. Why is this so. Please help. Thanks for the time. Regards. L G Goundalkar Intertec Communications Pvt Ltd INDIA
Email troubles
Hi , I'm sorry, but I receive al lot of mail where the mail delivery programm complains with Diagnostic-Code: 501 5.1.8 [EMAIL PROTECTED]... Domain of sender address [EMAIL PROTECTED] does not exist I receive only the status text and not the message, which i'm interested in. I could also help you solving this problem. But since i cannot receive your email here, you could contact me over [EMAIL PROTECTED] Thank you Niels
Re: Testing JSP
If you're using a differenct machine to edit the JSP files, check that the clocks are synchronised, this is a common problem... On Fri, 6 Apr 2001, Joseph A. Noble wrote: How do I get tomcat to re-compile a JSP page? I've successfully loaded a JSP page and it runs fine. I made a slight change and now can not figure out how to get tomcat to recognize the changes to the JSP page source.
Re: Testing JSP
Moin and Kevin, Thank you both very much for replying. What I ended up having to do was shutdown apache/tomcat, delete the files (class java) from the work directory, and then restart tomcat/apache. It's working now. What was confusing is that I had looked at the java file in the work directory and it had the changes, it's just that it wouldn't serve this version. Where was it storing the version it was serving? The computer had been shut down many, many times and each time I'd reboot, it would sit there for a long time before serving the page the first time. This seems confusing to me. What was the long delay for if it wasn't recreating the java/class files and why wasn't it serving the new version it had just created? Is this the process I have to follow for every JSP modification: Shutdown, delete, startup? THANKS -joe- "Moin Anjum H." wrote: Hi, Try to refresh the browser. Press Shift+Reload To reload the again from the server. If even than never works delete all the files in the work directory of tomcat and restart tomcat HTH Moin. "Joseph A. Noble" wrote: Hello List, How do I get tomcat to re-compile a JSP page? I've successfully loaded a JSP page and it runs fine. I made a slight change and now can not figure out how to get tomcat to recognize the changes to the JSP page source. HELP -joe- -- [EMAIL PROTECTED] http://www.flashman.com/ (303) 971-8780 B-24 Crew Registry http://www.flashman.com/cgi-bin/crew-reg.cgi -- [EMAIL PROTECTED] / [EMAIL PROTECTED] http://www.flashman.com/ (303) 971-8780 B-24 Crew Registry http://www.flashman.com/cgi-bin/crew-reg.cgi
Re: Testing JSP
It finally dawned on me. The file I had changed was an included file. Duh, I guess the process described in the message below is indeed what's required when an included file is changed. -joe- "Joseph A. Noble" wrote: Moin and Kevin, Thank you both very much for replying. What I ended up having to do was shutdown apache/tomcat, delete the files (class java) from the work directory, and then restart tomcat/apache. It's working now. What was confusing is that I had looked at the java file in the work directory and it had the changes, it's just that it wouldn't serve this version. Where was it storing the version it was serving? The computer had been shut down many, many times and each time I'd reboot, it would sit there for a long time before serving the page the first time. This seems confusing to me. What was the long delay for if it wasn't recreating the java/class files and why wasn't it serving the new version it had just created? Is this the process I have to follow for every JSP modification: Shutdown, delete, startup? THANKS -joe- "Moin Anjum H." wrote: Hi, Try to refresh the browser. Press Shift+Reload To reload the again from the server. If even than never works delete all the files in the work directory of tomcat and restart tomcat HTH Moin. "Joseph A. Noble" wrote: Hello List, How do I get tomcat to re-compile a JSP page? I've successfully loaded a JSP page and it runs fine. I made a slight change and now can not figure out how to get tomcat to recognize the changes to the JSP page source. HELP -joe- -- [EMAIL PROTECTED] http://www.flashman.com/ (303) 971-8780 B-24 Crew Registry http://www.flashman.com/cgi-bin/crew-reg.cgi -- [EMAIL PROTECTED] / [EMAIL PROTECTED] http://www.flashman.com/ (303) 971-8780 B-24 Crew Registry http://www.flashman.com/cgi-bin/crew-reg.cgi -- [EMAIL PROTECTED] / [EMAIL PROTECTED] http://www.flashman.com/ (303) 971-8780 B-24 Crew Registry http://www.flashman.com/cgi-bin/crew-reg.cgi
apache+tomcat DSO is garbled?
I have tomcat up and running on my machine. Yesterday I upgraded Apache to 1.3.19 after I did this when I attempt to start the webserver with either mod_jk or mod_jserv I get. Syntax error on line 8 of /var/tomcat/conf/mod_jk.conf-auto: API module structure `jk_module' in file /usr/local/apache/libexec/mod_jk.so is garbled - perhaps this is not an Apache module DSO? /usr/local/apache/bin/apachectl start: httpd could not be started I have searched the archives and have made sure that I am compiling with the correct version of apxs. There was talk about making sure that all modules compiled into apache are compiled into mod_jk. I didn't understand this. If this is the reason I would appreciate it if someone could give a more detailed explanation of what that means. As I said everything was running properly and I have shared objects compiled into apache. /usr/local/apache/conf# httpd -l Compiled-in modules: http_core.c mod_env.c mod_log_config.c mod_mime.c mod_negotiation.c mod_status.c mod_include.c mod_autoindex.c mod_dir.c mod_cgi.c mod_asis.c mod_imap.c mod_actions.c mod_userdir.c mod_alias.c mod_access.c mod_auth.c mod_so.c mod_setenvif.c mod_access_referer.c mod_perl.c mod_pcgi2.c mod_roaming.c mod_dav.c mod_fastcgi.c mod_dynvhost.c mod_gzip.c mod_auth_mysql.c Thanks for any help. Aaron
Internal Servlet Error
Hello, I am using Tomcat 3.2 with Windows 2000. I was trying to implement a jsp tutorial example using HTML forms and beans. The code is as follows. GetName.html HTML BODY FORM METHOD=POST ACTION="SaveName.jsp" What's your name? INPUT TYPE=TEXT NAME=username SIZE=20BR What's your e-mail address? INPUT TYPE=TEXT NAME=email SIZE=20BR What's your age? INPUT TYPE=TEXT NAME=age SIZE=4 PINPUT TYPE=SUBMIT /FORM /BODY /HTML UserData.java public class UserData { String username; String email; int age; public void setUsername( String value ) { username = value; } public void setEmail( String value ) { email = value; } public void setAge( int value ) { age = value; } public String getUsername() { return username; } public String getEmail() { return email; } public int getAge() { return age; } } SaveName.jsp jsp:useBean id="user" class="UserData" scope="session"/ jsp:setProperty name="user" property="*"/ HTML BODY A HREF="NextPage.jsp"Continue/A /BODY /HTML NextPage.jsp jsp:useBean id="user" class="UserData" scope="session"/ HTML BODY You enteredBR Name: %= user.getUsername() %BR Email: %= user.getEmail() %BR Age: %= user.getAge() %BR /BODY /HTML Now when I submit the form , I get the following error. Error 500 Internal Servlet Error: org.apache.jasper.JasperException: Unable to compile class for JSPC: \Tomcat\work\localhost_8080\_0002fjsp_0002fSaveName_0002ejspSaveName_jsp_0.java:67: Class jsp.UserData not found. UserData user = null; ^ C: \Tomcat\work\localhost_8080\_0002fjsp_0002fSaveName_0002ejspSaveName_jsp_0.java:70: Class jsp.UserData not found. user= (UserData) ^ C: \Tomcat\work\localhost_8080\_0002fjsp_0002fSaveName_0002ejspSaveName_jsp_0.java:75: Class jsp.UserData not found. user = (UserData)
Re: Tomcat3.2+Redhat 7.0+glibc-2.x.x+jdk1.x == stable??
The glibc that RH7 shipped with was beta and very broken - you need to apply their patch set. Red Hat rushed their 7.0 release, breaking their convention (major version = new Linux kernel) and a lot of stuff besides. Most of the new stuff in it is GUI related, and as such you may be better sticking with 6.2 for server use. Depending on what your code does, you may get better performance from a green threads VM - with 1.3 these are starting to go away; you can still get green threads with the Sun JDK using --classic but I believe it hobbles HotSpot. We still run 1.2.2 in production and are evaluating the 1.3 VM's for stability. Like most open source projects, Apache stuff comes from a Unix heritage, and while you can shoehorn it onto Windows, you will have a much easier life if you stick with Linux. Just check this newsgroup - 90% of the traffic is "I can't get x, y or z to work on NT" Chris Price wrote: Hi; I know its kind of an open ended question, but I would like some input (factual or anecdotal) on other peoples success in running various combinations of glibc + jdk + kernel (does kernel mattrer much?). I am currently running the Sun JDK 1.3.0 with glibc-2.1.92 and kernel 2.2.16-22 on a *very* stock RH 7.0. This combination is proving itself to be quite unstable, with the Tomcat http listener and/or servlet engine dying under moderate loads (less than 4,000 hits roughly over 8 hours). The glibc + kernel are stock RH7.0 pieces, and while I am sure I can probably gain some stability by upgrading to newer ones, I would like to know if there is a "optimal" (used loosely) combination that exists. I am inheriting this setup from an Admin that thought that Linux 'sucked' and that we should move to NT. The previous admin didn't know how to use rpm, compile a kernel, or have a clue as to what glibc is. Needless to say, I can probably add some value and squeeze some better performance from our Tomcat app servers. Cheers Chris Price
setDefaultFactory
Hi, I wanted to verify, for real, that only the J2EE appserver is allowed to call JspFactory.setDefaultFactory(). Since the answer is probably no, I would like to ask Tomcat committee if they can create a nice API for setting a custom PageContext within a specific JSP. PageContext is an abstract class. Let us override it! Please! Thanks, Andy
apache vhost-mod_jk-servlet container
Hi All! This is my first post, so bear with me. I've been struggling with this problem for awhile. I'm trying to get tomcat to handle servlet requests outside of $TOMCAT_HOME/webapps/WEB-INF. I am trying to do this because I have multiple apache vhosts pointing to multiple server paths for what needs to be multiple servlet containers. Here are some example server paths to demonstrate my point... /home/domain1.com/servlet /home/domain2.com/servlet ...I have already setup the following files like so and actually have jsp working in my multiple server paths no problem. It's the servlet directories that aren't working and just give me error 404. httpd.conf... *all irrelevant information stripped* VirtualHost 0.0.0.0:80 DocumentRoot /home/thesovereigngroup.com/www/pu blic_html ServerName www.thesovereigngroup.com JkMount /*.jsp ajp13 JkMount /servlet/* ajp13 /VirtualHost server.xml... Host name="www.thesovereigngroup.com" Context path="" docBase="/home/thesovereigngroup.com/www/public _html" debug="0"/ Context path="/servlet" docBase="/home/thesovereigngroup.com/www/public _html/servlet" debug="0"/ /Host despite what looks to me like a proper configuration, when I point my web browser at http://www.thesovereigngroup.com/servlet/servle texample i get a 404 error. I imagined at first this was because i didn't declare the servlet in web.xml. So I copied it to /home/thesovereigngroup.com/www/public_html/ servlet and declared a servlet like so... servlet servlet-name hello /servlet-name servlet-class HelloWorldExample /servlet-class /servlet servlet-mapping servlet-name hello /servlet-name url-mapping /hello /url-mapping /servlet-mapping ...no dice still didn't work. There seems to be very little documentation on this sort of thing, and what it boils down to is I'm trying to make tomcat host multiple servlet containers. Any ideas? Brendon
Re: Tomcat3.2+Redhat 7.0+glibc-2.x.x+jdk1.x == stable??
Chris, I've got tomcat 3.2.1/apache on two machines both RH 7.0 with minimal modifications. On one I upgraded to RedHat's stock 2.2.17 and glibc-2.1.92-14, one is straight out of the box. I have run the upgraded machine with IBM JDK 1.1.8, Sun JDK 1.2.2, and IBM JDK 1.3.0 with no problem. The other is a disaster just waiting to be upgraded. --Len Chris Price writes: Hi; I know its kind of an open ended question, but I would like some input (factual or anecdotal) on other peoples success in running various combinations of glibc + jdk + kernel (does kernel mattrer much?). I am currently running the Sun JDK 1.3.0 with glibc-2.1.92 and kernel 2.2.16-22 on a *very* stock RH 7.0. This combination is proving itself to be quite unstable, with the Tomcat http listener and/or servlet engine dying under moderate loads (less than 4,000 hits roughly over 8 hours). The glibc + kernel are stock RH7.0 pieces, and while I am sure I can probably gain some stability by upgrading to newer ones, I would like to know if there is a "optimal" (used loosely) combination that exists. I am inheriting this setup from an Admin that thought that Linux 'sucked' and that we should move to NT. The previous admin didn't know how to use rpm, compile a kernel, or have a clue as to what glibc is. Needless to say, I can probably add some value and squeeze some better performance from our Tomcat app servers. Cheers Chris Price -- Len Berman [EMAIL PROTECTED] IBM Research Voice:(914)784-7353 30 Saw Mill River RdFax: (914)784-6324 Hawthorne, NY 10532
Re: Internal Servlet Error
Where is the class relative to the jsp? Recheck the docs. I'm not 100% sure, but I think it needs to be in the Web-inf\classes directory under the web app's document root or in your system's classpath. Larry [EMAIL PROTECTED] 04/07/01 10:45AM Hello, I am using Tomcat 3.2 with Windows 2000. I was trying to implement a jsp tutorial example using HTML forms and beans. The code is as follows. GetName.html HTML BODY FORM METHOD=POST ACTION="SaveName.jsp" What's your name? INPUT TYPE=TEXT NAME=username SIZE=20BR What's your e-mail address? INPUT TYPE=TEXT NAME=email SIZE=20BR What's your age? INPUT TYPE=TEXT NAME=age SIZE=4 PINPUT TYPE=SUBMIT /FORM /BODY /HTML UserData.java public class UserData { String username; String email; int age; public void setUsername( String value ) { username = value; } public void setEmail( String value ) { email = value; } public void setAge( int value ) { age = value; } public String getUsername() { return username; } public String getEmail() { return email; } public int getAge() { return age; } } SaveName.jsp jsp:useBean id="user" class="UserData" scope="session"/ jsp:setProperty name="user" property="*"/ HTML BODY A HREF="NextPage.jsp"Continue/A /BODY /HTML NextPage.jsp jsp:useBean id="user" class="UserData" scope="session"/ HTML BODY You enteredBR Name: %= user.getUsername() %BR Email: %= user.getEmail() %BR Age: %= user.getAge() %BR /BODY /HTML Now when I submit the form , I get the following error. Error 500 Internal Servlet Error: org.apache.jasper.JasperException: Unable to compile class for JSPC: \Tomcat\work\localhost_8080\_0002fjsp_0002fSaveName_0002ejspSaveName_jsp_0.java:67: Class jsp.UserData not found. UserData user = null; ^ C:
[ANNOUNCEMENT] Tomcat 3.2.2 beta 2 released
I am pleased to announce that the Tomcat 3.2.2 beta 3 release is now available for download at http://jakarta.apache.org/builds/tomcat/release/v3.2.2-beta-3 Beta 3 contains a fix for a security hole that has been identified in the Tomcat 3.2.2 beta 1 and beta 2 releases. The security hole had the potential to expose directory listings and file contents outside a web application. The problem first appeared in Tomcat 3.2.2 beta 1 and does not exist in Tomcat 3.2.1. If you are using any Tomcat 3.2.2 beta release please upgrade to the Beta 3 release as soon as possible. Marc A. Saegesser
Re: apache vhost-mod_jk-servlet container
Here's an example of the setup I have running (info changed to be generic...) httpd.conf: VirtualHost 1.2.3.4 ServerName www.tld.com DocumentRoot "/home/websites/tld" JkMount /servlet/* ajp13 JkMount /*.jsp ajp13 Alias /mywebapp "/path/to/your/webapp/mywebapp" Directory "/path/to/your/webapp/mywebapp" allow from all /Directory Location "/mywebapp /WEB-INF" AllowOverride None deny from all /Location Location "/mywebapp /META-INF" AllowOverride None deny from all /Location /VirtualHost server.xml: !-- Virtual host setup -- Host name="www.tld.com" Context path="" docBase="/path/to/your/webapp/mywebapp" crossContext="false" debug="0" reloadable="true" /Context /Host -- I noticed you had the DocumentRoot for Apache set to the same directory as your docBase. Is that really what you want? I usually try to keep these two separate. Since the docBase represents the top-level of my webapp, I usually alias the docBase to a relative path with a meaningful name -- so people access it from the web as www.tld.com/mywebapp, as opposed to www.tld.com. I'm not even sure if having the docBase and DocumentRoot the same will work. I've never tried it that way. (Does anybody know?) Also, you don't need to declare the "/servlet" context explicitly. The above config will give the following: www.tld.com access to DocumentRoot in httpd.conf www.tld.com/mywebapp access to the docBase in server.xml ability to run JSP files in the docBase directory www.tld.com/servlet access to servlets/JSP in your WEB-INF/classes directory ability to run servlets/JSP from WEB-INF/classes Your servlet mappings in your web.xml file below are correct. I got all of this from the Apache-Tomcat and mod_jk Howto's located here: http://jakarta.apache.org/tomcat/jakarta-tomcat/src/doc/index.html I had to read them a couple of times and switch back and forth through the examples, before it really made sense. Hope this helps! --jeff - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, April 07, 2001 7:03 PM Subject: apache vhost-mod_jk-servlet container Hi All! This is my first post, so bear with me. I've been struggling with this problem for awhile. I'm trying to get tomcat to handle servlet requests outside of $TOMCAT_HOME/webapps/WEB-INF. I am trying to do this because I have multiple apache vhosts pointing to multiple server paths for what needs to be multiple servlet containers. Here are some example server paths to demonstrate my point... /home/domain1.com/servlet /home/domain2.com/servlet ...I have already setup the following files like so and actually have jsp working in my multiple server paths no problem. It's the servlet directories that aren't working and just give me error 404. httpd.conf... *all irrelevant information stripped* VirtualHost 0.0.0.0:80 DocumentRoot /home/thesovereigngroup.com/www/pu blic_html ServerName www.thesovereigngroup.com JkMount /*.jsp ajp13 JkMount /servlet/* ajp13 /VirtualHost server.xml... Host name="www.thesovereigngroup.com" Context path="" docBase="/home/thesovereigngroup.com/www/public _html" debug="0"/ Context path="/servlet" docBase="/home/thesovereigngroup.com/www/public _html/servlet" debug="0"/ /Host despite what looks to me like a proper configuration, when I point my web browser at http://www.thesovereigngroup.com/servlet/servle texample i get a 404 error. I imagined at first this was because i didn't declare the servlet in web.xml. So I copied it to /home/thesovereigngroup.com/www/public_html/ servlet and declared a servlet like so... servlet servlet-name hello /servlet-name servlet-class HelloWorldExample /servlet-class /servlet servlet-mapping servlet-name hello /servlet-name url-mapping /hello /url-mapping /servlet-mapping ...no dice still didn't work. There seems to be very little documentation on this sort of thing, and what it boils down to is I'm trying to make tomcat host multiple servlet containers. Any ideas? Brendon
[ANNOUNCEMENT] Tomcat 3.2.2 beta 3 released
I am pleased to announce that the Tomcat 3.2.2 beta 3 release is now available for download at http://jakarta.apache.org/builds/tomcat/release/v3.2.2-beta-3 Beta 3 contains a fix for a security hole that has been identified in the Tomcat 3.2.2 beta 1 and beta 2 releases. The security hole had the potential to expose directory listings and file contents outside a web application. The problem first appeared in Tomcat 3.2.2 beta 1 and does not exist in Tomcat 3.2.1. If you are using any Tomcat 3.2.2 beta release please upgrade to the Beta 3 release as soon as possible. Marc A. Saegesser