If you want your application to be portable, I would encourage you to
use the Servlet 3.0 API.
- Rajiv
Jeanfrancois Arcand wrote:
> Salut,
>
> harsha aswath wrote:
>> Hi Jeanfrancois,
>>
>> Thanks for the response. Instead is there a way to simply suspend and
>> resume requests in grizzly? I would also need to check the suspend
>> status of a request, like isSuspended() or isResumed(). I am not
>> particularly interested in servlet 3.0.
>
> Yes, you have 3 solutions:
>
> (1) Use the suspend/resume API (this is what GlassFish use to
> implement Servlet 3.0 Async API) (stable):
>
> http://is.gd/nIYc
>
> See example here:
> https://grizzly.dev.java.net/nonav/xref-test/com/sun/grizzly/http/SuspendTest.html
>
>
> (2) Use the Grizzly Comet Framework (stable)
>
> http://is.gd/gIjj
>
> Sample here: http://download.java.net/maven/2/com/sun/grizzly/samples/
>
> (3) Use the Atmosphere Framework (alpha)
>
> http://is.gd/nh1F
>
> Sample included with the link.
>
> Let me know if you need more information.
>
> Thanks!
>
> -- Jeanfrancois
>
>
>
>
>>
>> Thanks
>> Harsha
>>
>> On Tue, Mar 17, 2009 at 3:01 PM, Jeanfrancois Arcand
>> <Jeanfrancois.Arcand_at_sun.com <mailto:Jeanfrancois.Arcand_at_sun.com>>
>> wrote:
>>
>> Hi Harsha,
>>
>> harsha aswath wrote:
>>
>> Hi,
>>
>> I am trying to use grizzly 1.9.9 with servlet 3.0 api . I could
>> not find the servlet api 3.0 jars in the java.net
>> <http://java.net> <http://java.net> maven repository. I found
>> one version in
>>
>> http://download.java.net/maven/glassfish/org/glassfish/javax.servlet/
>> which I assume is the version used in glassfish. With this I get
>> the following error
>>
>>
>> java.lang.AbstractMethodError:
>> com.sun.grizzly.http.servlet.HttpServletRequestImpl.isInitial()Z
>> at
>>
>> com.server.grizzly.GrizzlyServiceHandler.service(GrizzlyServiceHandler.java:24)
>>
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>> at
>>
>> com.sun.grizzly.http.servlet.FilterChainImpl.doFilter(FilterChainImpl.java:188)
>>
>> at
>>
>> com.sun.grizzly.http.servlet.FilterChainImpl.invokeFilterChain(FilterChainImpl.java:137)
>>
>> at
>>
>> com.sun.grizzly.http.servlet.ServletAdapter.service(ServletAdapter.java:278)
>>
>> at
>>
>> com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:165)
>>
>> at
>>
>> com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:726)
>> at
>>
>> com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:615)
>> at
>>
>> com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:895)
>> at
>>
>> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:162)
>>
>> at
>>
>> com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:136)
>>
>> at
>>
>> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
>>
>> at
>>
>> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
>>
>> at
>>
>> com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
>>
>> at
>>
>> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:67)
>>
>> at
>>
>> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
>>
>> at
>>
>> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>> at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>> at
>>
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>
>> at
>>
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>
>> at java.lang.Thread.run(Thread.java:619)
>>
>>
>> Can you file an issue here:
>>
>> https://grizzly.dev.java.net/issues/
>>
>> You are the first to try to use version 3.0. I've already asked
>> internally to have official drop of Servlet 3.0 artifact (should
>> happens pretty soon).
>>
>>
>>
>>
>>
>> My class looks like this
>>
>> public class GrizzlyServiceHandler extends HttpServlet {
>> @Override
>> public void service(HttpServletRequest request,
>> HttpServletResponse response) {
>> if (request.isInitial()) {
>>
>>
>>
>> and I start grizzly with the following code
>>
>> GrizzlyWebServer server = ...;
>> GrizzlyAdapter adapter =...;
>> server.addGrizzlyAdapter(adapter,new String[]{"/"});
>> server.start();
>>
>>
>>
>> I then observed that grizzly is using servlet 2.5 . I made sure
>> that servlet 3.0 is in the classpath, I get this error. Is there
>> a clean grizzly example which works with servlet 3.0 apis ?
>>
>>
>> Not yet. We haven't started implementing 3.0 (we are still working
>> on 2.5 full implementation.
>>
>>
>> Thanks!
>>
>> -- Jeanfrancois
>>
>>
>>
>> java.lang.AbstractMethodError:
>>
>> com.sun.grizzly.http.servlet.HttpServletRequestImpl.isAsyncStarted()Z
>> at
>>
>> com.server.grizzly.GrizzlyServiceHandler.service(GrizzlyServiceHandler.java:24)
>>
>> at
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
>> at
>>
>> com.sun.grizzly.http.servlet.FilterChainImpl.doFilter(FilterChainImpl.java:188)
>>
>> at
>>
>> com.sun.grizzly.http.servlet.FilterChainImpl.invokeFilterChain(FilterChainImpl.java:137)
>>
>> at
>>
>> com.sun.grizzly.http.servlet.ServletAdapter.service(ServletAdapter.java:278)
>>
>> at
>>
>> com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:165)
>>
>> at
>>
>> com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:726)
>> at
>>
>> com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:615)
>> at
>>
>> com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:895)
>> at
>>
>> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:162)
>>
>> at
>>
>> com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:136)
>>
>> at
>>
>> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
>>
>> at
>>
>> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
>>
>> at
>>
>> com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
>>
>> at
>>
>> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:67)
>>
>> at
>>
>> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
>>
>> at
>>
>> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>> at
>> java.util.concurrent.FutureTask.run(FutureTask.java:138)
>> at
>>
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>>
>> at
>>
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>>
>> at java.lang.Thread.run(Thread.java:619)
>>
>> Thanks
>> Harsha
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
>> <mailto:users-unsubscribe_at_grizzly.dev.java.net>
>> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>> <mailto:users-help_at_grizzly.dev.java.net>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>