users@grizzly.java.net

Re: (Comet's CancelKeyException ) [Jean-Francois Arcand's Blog] New Comment Posted to 'The Grizzly Comet or why space shuttle Discovery launch was delayed.'

From: kaiping <kaipingk_at_gmail.com>
Date: Tue, 10 Mar 2009 20:37:03 -0700 (PDT)

Jeanfrancois Arcand-2 wrote:
>
> Hi,
>
>> Email Address: foo_at_bar.com
>> URL:
>> Comments:
>>
>> hi, jfarcand
>>
>> When I making a comet project according to your comet example, and I am
>> using the long-streaming style. but I come to encounter a strange
>> problem!!! that is : the glassfish alway throw the following exception at
>> irregular intervals : can you give me some suggestion as I am novice to
>> glassfish and comet.
>>
>>
>> SEVERE: doSelect exception
>> java.nio.channels.CancelledKeyException
>> at
>> sun.nio.ch.SelectionKeyImpl.ensureValid(SelectionKeyImpl.java:55)
>> at
>> sun.nio.ch.SelectionKeyImpl.interestOps(SelectionKeyImpl.java:64)
>> at
>> com.sun.grizzly.TCPSelectorHandler.onReadInterest(TCPSelectorHandler.java:668)
>> at com.sun.grizzly.Controller.doSelect(Controller.java:422)
>> at
>> com.sun.grizzly.SelectorHandlerRunner.run(SelectorHandlerRunner.java:82)
>> at
>> com.sun.grizzly.Controller.startSelectorHandlerRunner(Controller.java:1136)
>> at com.sun.grizzly.Controller.start(Controller.java:943)
>> at
>> com.sun.grizzly.http.SelectorThread.startListener(SelectorThread.java:1178)
>> at
>> com.sun.grizzly.http.SelectorThread.run(SelectorThread.java:1045)
>> at
>> com.sun.grizzly.http.SelectorThread.startEndpoint(SelectorThread.java:1110)
>> at
>> com.sun.enterprise.v3.services.impl.GrizzlyServiceListener.start(GrizzlyServiceListener.java:91)
>> at
>> com.sun.enterprise.v3.services.impl.GrizzlyProxy$1.run(GrizzlyProxy.java:222)
>>
>
> It this really an issue?do you mean your application no longer works
> after that exception?
>
> Thanks
>
> -- Jeanfrancois
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>
>
>

Thanks for you reply!

it seems this exception indeed not affect my program runing, but there is
another exception that do affect. the senora is when there is about ten
client connect to the server. and this lead to notification failed. how can
I avoid these exceptions and make program more stable?


SEVERE: java.lang.NullPointerException
SEVERE: at
com.sun.grizzly.arp.AsynchronousOutputBuffer.flushChannel(AsynchronousOutputBuffer.java:86)
SEVERE: at
com.sun.grizzly.http.SocketChannelOutputBuffer.flushBuffer(SocketChannelOutputBuffer.java:208)
SEVERE: at
com.sun.grizzly.arp.AsynchronousOutputBuffer.flushBuffer(AsynchronousOutputBuffer.java:113)
SEVERE: at
com.sun.grizzly.http.SocketChannelOutputBuffer.endRequest(SocketChannelOutputBuffer.java:199)
SEVERE: at
com.sun.grizzly.http.DefaultProcessorTask.action(DefaultProcessorTask.java:898)
SEVERE: at com.sun.grizzly.tcp.Response.action(Response.java:235)
SEVERE: at com.sun.grizzly.tcp.Response.finish(Response.java:360)
SEVERE: at
org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:339)
SEVERE: at
org.apache.catalina.connector.Response.finishResponse(Response.java:593)
SEVERE: at
org.apache.catalina.connector.CoyoteAdapter.afterService(CoyoteAdapter.java:354)
SEVERE: at
com.sun.enterprise.v3.services.impl.ContainerMapper.afterService(ContainerMapper.java:266)
SEVERE: at
com.sun.grizzly.http.DefaultProcessorTask.postResponse(DefaultProcessorTask.java:584)
SEVERE: at
com.sun.grizzly.arp.DefaultAsyncExecutor.postExecute(DefaultAsyncExecutor.java:155)
SEVERE: at
com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:95)
SEVERE: at
com.sun.grizzly.comet.CometEngine.flushResponse(CometEngine.java:542)
SEVERE: at
com.sun.grizzly.comet.CometEngine.resume(CometEngine.java:529)
SEVERE: at
com.sun.grizzly.comet.CometContext.resumeCometHandler(CometContext.java:482)
SEVERE: at
com.sun.grizzly.comet.DefaultNotificationHandler.notify0(DefaultNotificationHandler.java:133)
SEVERE: at
com.sun.grizzly.comet.DefaultNotificationHandler.notify(DefaultNotificationHandler.java:109)
SEVERE: at
com.sun.grizzly.comet.CometContext.notify(CometContext.java:513)
SEVERE: at
com.zhuangxiu007.web.action.im.PushChannel.doPost(PushChannel.java:99)
SEVERE: at
javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
SEVERE: at
javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
SEVERE: at
org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:431)
SEVERE: at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:337)
SEVERE: at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:218)
SEVERE: at
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:359)
SEVERE: at
org.springframework.security.ui.switchuser.SwitchUserProcessingFilter.doFilterHttp(SwitchUserProcessingFilter.java:299)
SEVERE: at
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
SEVERE: at
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
SEVERE: at
org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
SEVERE: at
org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
SEVERE: at
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
SEVERE: at
org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)
SEVERE: at
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
SEVERE: at
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
SEVERE: at
org.springframework.security.providers.anonymous.AnonymousProcessingFilter.doFilterHttp(AnonymousProcessingFilter.java:105)
SEVERE: at
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
SEVERE: at
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
SEVERE: at
org.springframework.security.ui.rememberme.RememberMeProcessingFilter.doFilterHttp(RememberMeProcessingFilter.java:116)
SEVERE: at
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
SEVERE: at
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
SEVERE: at
org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter.doFilterHttp(SecurityContextHolderAwareRequestFilter.java:91)
SEVERE: at
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
SEVERE: at
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
SEVERE: at
org.springframework.security.ui.basicauth.BasicProcessingFilter.doFilterHttp(BasicProcessingFilter.java:172)
SEVERE: at
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
SEVERE: at
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
SEVERE: at
org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:268)
SEVERE: at
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
SEVERE: at
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
SEVERE: at
org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:87)
SEVERE: at
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
SEVERE: at
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
SEVERE: at
org.springframework.security.ui.SessionFixationProtectionFilter.doFilterHttp(SessionFixationProtectionFilter.java:61)
SEVERE: at
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
SEVERE: at
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
SEVERE: at
org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
SEVERE: at
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
SEVERE: at
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:371)
SEVERE: at
org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:174)
SEVERE: at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
SEVERE: at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
SEVERE: at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:250)
SEVERE: at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:218)
SEVERE: at
com.zhuangxiu007.web.filter.EncodingFilter.doFilter(EncodingFilter.java:41)
SEVERE: at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:250)
SEVERE: at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:218)
SEVERE: at
org.apache.catalina.core.StandardWrapperValve.preInvoke(StandardWrapperValve.java:460)
SEVERE: at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:139)
SEVERE: at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:186)
SEVERE: at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
SEVERE: at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
SEVERE: at
com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:96)
SEVERE: at
com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
SEVERE: at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:187)
SEVERE: at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
SEVERE: at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
SEVERE: at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:651)
SEVERE: at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1030)
SEVERE: at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:142)
SEVERE: at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:719)
SEVERE: at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:657)
SEVERE: at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:651)
SEVERE: at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1030)
SEVERE: at
org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
SEVERE: at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:242)
SEVERE: at
com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:180)
SEVERE: at
com.sun.grizzly.http.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:633)
SEVERE: at
com.sun.grizzly.comet.CometEngine.executeServlet(CometEngine.java:568)
SEVERE: at
com.sun.grizzly.comet.CometEngine.handle(CometEngine.java:325)
SEVERE: at
com.sun.grizzly.comet.CometAsyncFilter.doFilter(CometAsyncFilter.java:84)
SEVERE: at
com.sun.grizzly.arp.DefaultAsyncExecutor.invokeFilters(DefaultAsyncExecutor.java:130)
SEVERE: at
com.sun.grizzly.arp.DefaultAsyncExecutor.interrupt(DefaultAsyncExecutor.java:109)
SEVERE: at
com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:88)
SEVERE: at com.sun.grizzly.http.TaskBase.call(TaskBase.java:359)
SEVERE: at
com.sun.grizzly.util.WorkerThreadImpl.processTask(WorkerThreadImpl.java:325)
SEVERE: at
com.sun.grizzly.util.WorkerThreadImpl.run(WorkerThreadImpl.java:184)
WARNING: Notification failed:

-- 
View this message in context: http://www.nabble.com/%28Comet%27s-CancelKeyException-%29--Jean-Francois-Arcand%27s-Blog--New-Comment-Posted-to-%27The-Grizzly-Comet-or-why-space-shuttle-Discovery-launch-was-delayed.%27-tp22415006p22448304.html
Sent from the Grizzly - Users mailing list archive at Nabble.com.