RE: Malformed URL Exception: unknown protocol: c
Then I'm at loss as to what the issue is. The fact that it works in some cases, and not others, has me puzzled. I'd suggest digging into the javax.xml source and see if you can figure out the condition that throws the exception, etc. And I'm still not fully clear on whether our C:\... strings are considered valid URI's according to the spec, though they must be, as everything seems to work. Good luck. | Jay Burgess [Vertical Technology Group] | Essential Technology Links | http://www.vtgroup.com/ -Original Message- From: Franklin Phan [mailto:[EMAIL PROTECTED] Sent: Thursday, August 25, 2005 5:09 PM To: Tomcat Users List Subject: Re: Malformed URL Exception: unknown protocol: c Jay, I did that just last night. I got: C:\Program Files\Apache Group\Tomcat 4.1\webapps\htmaint\WEB-INF\work_xml Franklin Phan Cygna Energy Services www.cygna.net Jay Burgess wrote: Why don't you do: System.out.println(getServletContext().getRealPath(XML_WORK_PATH)); And see what it tells you. I'd be curious to see what you're passing to the StreamSource constructor, and how it differs from my string. Jay -Original Message- From: Franklin Phan [mailto:[EMAIL PROTECTED] Sent: Thursday, August 25, 2005 4:52 PM To: Tomcat Users List Subject: Re: Malformed URL Exception: unknown protocol: c To make things a bit more puzzling, I have a different app inside the same Tomcat 4.1.18 that uses the same XSL Transform class under its own web app context. That app works without a hitch. Why is that? Jay Burgess wrote: First, I assume you mean CLASSPATH and /lib, or PATH and /bin, but not CLASSPATH and /bin? Second, your situation has me puzzled. Mark's answer appears correct, as unknown protocol: c is typically the C:\ of a Windows filesystem path. And checking the documentation, StreamSource requires a URI, so a windows filesystem path won't work. However...my code does something very similar, and it works. The only difference is that I'm doing it for a StreamResult, not a StreamSource: String root = getServletContext().getRealPath(); String xmlFileName = root + File.separator + WEB-INF + File.separator + TestData.xml; TransformerFactory.newInstance().newTransformer().transform( new DOMSource(buffer), new StreamResult(xmlFileName)); // DOM into XML I just threw in a quick println(), and xmlFileName is equal to C:\tomcat-5.0.19\webapps\TestApp\WEB-INF\TestData.xml. Can anyone explain why mine works and Franklin's fails? Maybe I'm missing something obvious. Jay | Jay Burgess [Vertical Technology Group] | Essential Technology Links | http://www.vtgroup.com/ -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Thursday, August 25, 2005 4:21 PM To: Tomcat Users List Subject: Re: Malformed URL Exception: unknown protocol: c I assume becuase the url you pass it starts c:\ as that is the start of the XML_WORK_PATH. You need to prefix it with file:/// (or however many slashes you need to get this to work in windows). Mark Franklin Phan wrote: I use Windows XP Pro. My JAVA_HOME environment variable points to c:\j2sdk1.4.2_05. The CLASSPATH is set to have as the first element %JAVA_HOME%\bin. I've written an XSL Transform servlet that makes use of the package javax.xml.transform. Why do I get the following error: javax.servlet.ServletException: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: java.net.MalformedURLException: unknown protocol: c The four lines above actually appear altogether in one line. And the error appears to be due to the following piece of code where I'm trying to get the path to a folder on the local drive to access a file: String XML_WORK_PATH = /WEB-INF/work_xml; TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = tFactory.newTransformer(new javax.xml.transform.stream.StreamSource(getServletContext().getRealPath(XML_WORK_PATH) + \\ + xslParam)); //xslParam is an XSL file name The Malformed URL Exception does not occur on another machine running Windows XP Server. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Malformed URL Exception: unknown protocol: c
First, I assume you mean CLASSPATH and /lib, or PATH and /bin, but not CLASSPATH and /bin? Second, your situation has me puzzled. Mark's answer appears correct, as unknown protocol: c is typically the C:\ of a Windows filesystem path. And checking the documentation, StreamSource requires a URI, so a windows filesystem path won't work. However...my code does something very similar, and it works. The only difference is that I'm doing it for a StreamResult, not a StreamSource: String root = getServletContext().getRealPath(); String xmlFileName = root + File.separator + WEB-INF + File.separator + TestData.xml; TransformerFactory.newInstance().newTransformer().transform( new DOMSource(buffer), new StreamResult(xmlFileName)); // DOM into XML I just threw in a quick println(), and xmlFileName is equal to C:\tomcat-5.0.19\webapps\TestApp\WEB-INF\TestData.xml. Can anyone explain why mine works and Franklin's fails? Maybe I'm missing something obvious. Jay | Jay Burgess [Vertical Technology Group] | Essential Technology Links | http://www.vtgroup.com/ -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Thursday, August 25, 2005 4:21 PM To: Tomcat Users List Subject: Re: Malformed URL Exception: unknown protocol: c I assume becuase the url you pass it starts c:\ as that is the start of the XML_WORK_PATH. You need to prefix it with file:/// (or however many slashes you need to get this to work in windows). Mark Franklin Phan wrote: I use Windows XP Pro. My JAVA_HOME environment variable points to c:\j2sdk1.4.2_05. The CLASSPATH is set to have as the first element %JAVA_HOME%\bin. I've written an XSL Transform servlet that makes use of the package javax.xml.transform. Why do I get the following error: javax.servlet.ServletException: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: java.net.MalformedURLException: unknown protocol: c The four lines above actually appear altogether in one line. And the error appears to be due to the following piece of code where I'm trying to get the path to a folder on the local drive to access a file: String XML_WORK_PATH = /WEB-INF/work_xml; TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = tFactory.newTransformer(new javax.xml.transform.stream.StreamSource(getServletContext().getRealPath(XML_WORK_PATH) + \\ + xslParam)); //xslParam is an XSL file name The Malformed URL Exception does not occur on another machine running Windows XP Server. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Malformed URL Exception: unknown protocol: c
Why don't you do: System.out.println(getServletContext().getRealPath(XML_WORK_PATH)); And see what it tells you. I'd be curious to see what you're passing to the StreamSource constructor, and how it differs from my string. Jay -Original Message- From: Franklin Phan [mailto:[EMAIL PROTECTED] Sent: Thursday, August 25, 2005 4:52 PM To: Tomcat Users List Subject: Re: Malformed URL Exception: unknown protocol: c To make things a bit more puzzling, I have a different app inside the same Tomcat 4.1.18 that uses the same XSL Transform class under its own web app context. That app works without a hitch. Why is that? Jay Burgess wrote: First, I assume you mean CLASSPATH and /lib, or PATH and /bin, but not CLASSPATH and /bin? Second, your situation has me puzzled. Mark's answer appears correct, as unknown protocol: c is typically the C:\ of a Windows filesystem path. And checking the documentation, StreamSource requires a URI, so a windows filesystem path won't work. However...my code does something very similar, and it works. The only difference is that I'm doing it for a StreamResult, not a StreamSource: String root = getServletContext().getRealPath(); String xmlFileName = root + File.separator + WEB-INF + File.separator + TestData.xml; TransformerFactory.newInstance().newTransformer().transform( new DOMSource(buffer), new StreamResult(xmlFileName)); // DOM into XML I just threw in a quick println(), and xmlFileName is equal to C:\tomcat-5.0.19\webapps\TestApp\WEB-INF\TestData.xml. Can anyone explain why mine works and Franklin's fails? Maybe I'm missing something obvious. Jay | Jay Burgess [Vertical Technology Group] | Essential Technology Links | http://www.vtgroup.com/ -Original Message- From: Mark Thomas [mailto:[EMAIL PROTECTED] Sent: Thursday, August 25, 2005 4:21 PM To: Tomcat Users List Subject: Re: Malformed URL Exception: unknown protocol: c I assume becuase the url you pass it starts c:\ as that is the start of the XML_WORK_PATH. You need to prefix it with file:/// (or however many slashes you need to get this to work in windows). Mark Franklin Phan wrote: I use Windows XP Pro. My JAVA_HOME environment variable points to c:\j2sdk1.4.2_05. The CLASSPATH is set to have as the first element %JAVA_HOME%\bin. I've written an XSL Transform servlet that makes use of the package javax.xml.transform. Why do I get the following error: javax.servlet.ServletException: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: java.net.MalformedURLException: unknown protocol: c The four lines above actually appear altogether in one line. And the error appears to be due to the following piece of code where I'm trying to get the path to a folder on the local drive to access a file: String XML_WORK_PATH = /WEB-INF/work_xml; TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = tFactory.newTransformer(new javax.xml.transform.stream.StreamSource(getServletContext().getRealPath(XML_WORK_PATH) + \\ + xslParam)); //xslParam is an XSL file name The Malformed URL Exception does not occur on another machine running Windows XP Server. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: 10 connection limit with IIS and JK/ISAPI 1.2.14
I don't really have an answer for you, but Google'ing iis 10 connection limit returns a lot of hits. It looks like a fairly common question/issue. Maybe it'll help. Jay | Jay Burgess [Vertical Technology Group] | Essential Technology Links | http://www.vtgroup.com/ -Original Message- From: David [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 24, 2005 3:09 PM To: tomcat-user@jakarta.apache.org Subject: 10 connection limit with IIS and JK/ISAPI 1.2.14 I'm using Tomcat 5.5.9 on Windows Server 2003, JDK 1.5.0_04, IIS 6.0, with the JK 1.2.14 isapi_redirector.dll. I've been trying to track down a problem whereby all of the web apps under our Tomcat instance are seeming to stall. There's no indication of any problems in the Tomcat logs themselves. I suspect IIS is unable to forward requests to Tomcat. I either have to recycle the IIS worker process or restart Tomcat to resolve the problem. Here's what I'm seeing with netstat (port 8008 is my AJP 1.3 port): Z:\netstat -a -n | grep 8008 TCP0.0.0.0:8008 0.0.0.0:0 LISTENING TCP147.92.2.137:2871 147.92.2.137:8008 ESTABLISHED TCP147.92.2.137:2915 147.92.2.137:8008 ESTABLISHED TCP147.92.2.137:2944 147.92.2.137:8008 ESTABLISHED TCP147.92.2.137:2965 147.92.2.137:8008 ESTABLISHED TCP147.92.2.137:2969 147.92.2.137:8008 ESTABLISHED TCP147.92.2.137:3019 147.92.2.137:8008 ESTABLISHED TCP147.92.2.137:3034 147.92.2.137:8008 ESTABLISHED TCP147.92.2.137:3039 147.92.2.137:8008 ESTABLISHED TCP147.92.2.137:3041 147.92.2.137:8008 ESTABLISHED TCP147.92.2.137:3060 147.92.2.137:8008 ESTABLISHED TCP147.92.2.137:8008 147.92.2.137:2871 ESTABLISHED TCP147.92.2.137:8008 147.92.2.137:2915 ESTABLISHED TCP147.92.2.137:8008 147.92.2.137:2944 ESTABLISHED TCP147.92.2.137:8008 147.92.2.137:2965 ESTABLISHED TCP147.92.2.137:8008 147.92.2.137:2969 ESTABLISHED TCP147.92.2.137:8008 147.92.2.137:3019 ESTABLISHED TCP147.92.2.137:8008 147.92.2.137:3034 ESTABLISHED TCP147.92.2.137:8008 147.92.2.137:3039 ESTABLISHED TCP147.92.2.137:8008 147.92.2.137:3041 ESTABLISHED TCP147.92.2.137:8008 147.92.2.137:3060 ESTABLISHED Every time the stall has happened, I have noticed that there are always exactly ten connetions between IIS and Tomcat (they're on the same server). Everything works fine until we reach this point. In my JK log, I'm seeing things like this: [Wed Aug 24 14:10:57 2005] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (961): Can't receive the response message from tomcat, network problems or tomcat is down (147.92.2.137:8008), err=-54 [Wed Aug 24 14:10:57 2005] [error] ajp_get_reply::jk_ajp_common.c (1503): Tomcat is down or refused connection. No response has been sent to the client (yet) My workers.properties looks like this: worker.list=ajp13a worker.ajp13a.port=8008 worker.ajp13a.host=www.bvu.edu worker.ajp13a.type=ajp13 cachesize=20 cache_timeout=600 recycle_timeout=300 And here's the AJP connection defininition from my server.xml: Connector port=8008 maxThreads=150 minSpareThreads=25 maxSpareThreads=75 enableLookups=false redirectPort=443 debug=5 connectionTimeout=2 protocol=AJP/1.3/ Any idea what might be happening? It sure looks like I'm hitting some kind of 10 connection limit somewhere, but I can't seem to figure out where. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JSP including servlet output
Not a full explanation, but the Javadoc for ServletResponse.getOutputStream() does say: Throws: java.lang.IllegalStateException - if the getWriter method has been called on this response Conversely, getWriter() says: Throws: java.lang.IllegalStateException - if the getOutputStream method has already been called for this response object It'd seem that the Writer had already been acquired. Jay | Jay Burgess [Vertical Technology Group] | Essential Technology Links via RSS | http://www.vtgroup.com/ -Original Message- From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] Sent: Friday, June 17, 2005 1:21 PM To: tomcat-user@jakarta.apache.org Subject: Re: JSP including servlet output Never mind, got it... changed: ServletOutputStream out = response.getOutputStream(); ..to... PrintWriter out = response.getWriter(); ...and it now works. I wouldn't mind an explanation though :) -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Fri, June 17, 2005 2:02 pm, Frank W. Zammetti said: Hey all... I have a situation where I want to use a jsp:include whos target is actually a servlet... Problem is, in the servlet I do: ServletOutputStream out = response.getOutputStream(); out.println(items.getItem()); ...which yields: java.lang.IllegalStateException org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(ServletResponseWrapperInclude.java:62) Commenting out those two lines gets rid of the exception. If I call the servlet directly on its own I get my expected result, so I know the servlet itself works. I'm assuming this is some sort of limitation of the include mechanism, question is, can it be overcome? I added flush=true to the include tag, which gets rid of the exception but makes the resultant page end where the include is, so that's not the answer. An ideas? Is this something that can be done in the first place? If so, how does one overcome this problem? TIA! -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Automatic WAR updates - suggestions wanted
Our Tomcat 5.0.19/Windows 2000 web application is self-updating. It can download the newest version of itself (ie. a .WAR), and then spawn a Windows .bat file to do an app update. This batch file shuts down Tomcat, deletes the webapp's files and directories under Tomcat, copies the new .WAR across, and then restarts Tomcat. Tomcat then redeploys the new WAR. However, very infrequently, one or more files seem to be locked in one of our webapp subdirectories when we try to remove the current app. (We're not yet sure why.) Since not all of the the subdirectories are gone, Tomcat does not redeploy the new .WAR on restart, and our app is effectively dead in the water. Am I missing a setting in server.xml/context.xml/web.xml that can indicate always re-deploy a .WAR, regardless of whether the webapp subdiretory tree is present or not? Thanks. Jay | Jay Burgess [Vertical Technology Group] | Essential Technology Links via RSS | http://www.vtgroup.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: can't see a tomcat installation on home network
I'm coming in late to this thread, but the word Telnet caught my eye. I just debugged a Telnet issue today by running Ethereal and seeing what was going on at the network level. Maybe something like that will work for you? Ethereal is great, and can be found at http://www.ethereal.com// Jay Vertical Technology Group Essential Technology Links http://www.vtgroup.com/ -Original Message- From: Jason Bainbridge [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 19, 2005 5:01 PM To: Tomcat Users List Subject: Re: can't see a tomcat installation on home network On 4/19/05, Greg Baynham [EMAIL PROTECTED] wrote: I've installed Tomcat on a Linux fedora box but am unable to access it from a windows xp home edition box. I've found the IP address for the Linux box but when I type that in with the :8080 at the end of the address on the XP box it eventually returns that the connection was refused. So are you trying http://192.168.2.188:8080 including the http:// part in Internet Explorer? Although if telnet isn't working that would seem to indicate another problem most likely with a firewall setting somewhere. Regards, -- Jason Bainbridge http://kde.org - [EMAIL PROTECTED] Personal Site - http://jasonbainbridge.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: session-timeout
Think of the timeout as a 30 minute countdown timer. Every time there is any session activity, like a page request, the timers starts over. If the timer ever gets to 0, then the session times out. Jay Vertical Technology Group http://www.vtgroup.com/ -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: Thursday, April 14, 2005 10:13 AM To: Tomcat Users List Subject: Re: session-timeout If more than idle for 30 minutes. -Tim Cédric Buschini wrote: Hi every, from web.xml: session-config session-timeout30/session-timeout /session-config Does the session-timeout refer to an idle session or an active session ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: class path (UNCLASSIFIED)
Yes, doing a javac -h to receive help says -classpath path. But the angle brackets from path are not meant to be included. Jay Vertical Technology Group http://www.vtgroup.com/ -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 13, 2005 10:32 AM To: Tomcat Users List Subject: RE: class path (UNCLASSIFIED) From: S M [mailto:[EMAIL PROTECTED] Subject: RE: class path (UNCLASSIFIED) Now compiling c:/javacodejavac -classpathc:\tomcat\common\lib\servlet.jar HelloWorld.java it said - Access Denied Where are these angle brackets coming from? They should not be present. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: DBCP Please Help Get Working Properly
Do you have anything in your Tomcat log files that might help? If not, you can bump up the debug levels in server.xml and you might get some more info. I also found that adding one of the two following listeners in my server.xml helped me debug my DBCP problems (I don't remember which one I added, but it should be obvious): Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener debug=9/ Listener className=org.apache.catalina.core.NamingContextListener debug=9/ Jay Vertical Technology Group http://www.vtgroup.com/ -Original Message- From: Scott Purcell [mailto:[EMAIL PROTECTED] Sent: Friday, April 08, 2005 3:08 PM To: Tomcat Users List Subject: DBCP Please Help Get Working Properly Hello, I am trying to use the DBCP features of Tomcat 5.5.7. I created a webapp named testDB and put it under $CATALINA_HOME/webapps/testDB. Then I created a testDB.xml file under $CATALINA_HOME/conf/Catalina/localhost/testDB.xml. // here it is Context path=/testDB docBase=testDB debug=5 reloadable=true crossContext=true Resource name=jdbc/testDB auth=Container type=javax.sql.DataSource maxActive=100 maxIdle=30 maxWait=1 username=javauser password=javadude driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/fritest?autoReconnect=true/ /Context I have been following the notes from: http://localhost/tomcat-docs/jndi-datasource-examples-howto.html I made sure I completed the rest of the tasks. WEB-INF has the two tag locations, and the resource ref. eg: taglib taglib-uri/WEB-INF/sql.tld/taglib-uri taglib-location/WEB-INF/sql.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/c.tld/taglib-uri taglib-location/WEB-INF/c.tld/taglib-location /taglib resource-ref descriptionDB Connection/description res-ref-namejdbc/testDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref I finally hit my jsp page which is this: %@ taglib uri=http://java.sun.com/jsp/jstl/sql; prefix=sql % %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c % sql:query var=rs dataSource=jdbc/testDB select id, foo, bar from testdata /sql:query html head titleDB Test/title /head body h2Results/h2 c:forEach var=row items=${rs.rows} Foo ${row.foo}br/ Bar ${row.bar}br/ /c:forEach /body /html And I get no results: Now I am pretty sure I have all configured. Because if I use a fallback (Tomcat 4.1) code piece I had, I get results using the same settings: package foo; import javax.naming.*; import javax.sql.*; import java.sql.*; public class DBTest { String foo = Not Connected; int bar = -1; public void init() { try{ Context ctx = new InitialContext(); if(ctx == null ) throw new Exception(Boom - No Context); DataSource ds = (DataSource)ctx.lookup( java:comp/env/jdbc/testDB); if (ds != null) { Connection conn = ds.getConnection(); if(conn != null) { foo = Got Connection +conn.toString(); Statement stmt = conn.createStatement(); ResultSet rst = stmt.executeQuery( select id, foo, bar from testdata); while(rst.next()) { System.out.println(next ); foo=rst.getString(2); bar=rst.getInt(3); } conn.close(); } } }catch(Exception e) { e.printStackTrace(); } } public String getFoo() { return foo; } public int getBar() { return bar;} } And using the above class works all day. The only difference I see is that the class using a naming import and the jsp does not. Can anyone help. Thanks, Scott -Original Message- From: David Smith [mailto:[EMAIL PROTECTED] Sent: Friday, April 08, 2005 1:14 PM To: Tomcat Users List Subject: Re: Add Context Path, Tomcat 5.5.7 Hi. Take a look at this for where to put Context elements: http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html This is new with Tomcat 5.0 and is continued in Tomcat 5.5 --David Scott Purcell wrote: Hello, I am following the information here to add DBCP to my application. http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-datasource-examples-howto.html I am reading to add the Context path=/DBTest ... from the above docs. The instructions say to . Configure the JNDI DataSource in Tomcat by adding a declaration for your resource to $CATALINA_HOME/conf/server.xml. Add this in between the /Context tag of the examples context and the /Host tag closing the localhost definition. So cool, I opened up the server.xml, but do not see any existing context or host tags in it. Here is my server.xml file. Does anyone know where I put the Context for the DBCP stuff? Thanks, '!-- Example Server Configuration File -- !-- Note
RE: DBCP Please Help Get Working Properly
My apologies, we're using 5.0.x and I hadn't realized they went away. But maybe the logs still will provide some useful info? Jay Vertical Technology Group http://www.vtgroup.com/ -Original Message- From: Robert Harrison [mailto:[EMAIL PROTECTED] Sent: Friday, April 08, 2005 4:20 PM To: Tomcat Users List Subject: Re: DBCP Please Help Get Working Properly Aren't debug levels in TC 5.5 inactive? Will need to set up log4j. Bob On Apr 8, 2005 5:15 PM, Jay Burgess [EMAIL PROTECTED] wrote: Do you have anything in your Tomcat log files that might help? If not, you can bump up the debug levels in server.xml and you might get some more info. I also found that adding one of the two following listeners in my server.xml helped me debug my DBCP problems (I don't remember which one I added, but it should be obvious): Listener className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener debug=9/ Listener className=org.apache.catalina.core.NamingContextListener debug=9/ Jay Vertical Technology Group http://www.vtgroup.com/ -Original Message- From: Scott Purcell [mailto:[EMAIL PROTECTED] Sent: Friday, April 08, 2005 3:08 PM To: Tomcat Users List Subject: DBCP Please Help Get Working Properly Hello, I am trying to use the DBCP features of Tomcat 5.5.7. I created a webapp named testDB and put it under $CATALINA_HOME/webapps/testDB. Then I created a testDB.xml file under $CATALINA_HOME/conf/Catalina/localhost/testDB.xml. // here it is Context path=/testDB docBase=testDB debug=5 reloadable=true crossContext=true Resource name=jdbc/testDB auth=Container type=javax.sql.DataSource maxActive=100 maxIdle=30 maxWait=1 username=javauser password=javadude driverClassName=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/fritest?autoReconnect=true/ /Context I have been following the notes from: http://localhost/tomcat-docs/jndi-datasource-examples-howto.html I made sure I completed the rest of the tasks. WEB-INF has the two tag locations, and the resource ref. eg: taglib taglib-uri/WEB-INF/sql.tld/taglib-uri taglib-location/WEB-INF/sql.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/c.tld/taglib-uri taglib-location/WEB-INF/c.tld/taglib-location /taglib resource-ref descriptionDB Connection/description res-ref-namejdbc/testDB/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref I finally hit my jsp page which is this: %@ taglib uri=http://java.sun.com/jsp/jstl/sql; prefix=sql % %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c % sql:query var=rs dataSource=jdbc/testDB select id, foo, bar from testdata /sql:query html head titleDB Test/title /head body h2Results/h2 c:forEach var=row items=${rs.rows} Foo ${row.foo}br/ Bar ${row.bar}br/ /c:forEach /body /html And I get no results: Now I am pretty sure I have all configured. Because if I use a fallback (Tomcat 4.1) code piece I had, I get results using the same settings: package foo; import javax.naming.*; import javax.sql.*; import java.sql.*; public class DBTest { String foo = Not Connected; int bar = -1; public void init() { try{ Context ctx = new InitialContext(); if(ctx == null ) throw new Exception(Boom - No Context); DataSource ds = (DataSource)ctx.lookup( java:comp/env/jdbc/testDB); if (ds != null) { Connection conn = ds.getConnection(); if(conn != null) { foo = Got Connection +conn.toString(); Statement stmt = conn.createStatement(); ResultSet rst = stmt.executeQuery( select id, foo, bar from testdata); while(rst.next()) { System.out.println(next ); foo=rst.getString(2); bar=rst.getInt(3); } conn.close(); } } }catch(Exception e) { e.printStackTrace(); } } public String getFoo() { return foo; } public int getBar() { return bar;} } And using the above class works all day. The only difference I see is that the class using a naming import and the jsp does not. Can anyone help. Thanks, Scott -Original Message- From: David Smith [mailto:[EMAIL PROTECTED] Sent: Friday, April 08, 2005 1:14 PM To: Tomcat Users List Subject: Re: Add Context Path, Tomcat 5.5.7 Hi. Take a look at this for where to put Context elements: http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html This is new with Tomcat 5.0 and is continued in Tomcat 5.5 --David Scott Purcell wrote: Hello, I am following the information here to add DBCP to my application. http
RE: java.library.path - DLL - Domino
Have you tried putting it into your system path via the PATH environment variable? (If you're running Tomcat as a service, you'll need to reboot to have it take effect I think.) If it's there, what happens if you run rundll32 nlsxbe SomeDummyEntryPoint? it should find the DLL, but complain about the invalid entry point. Jay Vertical Technology Group http://www.vtgroup.com/ -Original Message- From: Durfee, Bernard [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 06, 2005 3:34 PM To: Tomcat Users List Subject: java.library.path - DLL - Domino I am trying to use the native library for connecting to Domino from a servlet. I was under the impression that the DLL needed to be in the path specified by the java.library.path system property. However, this does not seem to work. I got to the point where even brute force did not work... System.setProperty(java.library.path, D:\\Lotus\\Domino); m_logger.info(Using java.library.path: + System.getProperty(java.library.path)); ...from the logger... Using java.library.path: D:\Lotus\Domino ...then the line... System.loadLibrary(nlsxbe); ...fails with the following exception... java.lang.UnsatisfiedLinkError: no nlsxbe in java.library.path at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.loadLibrary0(Unknown Source) at java.lang.System.loadLibrary(Unknown Source) ...and indeed I do have a DLL file D:\Lotus\Domino\nlsxbe.dll. This is on a Windows 2000 machine. Any ideas? Bernard Durfee - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: java.library.path - DLL - Domino
Having just done something similar with a different app's DLL and seen the same error, all I had to do was make sure the DLL was in my system PATH (and reboot as I had Tomcat running as a service). Sorry I don't have another idea. Jay Vertical Technology Group http://www.vtgroup.com/ -Original Message- From: Durfee, Bernard [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 06, 2005 4:18 PM To: Tomcat Users List Subject: RE: java.library.path - DLL - Domino Yes, I started by making sure that the DLL was in the Windows system path. I also tried running the DLL as you suggested and it did indeed find the DLL and complain about the bad entry point. I believe that Tomcat supplies a special class loader to each web application. I also believe that the class loader is expected to find libraries and such. So the question is, where do I put my DLL so that the web application class loader can find it? Apparently the answer is not java.library.path, unless there is a bug in Tomcat preventing it from properly parsing the path. Bernard Durfee -Original Message- From: Jay Burgess [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 06, 2005 5:01 PM To: tomcat-user@jakarta.apache.org Subject: RE: java.library.path - DLL - Domino Have you tried putting it into your system path via the PATH environment variable? (If you're running Tomcat as a service, you'll need to reboot to have it take effect I think.) If it's there, what happens if you run rundll32 nlsxbe SomeDummyEntryPoint? it should find the DLL, but complain about the invalid entry point. Jay Vertical Technology Group http://www.vtgroup.com/ -Original Message- From: Durfee, Bernard [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 06, 2005 3:34 PM To: Tomcat Users List Subject: java.library.path - DLL - Domino I am trying to use the native library for connecting to Domino from a servlet. I was under the impression that the DLL needed to be in the path specified by the java.library.path system property. However, this does not seem to work. I got to the point where even brute force did not work... System.setProperty(java.library.path, D:\\Lotus\\Domino); m_logger.info(Using java.library.path: + System.getProperty(java.library.path)); ...from the logger... Using java.library.path: D:\Lotus\Domino ...then the line... System.loadLibrary(nlsxbe); ...fails with the following exception... java.lang.UnsatisfiedLinkError: no nlsxbe in java.library.path at java.lang.ClassLoader.loadLibrary(Unknown Source) at java.lang.Runtime.loadLibrary0(Unknown Source) at java.lang.System.loadLibrary(Unknown Source) ...and indeed I do have a DLL file D:\Lotus\Domino\nlsxbe.dll. This is on a Windows 2000 machine. Any ideas? Bernard Durfee - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
error-page vs. errorPage
Can someone explain the relationship between the error-page element in my webapp's WEB.XML versus the errorPage attribute of the page directive within a JSP? I'm trying to create a single error page that handles any exceptions generated by the JSPs within my webapp, without having to name the error page in every JSP. To start with, I added the following to my web app's WEB.XML to indicate a catch all error page for the app: error-page exception-typejava.lang.Exception/exception-type location/error.jsp/location /error-page I also marked ERROR.JSP as an error page by including the following at the top (note the isErrorPage attribute): %@ page contentType=text/html; charset=ISO-8859-1 buffer=64kb isErrorPage=true % Unfortunately, when trying to access the exception object in ERROR.JSP, I get a NullPointerException, as though it doesn't exist. Since I thought this should work, I must be missing something? (I'm using Tomcat 4.0.4, by the way.) Thanks. Jay -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Mailing List Load.... Forum???
Hey STEVE R BURRUS! (And anyone else that wants to adopt an I EXPECT you to help me! attitude.) It's really bad netiquette to say things like since you didn't see fit to respond to my email message to u last nite, and more especially will you please try to do a better job of responding back to me than the poor job that you apparently did last nite? Something more along the lines of My message may have gotten lost in the mix last night, so I'm resending in case someone can help me out. and I don't know if my previous reply got sent correctly, so here's a second try. are much more likely to get the desired response. Be a little courteous, a little humble, and little grateful, and you'd be amazed at how much support you'll get in return. My two cents. Jay -Original Message- From: STEVE R BURRUS [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 27, 2002 2:03 PM To: Tomcat Users List Subject: Re: Mailing List Load Forum??? Hello there, Milton, this is Steve Burrus again, and since you didn't see fit to respond back to my email message to u last nite, I thought that I would give you another electronic shout right now! Listen, I think that the proposal to create a comp.lang.java-server-side new newsgroup is A WONDERFUL IDEA!!!I simply cannot stress/emphasize this enough, as far as I am personally concerned!!! I mean, I have looked around ALL of the available newsgroups for some time now and found nothing at all in the way of a newsgroup that even remotely dealt with the server-side of Java Programming!! And, I will admit just to u that I am now actively studying to create a career for myself of being some kind of a server-side Java programmer! I was wondering why the hell is there not already a server-side Java Programming newsgroup floating around cyberspace?? Well Milt, will you please try to do a better job of responding back to me than the poor job that you apparently did last nite? Yours Truly, Steve R. Burrus --- Milt Epstein [EMAIL PROTECTED] wrote: On Thu, 27 Jun 2002, Steve Russell wrote: I think this list would make an excellent usenet group ( comp.lang.java.server-side ? ). I read the documents that you need to read before writing a usenet new newsgroup proposal. Those docs said it was VITAL to have good justifications for your proposed group in your proposal. According to the docs about the only universally accepted justification for a new usenetgroup would be a mailing list under HEAVY, HEAVY traffic. Thats this list. If the owners of the list are interested in working with me I'll pitch in some work in creating a proposal for a comp.lang.java-server-side There was a similar proposal done some time back. It failed -- barely -- not that there were a lot of dissenting votes, just not enough assenting ones. I don't recall how long ago that vote was, but I think it's been longer than the six month moratorium before you can retry it. If you're really interested in this, you should contact the person that tried it back then, and see what his plans are, whether he plans to retry with all the wisdom gained from that experience. If so, maybe you can join efforts. Even if he isn't planning on doing that, it'd probably be very useful to talk to him. You can search at groups.google.com to find out all about it. Milt Epstein Research Programmer Systems and Technology Services (STS) Campus Information Technologies and Educational Services (CITES) University of Illinois at Urbana-Champaign (UIUC) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Memory Leak?
Doesn't matter, you don't name an instance variable and a parameter the same thing.??? Unless I'm completely missing the point of your comment, Of course you can. I do it all the time, and it's in lots of books that way. Prefixing with this. separates the two variables. Your suggestion of looking at the generated code is a good one. Tomcat may have trouble parsing a JSP with an inner class, and be generating something different than what we'd expect. I don't see anything obviously wrong looking at the sample code. Jay -Original Message- From: Phillip Morelock [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 29, 2002 1:15 PM To: Tomcat Users List Subject: Re: Memory Leak? Doesn't matter, you don't name an instance variable and a parameter the same thing. Was that really the code from your page? Because there were syntax errors (no semicolon, etc.). It might be a very good idea to go into /work and find out if what you *think* it's translating to is really what it is (/work is where tomcat puts the .java files it translates from your jsp and then compiles them into servlets). I have found very rare instances where my personal concept of how tomcat is parsing my code is different from the reality. fillup On 5/29/02 11:10 AM, Mark Shurgot [EMAIL PROTECTED] wrote: That doesn't seem to be the problem. Regardless of variable names, the problem still occurs (we tried changing them around earlier as a last resort). The parameter is already corrupt after being received by the constructor, and before any assignment. Also, the local instance variable is identified by this. -Original Message- From: Phillip Morelock [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 29, 2002 11:02 AM To: Tomcat Users List Subject: Re: Memory Leak? You are using the same name for the parameter to the constructor and the instance variable for your inner class. fillup On 5/29/02 10:55 AM, Mark Shurgot [EMAIL PROTECTED] wrote: I am having the strangest problem with Tomcat and inner classes. In a few JSP pages, we use inner classes (beefed up structs) to store information retrieved from a database into a collection class (Vector). It seems that somewhere between getting the data from the result set and constructing and storing an instance of the (data holding) inner class in a Vector, the data is getting corrupted (doubles only). Example: JSP - %! // inner class class SomeClass { public double dSomeDouble; public SomeClass(double dSomeDouble) { // label: point 2 this.dSomeDouble = dSomeDouble; // some other data members } } % % // execute some query to get info, get results as JDBC ResultSet oResult Vector oVecResults = new Vector() double dDoubleVal = oResult.getDobule(1); // label: point 1 (dDobuleVal is intact) oVecResults.add(new SomeClass(dDoubleVal)); // label: point 3 % END JSP At point 1 the values retrieved from the database are intact, and remain so until passed into the constructor of the inner class. At point 2 dSomeDouble becomes corrupt (some random number out of memory), and remains so past point 3. Added twist: This problem only occurs after a page has been hit 5 times (3 times for larger pages). (1st time, Tomcat compiles the page, next four times the page is loaded in memory). Config: Apache Tomcat 4.0.1 (exact same problem found in Linux and Windows versions). Any ideas? Extracting the inner class from the page fixes the problem, but is not a desired solution. Any help is appreciated. -- -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Why ignore sendRedirect() for an include? - solved
This question ended up getting answered back on the JSP list (many thanks to Hans Bergsten!). The spec very clearly calls out the issue in section JSP.4.4: An included page only has access to the JspWriter object and it cannot set headers. This precludes invoking methods like setCookie(). Attempts to invoke these methods will be ignored. My oversight. Thanks anyway. Jay -Original Message- From: Jay Burgess [mailto:[EMAIL PROTECTED]] Sent: Monday, May 20, 2002 11:08 AM To: [EMAIL PROTECTED] Subject: Why ignore sendRedirect() for an include? I started this discussion on the JSP list, but am led to believe now that this is a Tomcat issue. Can someone explain otherwise? My problem is that a sendRedirect() issued by my servlet is not being honored by Tomcat 4.0.3. The servlet is being called via a jsp:include block from within a JSP. The sendRedirect() is the first thing in my doGet(). As long as the response hasn't been committed, this should be legal, right? (I confirmed that the response had not been committed with res.isCommitted() .) To confuse me even more, I found the following in the Tomcat source (ApplicationHttpResponse.java): /** * Disallow codesendRedirect()/code calls on an included response. * * @param location The new location * * @exception IOException if an input/output error occurs */ public void sendRedirect(String location) throws IOException { if (!included) ((HttpServletResponse) getResponse()).sendRedirect(location); } Can someone confirm that the reason my sendRedirect() is failing is because of the above (!included) check, and even more importantly, WHY you don't allow sendRedirect()'s on an included response? Thanks. Jay -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
jsp:param value?
I tried this question on the JSP list, but haven't received any replies. I don't honestly know whether this is a Tomcat issue, or my error in reading the spec. Very simply, shouldn't the percent sign be valid in the following jsp:param element? jsp:include page=myservlet flush=true jsp:param name=width4 value=33%/ /jsp:include Tomcat 4.0.3 doesn't parse this include block correctly. Jay -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Browser continues to run after response received
Only because we had a different browser problem that was fixed by the latest IE Service Pack release, I thought I mention that IE 5.5 SP2 is the latest version. In case you're not running the latest, it might be worth verifying your problem against it. Jay -Original Message- From: Kia Lewis [mailto:[EMAIL PROTECTED]] Sent: Monday, October 01, 2001 1:35 PM To: '[EMAIL PROTECTED]' Subject: Browser continues to run after response received Hi, I hope I'm posting to the correct list, but here goes! I'm running Tomcat 3.2.3 standalone with IE 5.5 and I'm using Struts 1.0. I have a jsp which contains 2 IFrames which also contain jsp's. I use a javascript to submit one of the pages in the IFrame. The iframe page calls an Action object which returns my response. The response gets returned correctly with no delay, but my browser keeps running as if it is still waiting on a response. It will report Done in the status bar and the little icon at the top left hand corner of the screen stops turning, but the blue bar at the bottom of the screen still shows that its working. This hanging doesn't happen every single time I submit the page, but it does happen about 30% of the time. Even if the page is still working, I have no delay in getting a response if I submit the page again. I'm worried that my users will think that the page isn't complete since the jsp returns so quickly, yet the page appears to be working. I've seen some similar issues on this board and was wondering if anyone had any suggestions. Thanks for any help, K Lewis -- Jay Burgess Delano Technology Corporation mailto:[EMAIL PROTECTED] (913) 438-9444 x154
RE: There is no disk in the drive!
See below for article Q102418 from the Microsoft Knowledge Base (http://search.support.microsoft.com/kb/). Maybe you've got a drive in your PATH that XCOPY is having trouble with? One guess is that it's using the System Account when running from Tomcat as a service, but your account when running from the Command Prompt. This might explain the difference in behavior that you're seeing. Either fix the PATH and/or take a look at the Log On As option of the Startup dialog for the service. You might be able to start the service as a different user and fix the problem as well. Jay CAUSE This problem occurs when the PATH statement in the AUTOEXEC.BAT file, Windows NT System Environment Variables, or User Environment Variables for user name references a floppy disk drive or CD-ROM drive. If you reference a floppy disk or CD-ROM drive in the AUTOEXEC.BAT, Windows NT 4.0 does not display the error when you log on but will display the error when you run applications such as EDIT.COM, WRITE.EXE or NOTEPAD.EXE. RESOLUTION To work around this problem, either have a disk in the drive or remove the entry from the PATH statement. The drive letter may not be entered in the PATH statement, but will be found in the following registry location: HKEY_LOCAL_MACHINE\SYSTEM\SETUP\WinntPath Delete it here and log back in. MORE INFORMATION When a user logs into his or her account, Windows NT searches for an AUTOEXEC.BAT file in the root directory of drive C. If the file is found, NTVDM.EXE appends its PATH environment variable to the system PATH environment variable. Only the VDM PATH variable is affected. NTVDM tests the PATH statement for validity. If the drive physically exits, NTVDM tests or the drive type (removable media or fixed). If the drive is a floppy disk or CD-ROM, it tests for the presence of valid media. If none is found, the error message is displayed. If invalid drives are used in the AUTOEXEC.BAT PATH statement, no error message is displayed, but the PATH variable in any VDMs that are opened will be invalid. The same message may also be displayed if you try to start an application such as NOTEPAD.EXE in Program Manager by choosing Run from the File menu. -Original Message- From: Adam Fowler [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 11, 2001 12:48 PM To: [EMAIL PROTECTED] Subject: Re: There is no disk in the drive! Hi, It could be trying to get a lock on a used file. No idea how to fix it though 8o) Adam. On Wednesday 11 July 2001 15:16, you wrote: When I run my web application using Tomcat as a service under windows 2000 (Tomcat 3.1.1) I'm running into a strange message. My app runs an eternal .cmd file to populate some directories. One of the lines in the cmd file is xcopy InitialProject\*.* Projects\%1 /E This works fine when Tomcat is not a service, but when it is a service, the server machine twice puts up a message box with: There is no disk in the drive. Please insert a disk in the drive \Device\Harddisk\DR1. If I hit Continue it goes on to work just fine. If I put in two xcopy statements the message comes up four times, so it seems to be a result of the two xcopy arguments. Changing the argument paths to explicit paths doesn't help. E.g., xcopy C:\Tomcat\XXX\InitialProject\*.* C:\Tomcat\XXX\Projects\%1 /E Other commands (e.g., mkdir) don't seem to have any problem. Any idea how to fix this? Thanks, Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions. -- Jay Burgess Delano Technology Corporation mailto:[EMAIL PROTECTED] (913) 438-9444 x154
RE: Is Tomcat 3.2.1 supported on Windows 2000?
Are you SURE that worker_file is defined to be: tomcat_root\conf\workers.properties And not: tomcat_root\conf\worker.properties (Note the extra s.) It's an easy mistake to make, and it gives you the error you described. Jay -Original Message- From: George Prado [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 15, 2001 1:00 PM To: [EMAIL PROTECTED] Subject: Is Tomcat 3.2.1 supported on Windows 2000? Importance: High I am trying to integrate Tomcat 3.2.1 with IIS 5.0 in Windows 2000. I followed the instructions in tomcat-iis-howto but the isapi_redirect.dll is not starting. I made sure that the registry definitions for the Apache Software Foundation are correct (extension_uri, log_level, log_file, worker_file, and worker_mount_file). The actual error that is logged in the Event Viewer is, The HTTP Filter DLL D:\jakarta-tomcat-3.2.1\bin\win32\i386\isapi_redirect.dll failed to load. The data is the error. For additional information specific to this message please visit the Microsoft Online Support site located at: http://www.microsoft.com/contentredirect.asp. The isapi.log file is not created at all. Please let me know how to resovle this problem. Is it possible that this Tomcat 3.2.1 is not supported on Windows 2000? Or, is there a different configuration instruction that I need to follow. Thanks in advance George Prado -- Jay Burgess Delano Technology Corporation mailto:[EMAIL PROTECTED] (913) 438-9444 x154
RE: Servlet -- File -- Web-browser
I agree with your (2) statement below, at least if Apache is running on Windows. Flushing doesn't really help, as there is a specific issue with buffering in Apache on Windows. We had to introduce a patch to HTTP_PROTOCOL.C that someone posted in a newsgroup to solve the problem. It's comment pretty much summarizes the details: /* * WIN32 pipes will ALWAYS block until data arrives, * therefore the ap_bread() will NEVER return 0, * therefore we will never flush r-connection-client, * therefore the client will only get data when we have * pushed in enough to write to the socket (IOBUFSIZE * probably) or the script finishes, * therefore server push does not work. * Work around this by always flushing before a read. * This is probably quite inefficient in some cases. */ if (ap_bflush(r-connection-client) 0) { ap_log_rerror(APLOG_MARK, APLOG_INFO, r, client stopped connection before send body completed); ap_bsetflag(r-connection-client, B_EOUT, 1); r-connection-aborted = 1; break; } If you can't find the details of this patch, let me know and I'll send you a copy of the file. Unfortunately, though, it means you'll have to set up a build environment for Windows (which is something we didn't have to do before). Jay -Original Message- From: William Kaufman [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 03, 2001 5:00 PM To: '[EMAIL PROTECTED]' Subject: RE: Servlet -- File -- Web-browser I didn't answer, because I'd hoped someone could say for sure. But my own guesses are: 1) The Cancel button in IE doesn't actually do anything once the data starts streaming. I've suspected this was the case, and it sounds like you've got evidence. 2) Apache is buffering the response somehow: directly connected to Netscape, you get an immediate exception when writing to a closed stream; but, with Apache in the middle, the writes don't happen immediately, and no exception is propagated to the servlet. My only advice would be to flush your servlet output early and often: you might (or might not) get an exception immediately. -- Bill K. -Original Message- From: alan leung [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 03, 2001 10:43 AM To: [EMAIL PROTECTED] Subject: Re: Servlet -- File -- Web-browser can any one helps me out? thanks again. --- alan leung [EMAIL PROTECTED] wrote: Hi, I have a servlet reads a file from FileInputStream and copy those bytes to ServletOutputStream and send back to web browser. But if user click CANCEL while downloading in netscape. i will get an exception in doGet method. -- IOException in doGet(): java.net.SocketException: Connection aborted by peer: socket write error if user click CANCEL in IE (Internet Explorer). i didn't get any exception print out. Both cases is browser connect to servlet engine directly (tomcat) if browser connects to apache server -- then tomcat; no exception got caught for netscape and IE if user click CANCEL while download. What i think is clicking CANCEL while downloading a file would lost the TCP connection without ending it. which would always rise an IOException right? Why if i use apache server w/ tomcat or IE connect to tomcat directly won't cause IOException in doGet() method? thanks. -- Jay Burgess Delano Technology Corporation mailto:[EMAIL PROTECTED] (913) 438-9444 x154