I believe, that people in a specialized Tomcat forum may be able to
help you a lot better.

As a last hint, if all else fails, you can still experiment with a
timeout on the client. See this thread:
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/11960c28e1a2d9eb?pli=1
Or set something like a content aware load balancer in front, to
balance between your Apache and Tomcat without acting like a proxy, if
that's possible at all, and if it works with your special PHP setup.

Sorry I couldn't help you with more specifics, but it's been some
years since I last used a Tomcat+Apache setup...

Chris


On Feb 22, 7:19 pm, Fran <fra...@gmail.com> wrote:
> I think that I will need a iframe that loads tomcat page. But this
> solution isnt good
>
> On 21 feb, 16:49, Fran <fra...@gmail.com> wrote:
>
>
>
> > it dont work, apache cant conect totomcatwith this changes. The
> > login msn is loading indefinitely... And error logs dont show nothing,
> > excepttomcatthat says:
>
> > org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
> > INFO: Using a shared selector for servlet write/read
>
> > Here the changes...
> > Added this lines in event method:
>
> > if (event.getEventType() == CometEvent.EventType.BEGIN) {
> >                     event.setTimeout(30*1000);
> >                 }
>
> > if (event.getEventSubType() == CometEvent.EventSubType.TIMEOUT) {
> >                         writeResponse(event.getHttpServletResponse(), 
> > "timeout");
> >                         event.close();
> >                 }
>
> > server.xml (tomcat):
>
> > <Connector
> > connectionTimeout="20000"
> > port="8081"
> > protocol="org.apache.coyote.http11.Http11NioProtocol"
> > maxThreads="5"
> > acceptorThreadCount="2"
> > redirectPort="8443"
> > socket.directBuffer="false" />
>
> > httpd.conf (apache):
>
> >         keepalive Off
> >         ProxyRequests Off
> >         SetEnv force-proxy-request-1.0 1
> >         SetEnv proxy-nokeepalive 1
>
> >         <Proxy *>
> >                 Order deny,allow
> >                 Allow from all
> >         </Proxy>
>
> >         ProxyPass 
> > /msn/com.msn/messengerhttp://localhost:8081/msn/com.msn/messenger
> >         ProxyPassReverse 
> > /msn/com.msn/messengerhttp://localhost:8081/msn/com.msn/messenger
>
> > On 21 feb, 16:29, Chris Lercher <cl_for_mail...@gmx.net> wrote:
>
> > > I expect that your application works, if you usetomcatonly, because
> > > many browsers will wait for the response for a very long time. In that
> > > case, you don't need a timeout on your server.
>
> > > But when there's any proxy between your client and the server (and
> > > that's also the case when the client connects to the Internet via a
> > > proxy), then it often fails. Also expected behaviour.
>
> > > I'd take a look at this:http://tomcat.apache.org/tomcat-6.0-doc/aio.html
>
> > > It says you can set a timeout like this:
> > > event.setTimeout(30*1000)
>
> > > I'd do this for EventType.BEGIN.
>
> > > Then you can test for EventType.TIMEOUT (the documentation says, that
> > > you may need the
> > > org.apache.catalina.valves.CometConnectionManagerValve for this).
>
> > > On timeout, send some dummy response. The client should recognize the
> > > response as a timeout message, and retry.
>
> > > So, in effect I imagine it could look something like this (I can't try
> > > it here, so there may be some mistakes):
>
> > > public void event(CometEvent event) throws IOException,
> > > ServletException {
> > >  if (event.getEventType() == CometEvent.EventType.BEGIN) {
> > >     event.setTimeout(30*1000);
> > >  }
> > >  if (event.getEventType() == CometEvent.EventType.READ) { ...}
> > >  if (event.getEventType() == CometEvent.EventType.TIMEOUT) {
> > >     writeResponse(response, "timeout");
> > >     event.close();
> > >  }
>
> > > }
>
> > > On Feb 21, 3:54 pm, Fran <fra...@gmail.com> wrote:
>
> > > > Chris, the big problem is that the aplication works fully intomcat
> > > > but I use apache to run it with the servlet intomcat, it cant work.
> > > > I only need to emulate that the execution in apache is the same that
> > > > intomcat
>
> > > > On 21 feb, 15:50, Fran <fra...@gmail.com> wrote:
>
> > > > > I based the code in a GWT book.
> > > > > Please take a look 
> > > > > athttp://217.13.89.62/messenger%20nonblocking%20calls.pdf
> > > > > next the phrase at the first page: "Using Server-Side Advanced IO"
>
> > > > > Thanks for your time
>
> > > > > On 21 feb, 15:38, Chris Lercher <cl_for_mail...@gmx.net> wrote:
>
> > > > > > Using writer.flush() is absolutely ok, it's just not enough. Taking 
> > > > > > a
> > > > > > quick look at the code you posted, it looks ok, because after 
> > > > > > calling
> > > > > > writer.flush(), it always calls event.close(). So, no problem here.
> > > > > > But: I don't see any timeout in the code. The server must also call
> > > > > > event.close() after some timeout - which must be shorter than your
> > > > > > proxy's and your browser's timeout. (Some people say, it should in 
> > > > > > any
> > > > > > case be less than a minute.)
>
> > > > > > So either you can configure the timeout somewhere intomcat(please
> > > > > > refer to thetomcatdocumentation), or you'll have to send something
> > > > > > back manually after some time.
> > > > > > When the client receives such a dummy response, it must open a new
> > > > > > request (that's the long polling principle).
>
> > > > > > On Feb 21, 3:28 pm, Fran <fra...@gmail.com> wrote:
>
> > > > > > > Yes Chris, I use writer.flush()
> > > > > > > I cant use it at mod_proxy? What can I do?
>
> > > > > > > Thanks
>
> > > > > > > On 21 feb, 14:39, Chris Lercher <cl_for_mail...@gmx.net> wrote:
>
> > > > > > > > Here are some things you can check - maybe one of these helps 
> > > > > > > > (?)
>
> > > > > > > > - In your servlet: Do you expect that anything gets flushed
> > > > > > > > (reliably), before you call the close() method on CometEvent? 
> > > > > > > > If yes,
> > > > > > > > then what you're actually trying to do is _streaming_ (which 
> > > > > > > > doesn't
> > > > > > > > work). Calling writer.flush() is certainly not enough, since 
> > > > > > > > mod_proxy
> > > > > > > > has no way to know that writer.flush() has been called.
>
> > > > > > > > - Did you try to set "no-cache" headers etc.?
>
> > > > > > > > On Feb 21, 1:11 pm, Fran <fra...@gmail.com> wrote:
>
> > > > > > > > > I tested the mod_proxy_http, in the last post you can see the 
> > > > > > > > > config
> > > > > > > > > that I used.
> > > > > > > > > But in Comet HTTP streaming, I found mod_proxy blocked the 
> > > > > > > > > response
> > > > > > > > > until server close the
> > > > > > > > > stream (after timeout), then send the whole response to 
> > > > > > > > > client at
> > > > > > > > > once.
>
> > > > > > > > > In the first time I was wrong because I thought that if I put
> > > > > > > > > timeout=1 I found the solution but Its not real because the 
> > > > > > > > > server
> > > > > > > > > close the conection after timeout
>
> > > > > > > > > In the five post of mine is an example of the problem.
>
> > > > > > > > > This dude has a similar 
> > > > > > > > > problem:http://forums.java.net/jive/thread.jspa?threadID=41377
>
> > > > > > > > > I am hopeless :(
>
> > > > > > > > > On 21 feb, 03:21, dablack <david.blackwell...@gmail.com> 
> > > > > > > > > wrote:
>
> > > > > > > > > > Sorry to lead you on a wild goose chase. I guess you will 
> > > > > > > > > > have to use
> > > > > > > > > > the Apache mod_proxy_http module with theTomcatNIO 
> > > > > > > > > > connector using
> > > > > > > > > > the http protocol after all. I don't have any experience 
> > > > > > > > > > with the
> > > > > > > > > > mod_proxy_http module at all so not really anything I can 
> > > > > > > > > > help you
> > > > > > > > > > with.
>
> > > > > > > > > > Good luck.
>
> > > > > > > > > > On Feb 20, 7:21 pm, Fran <fra...@gmail.com> wrote:
>
> > > > > > > > > > > The problem persist with the news changes.
> > > > > > > > > > > Seems that apache cant connect totomcat:(
> > > > > > > > > > > The error log of apache and mod_jk dont show nothing. Not 
> > > > > > > > > > > ever nio conection
> > > > > > > > > > > stablished
>
> > > > > > > > > > > 2010/2/21 dablack <david.blackwell...@gmail.com>
>
> > > > > > > > > > > > I borrowed that connector configuration from a website 
> > > > > > > > > > > > I came across.
> > > > > > > > > > > > I'm not sure why port=0 either. If I put more research 
> > > > > > > > > > > > into the NIO
> > > > > > > > > > > > connector I could probably find out. Why don't you try 
> > > > > > > > > > > > adding the
> > > > > > > > > > > > lines,
>
> > > > > > > > > > > > enableLookups="false"
> > > > > > > > > > > > scheme="http"
>
> > > > > > > > > > > > to the NIO connector configuration in the server.xml 
> > > > > > > > > > > > file that I gave
> > > > > > > > > > > > you earlier.
>
> > > > > > > > > > > > As far as accessing the ajp service 
> > > > > > > > > > > > usinghttp://localhost:8009/servlet,
> > > > > > > > > > > > that will not work. Your browser uses the http protocol 
> > > > > > > > > > > > and the 8009
> > > > > > > > > > > > port is being serviced by the ajp protocol. You should 
> > > > > > > > > > > > still have your
> > > > > > > > > > > > connector using the http protocol configured to listen 
> > > > > > > > > > > > on port 8081.
>
> > > > > > > > > > > > Hopefully the scheme line above will help the NIO 
> > > > > > > > > > > > connector
> > > > > > > > > > > > communicate back to Apache.
>
> > > > > > > > > > > > On Feb 20, 4:45 pm, Fran <fra...@gmail.com> wrote:
> > > > > > > > > > > > > I test your config, dablack, but I cant connect to 
> > > > > > > > > > > > > the servlet.
> > > > > > > > > > > > > With this config I cant access not even 
> > > > > > > > > > > > > to:http://localhost:8009/servlet
> > > > > > > > > > > > > that istomcatdirectly without apache
>
> > > > > > > > > > > > > On 20 feb, 23:36, Fran <fra...@gmail.com> wrote:
>
> > > > > > > > > > > > > > I cant undestand why this config:
>
> > > > > > > > > > > > > > <Connector protocol="AJP/1.3" port="0" 
> > > > > > > > > > > > > > channelNioSocket.port="8009"
> > > > > > > > > > > > > > channelNioSocket.maxThreads="
> > > > > > > > > > > > > > 150"
> > > > > > > > > > > > > >   channelNioSocket.maxSpareThreads="50"
> > > > > > > > > > > > > > channelNioSocket.minSpareThreads="25"
> > > > > > > > > > > > > >   channelNioSocket.bufferSize="16384" />
>
> > > > > > > > > > > > > > Why port 0 ?
>
> > > > > > > > > > > > > > 2010/2/20 dablack <david.blackwell...@gmail.com>
>
> > > > > > > > > > > > > > > Fran,
>
> > > > > > > > > > > > > > > I'm really not an expert on setting up the 
> > > > > > > > > > > > > > > connection between Apache
> > > > > > > > > > > > > > > andTomcatbut I believe that the connections only 
> > > > > > > > > > > > > > > operate in two
> > > > > > > > > > > > > > > protocols: http or ajp. NIO is aTomcatconnector 
> > > > > > > > > > > > > > > that can
> > > > > > > > > > > > communicate
> > > > > > > > > > > > > > > in either http or ajp. Because of that, I don't 
> > > > > > > > > > > > > > > see any reason that
> > > > > > > > > > > > > > > the Apache mod_jk connector module couldn't 
> > > > > > > > > > > > > > > communicate with the NIO
> > > > > > > > > > > > > > > connector. Since I don't use an NIO connector I 
> > > > > > > > > > > > > > > could be wrong, but
> > > > > > > > > > > > > > > that is the way I see it. As a starting point, 
> > > > > > > > > > > > > > > try these
> > > > > > > > > > > > > > > configurations:
>
> > > > > > > > > > > > > > > server.xml
>
> > > > > > > > > > > > > > > <Connector protocol="AJP/1.3" port="0"
>
> ...
>
> read more »

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to