users@glassfish.java.net

Re: servlet 3.0 async, gvf3

From: Shing Wai Chan <shing.wai.chan_at_oracle.com>
Date: Wed, 14 Apr 2010 13:57:37 -0700

Hi,
I have just tried the GlassFish async sample. It is working fine for me.
You may like to restart your browser. Also, you may like to have two
different browsers to run the chat.

As mentioned by Jan, there is an bug in the sample.
That bug should not affect the functionality described above.
I have just fixed the sample in glassfish-sample svn repository.

Regards,
      Shing Wai Chan


On 4/14/10 12:35 PM, Jan Luehe wrote:
> emiddio-verizon wrote:
>> i have just experimented with the provided TestServlet.java -- from
>> Jan in earlier post;
>>
>> i am running netbeans dev 201004120251 build,
>> gfv3 - glassfish-3.0.1-b12 bundled with netbeans, 64bit win7, 64bit
>> jdk1.6.0_19
>>
>> only changes made to TestServlet.java were -- add init(),
>> init(ServletConfig sc), destroy() methods
>> with println() to indicate when called, and addition of annotation,
>>
>> @WebServlet(urlPatterns = {"/servlet1"}, asyncSupported = true)
>>
>> to the servlet.
>>
>> the output received on the web page is,
>> onStartAsync,onStartAsync,
>>
>> gfv3 gets following added to log -- init(ServletConfig sc) is called
>> 3 times in the log.
>
> What does your Servlet's init(ServletConfig sc) method look like?
>
> Did you make sure to call super.init(sc)?
>
> See my earlier reply.
>
> Jan
>
>>
>> INFO: Installed
>> G:\Sun\glassfish-3.0.1-b12\glassfish\modules\autostart\org.apache.felix.fileinstall-autodeploy-bundles.cfg
>> INFO: {felix.fileinstall.poll (ms) = 5000, felix.fileinstall.dir =
>> G:\Sun\glassfish-3.0.1-b12\glassfish\domains\domain1\autodeploy\bundles,
>> felix.fileinstall.debug = 1, felix.fileinstall.bundles.new.start =
>> true, felix.fileinstall.tmpdir =
>> C:\Users\emiddio\AppData\Local\Temp\fileinstall--3776239746707816394,
>> felix.fileinstall.filter = null}
>> INFO: Loading application AsyncTestServlet at /AsyncTestServlet
>> INFO: AsyncTestServlet was successfully deployed in 247 milliseconds.
>> INFO: init1
>> INFO: init1
>> INFO: init1
>> WARNING: ApplicationDispatcher[/AsyncTestServlet] PWC1231:
>> Servlet.service() for servlet test.TestServlet threw exception
>> java.lang.NullPointerException
>> at
>> com.sun.grizzly.http.ProcessorTask.action(ProcessorTask.java:1163)
>> at com.sun.grizzly.tcp.Request.action(Request.java:419)
>> at com.sun.grizzly.tcp.Response.resume(Response.java:762)
>> at
>> org.apache.catalina.connector.Request.asyncComplete(Request.java:3760)
>> at
>> org.apache.catalina.connector.AsyncContextImpl.complete(AsyncContextImpl.java:223)
>> at test.TestServlet.doGet(TestServlet.java:55)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
>> at
>> org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
>> at
>> org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:822)
>> at
>> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
>> at
>> org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:517)
>> at
>> org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:488)
>> at
>> org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:379)
>> at
>> org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:336)
>> at
>> org.apache.catalina.connector.AsyncContextImpl$Handler.run(AsyncContextImpl.java:375)
>> 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)
>>
>>
>>
>>
>>
>>
>>
>