Re: tomcat comet, not working...
forgive my ignorance please, but what exactly is tomcat comet anyway?? I have never heard of it before so enlighten me about it. Márton Szabolcs wrote: Hi! Ive been trying to use tomcat comet for about a week, but i have no success. I have tomcat 6.0.13, with windows xp. I install the tomcat, change the server.xml connector tag to NIO connector type. Test the chat example, and another example (push a date to the client every x sec.) But its seems that comet is not working. If i implement the servlet service method, it is runned. And its run like a normal servlet (I implement the CometProcessor, and i have the event method!!) If i no implement the service method, my browser says this url.. cannot acces... GET methdod) or something like this. So it is never get processed like a comet request. What else do i need? what is wrong? i tryed without js client. When i call servlet, it will not close the connection, just keep. so its should work. I search google all around the world, nothing found, not even a working example. Please help me... thanks Szabi 35% kedvezmény a Partvonal Kiadó köteteire - hogy minden olvasó kézhez kapja a maga könyvét. http://ad.adverticum.net/b/cl,1,6022,172067,232579/click.prm - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat comet, not working...
if your service method is invoked means you are not running the correct connector. You must run the NIO or the APR connector. take a look at the protocol attribute in http://tomcat.apache.org/tomcat-6.0-doc/config/http.html Filip Márton Szabolcs wrote: Hi! Ive been trying to use tomcat comet for about a week, but i have no success. I have tomcat 6.0.13, with windows xp. I install the tomcat, change the server.xml connector tag to NIO connector type. Test the chat example, and another example (push a date to the client every x sec.) But its seems that comet is not working. If i implement the servlet service method, it is runned. And its run like a normal servlet (I implement the CometProcessor, and i have the event method!!) If i no implement the service method, my browser says this url.. cannot acces... GET methdod) or something like this. So it is never get processed like a comet request. What else do i need? what is wrong? i tryed without js client. When i call servlet, it will not close the connection, just keep. so its should work. I search google all around the world, nothing found, not even a working example. Please help me... thanks Szabi 35% kedvezmény a Partvonal Kiadó köteteire - hogy minden olvasó kézhez kapja a maga könyvét. http://ad.adverticum.net/b/cl,1,6022,172067,232579/click.prm No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.472 / Virus Database: 269.8.0/821 - Release Date: 5/27/2007 3:05 PM - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat comet, not working...
Can you send me your examples? Bernd 2007/5/29, Filip Hanik - Dev Lists [EMAIL PROTECTED]: if your service method is invoked means you are not running the correct connector. You must run the NIO or the APR connector. take a look at the protocol attribute in http://tomcat.apache.org/tomcat-6.0-doc/config/http.html Filip Márton Szabolcs wrote: Hi! Ive been trying to use tomcat comet for about a week, but i have no success. I have tomcat 6.0.13, with windows xp. I install the tomcat, change the server.xml connector tag to NIO connector type. Test the chat example, and another example (push a date to the client every x sec.) But its seems that comet is not working. If i implement the servlet service method, it is runned. And its run like a normal servlet (I implement the CometProcessor, and i have the event method!!) If i no implement the service method, my browser says this url.. cannot acces... GET methdod) or something like this. So it is never get processed like a comet request. What else do i need? what is wrong? i tryed without js client. When i call servlet, it will not close the connection, just keep. so its should work. I search google all around the world, nothing found, not even a working example. Please help me... thanks Szabi 35% kedvezmény a Partvonal Kiadó köteteire - hogy minden olvasó kézhez kapja a maga könyvét. http://ad.adverticum.net/b/cl,1,6022,172067,232579/click.prm No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.472 / Virus Database: 269.8.0/821 - Release Date: 5/27/2007 3:05 PM - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat comet, not working...
Hi! i set my connector like this. it should be correct, isnt it? Connector port=8080 protocol=org.apache.coyote.http11.Http11NioProtocol maxThreads=150 connectionTimeout=2 redirectPort=8443 / servlet servlet-nameCometSampleServlet/servlet-name servlet-classsample.CometSampleServlet/servlet-class /servlet servlet-mapping servlet-nameCometSampleServlet/servlet-name url-pattern/CometSampleServlet/url-pattern /servlet-mapping public class CometSampleServlet extends HttpServlet implements CometProcessor { protected ArrayListHttpServletResponse connections = new ArrayListHttpServletResponse(); protected MessageSender sender = null; /** */ public void event(CometEvent event) throws IOException, ServletException { HttpServletRequest request = event.getHttpServletRequest(); but my service method still invoked is any settings should take? this example from: http://journal.mycom.co.jp/special/2007/tomcat6/014.html (its japanese, but you could see in the black text areas) regards, Szabi 35% kedvezmény a Partvonal Kiadó köteteire - hogy minden olvasó kézhez kapja a maga könyvét. http://ad.adverticum.net/b/cl,1,6022,172067,232579/click.prm
Re: tomcat comet, not working...
This is the example from the tomcat user guide. I have the same problem getting it to work. 2007/5/29, Márton Szabolcs [EMAIL PROTECTED]: Hi! i set my connector like this. it should be correct, isnt it? Connector port=8080 protocol= org.apache.coyote.http11.Http11NioProtocol maxThreads=150 connectionTimeout=2 redirectPort=8443 / servlet servlet-nameCometSampleServlet/servlet-name servlet-classsample.CometSampleServlet/servlet-class /servlet servlet-mapping servlet-nameCometSampleServlet/servlet-name url-pattern/CometSampleServlet/url-pattern /servlet-mapping public class CometSampleServlet extends HttpServlet implements CometProcessor { protected ArrayListHttpServletResponse connections = new ArrayListHttpServletResponse(); protected MessageSender sender = null; /** */ public void event(CometEvent event) throws IOException, ServletException { HttpServletRequest request = event.getHttpServletRequest(); but my service method still invoked is any settings should take? this example from: http://journal.mycom.co.jp/special/2007/tomcat6/014.html (its japanese, but you could see in the black text areas) regards, Szabi 35% kedvezmény a Partvonal Kiadó köteteire - hogy minden olvasó kézhez kapja a maga könyvét. http://ad.adverticum.net/b/cl,1,6022,172067,232579/click.prm
Re: tomcat comet, not working...
send us a link to your test WAR file, and I can give it a shot, looks good to me. Filip Márton Szabolcs wrote: Hi! i set my connector like this. it should be correct, isnt it? Connector port=8080 protocol=org.apache.coyote.http11.Http11NioProtocol maxThreads=150 connectionTimeout=2 redirectPort=8443 / servlet servlet-nameCometSampleServlet/servlet-name servlet-classsample.CometSampleServlet/servlet-class /servlet servlet-mapping servlet-nameCometSampleServlet/servlet-name url-pattern/CometSampleServlet/url-pattern /servlet-mapping public class CometSampleServlet extends HttpServlet implements CometProcessor { protected ArrayListHttpServletResponse connections = new ArrayListHttpServletResponse(); protected MessageSender sender = null; /** */ public void event(CometEvent event) throws IOException, ServletException { HttpServletRequest request = event.getHttpServletRequest(); but my service method still invoked is any settings should take? this example from: http://journal.mycom.co.jp/special/2007/tomcat6/014.html (its japanese, but you could see in the black text areas) regards, Szabi 35% kedvezmény a Partvonal Kiadó köteteire - hogy minden olvasó kézhez kapja a maga könyvét. http://ad.adverticum.net/b/cl,1,6022,172067,232579/click.prm No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.472 / Virus Database: 269.8.0/821 - Release Date: 5/27/2007 3:05 PM - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat comet, not working...
i will send later, i cant ftp from here. any other ideas? i would like if somebody, who made this cometprocessor worked describe the things what have to do. I already done what is in tomcat docs (advanced NIO) regards, Saby 2007/5/29, Filip Hanik - Dev Lists [EMAIL PROTECTED]: send us a link to your test WAR file, and I can give it a shot, looks good to me. Filip Márton Szabolcs wrote: Hi! i set my connector like this. it should be correct, isnt it? Connector port=8080 protocol=org.apache.coyote.http11.Http11NioProtocol maxThreads=150 connectionTimeout=2 redirectPort=8443 / servlet servlet-nameCometSampleServlet/servlet-name servlet-classsample.CometSampleServlet/servlet-class /servlet servlet-mapping servlet-nameCometSampleServlet/servlet-name url-pattern/CometSampleServlet/url-pattern /servlet-mapping public class CometSampleServlet extends HttpServlet implements CometProcessor { protected ArrayListHttpServletResponse connections = new ArrayListHttpServletResponse(); protected MessageSender sender = null; /** */ public void event(CometEvent event) throws IOException, ServletException { HttpServletRequest request = event.getHttpServletRequest(); but my service method still invoked is any settings should take? this example from: http://journal.mycom.co.jp/special/2007/tomcat6/014.html (its japanese, but you could see in the black text areas) regards, Szabi 35% kedvezmény a Partvonal Kiadó köteteire - hogy minden olvasó kézhez kapja a maga könyvét. http://ad.adverticum.net/b/cl,1,6022,172067,232579/click.prm No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.472 / Virus Database: 269.8.0/821 - Release Date: 5/27/2007 3:05 PM - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat comet, not working...
you don't really have to do that much, here is mine package org.hanik.comet.test; import java.io.IOException; import java.io.InputStream; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import org.apache.catalina.CometEvent; import org.apache.catalina.CometProcessor; public class TestCometServlet extends HttpServlet implements CometProcessor { public void event(CometEvent event) throws IOException, ServletException { System.out.println(Received an event:+event); event.setTimeout(5000); if (event.getEventType() == CometEvent.EventType.END || event.getEventType() == CometEvent.EventType.ERROR ) { event.close(); } else if (event.getEventType() == CometEvent.EventType.READ) { InputStream is = event.getHttpServletRequest().getInputStream(); byte[] buf = new byte[512]; do { int n = is.read(buf); //can throw an IOException if (n 0) { System.out.println(Read + n + bytes: + new String(buf, 0, n) + for session: + event.getHttpServletRequest().getSession(true).getId()); } else if (n 0) { event.close(); return; } } while (is.available() 0); } } } Szabolcs Márton wrote: i will send later, i cant ftp from here. any other ideas? i would like if somebody, who made this cometprocessor worked describe the things what have to do. I already done what is in tomcat docs (advanced NIO) regards, Saby 2007/5/29, Filip Hanik - Dev Lists [EMAIL PROTECTED]: send us a link to your test WAR file, and I can give it a shot, looks good to me. Filip Márton Szabolcs wrote: Hi! i set my connector like this. it should be correct, isnt it? Connector port=8080 protocol=org.apache.coyote.http11.Http11NioProtocol maxThreads=150 connectionTimeout=2 redirectPort=8443 / servlet servlet-nameCometSampleServlet/servlet-name servlet-classsample.CometSampleServlet/servlet-class /servlet servlet-mapping servlet-nameCometSampleServlet/servlet-name url-pattern/CometSampleServlet/url-pattern /servlet-mapping public class CometSampleServlet extends HttpServlet implements CometProcessor { protected ArrayListHttpServletResponse connections = new ArrayListHttpServletResponse(); protected MessageSender sender = null; /** */ public void event(CometEvent event) throws IOException, ServletException { HttpServletRequest request = event.getHttpServletRequest(); but my service method still invoked is any settings should take? this example from: http://journal.mycom.co.jp/special/2007/tomcat6/014.html (its japanese, but you could see in the black text areas) regards, Szabi 35% kedvezmény a Partvonal Kiadó köteteire - hogy minden olvasó kézhez kapja a maga könyvét. http://ad.adverticum.net/b/cl,1,6022,172067,232579/click.prm No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.472 / Virus Database: 269.8.0/821 - Release Date: 5/27/2007 3:05 PM - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat comet, not working...
as a client I use http://people.apache.org/~fhanik/cometgui.jar The client automatically translates \n into CRLF for the HTTP protocol To do what you need to do, do this 0. java -jar cometgui.jar 1. Click Connect 2. Click Submit 3. Erase the headers, make sure the next text looks like this: text 10 test data test 1 /text omit the XML tags of course, then click Submit again. The source code for the app is inside, it is very basic, Filip Peter Warren wrote: Filip, could you post some client code that sends two separate messages to the server on the same output stream and generates both a begin event and then a subsequent read event. Thanks, Peter (I'm the guy who started the comet read event thread. I never heard back after you asked me which connector I was using, and I'm still struggling with it.) Filip Hanik - Dev Lists wrote: you don't really have to do that much, here is mine package org.hanik.comet.test; import java.io.IOException; import java.io.InputStream; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import org.apache.catalina.CometEvent; import org.apache.catalina.CometProcessor; public class TestCometServlet extends HttpServlet implements CometProcessor { public void event(CometEvent event) throws IOException, ServletException { System.out.println(Received an event:+event); event.setTimeout(5000); if (event.getEventType() == CometEvent.EventType.END || event.getEventType() == CometEvent.EventType.ERROR ) { event.close(); } else if (event.getEventType() == CometEvent.EventType.READ) { InputStream is = event.getHttpServletRequest().getInputStream(); byte[] buf = new byte[512]; do { int n = is.read(buf); //can throw an IOException if (n 0) { System.out.println(Read + n + bytes: + new String(buf, 0, n) + for session: + event.getHttpServletRequest().getSession(true).getId()); } else if (n 0) { event.close(); return; } } while (is.available() 0); } } } Szabolcs Márton wrote: i will send later, i cant ftp from here. any other ideas? i would like if somebody, who made this cometprocessor worked describe the things what have to do. I already done what is in tomcat docs (advanced NIO) regards, Saby 2007/5/29, Filip Hanik - Dev Lists [EMAIL PROTECTED]: send us a link to your test WAR file, and I can give it a shot, looks good to me. Filip Márton Szabolcs wrote: Hi! i set my connector like this. it should be correct, isnt it? Connector port=8080 protocol=org.apache.coyote.http11.Http11NioProtocol maxThreads=150 connectionTimeout=2 redirectPort=8443 / servlet servlet-nameCometSampleServlet/servlet-name servlet-classsample.CometSampleServlet/servlet-class /servlet servlet-mapping servlet-nameCometSampleServlet/servlet-name url-pattern/CometSampleServlet/url-pattern /servlet-mapping public class CometSampleServlet extends HttpServlet implements CometProcessor { protected ArrayListHttpServletResponse connections = new ArrayListHttpServletResponse(); protected MessageSender sender = null; /** */ public void event(CometEvent event) throws IOException, ServletException { HttpServletRequest request = event.getHttpServletRequest(); but my service method still invoked is any settings should take? this example from: http://journal.mycom.co.jp/special/2007/tomcat6/014.html (its japanese, but you could see in the black text areas) regards, Szabi 35% kedvezmény a Partvonal Kiadó köteteire - hogy minden olvasó kézhez kapja a maga könyvét. http://ad.adverticum.net/b/cl,1,6022,172067,232579/click.prm No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.472 / Virus Database: 269.8.0/821 - Release Date: 5/27/2007 3:05 PM - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: