Topic
  • 3 replies
  • Latest Post - ‏2012-05-10T20:28:22Z by JacekLaskowski
IrfanNagoo
IrfanNagoo
2 Posts

Pinned topic Servlet 3.0 support on WAS 8.0

‏2011-08-08T09:31:37Z |
Hi,

I deployed an Asynchronous servlet (using Servlet3.0 Async API) on my WAS 8.0. I have also set the property asyncSupported = true using annotation in the servlet and also I put an entry in the web.xml of the war. However, when I try to hit this servlet I get this exception:

3/30/11 3:41:23:781 IST 00000022 servlet E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: An exception was thrown by one of the service methods of the servlet ASyncServlet in application ASyncDemo_war. Exception created : [com.ibm.ws.webcontainer.async.AsyncIllegalStateException: SRVE8010E: The current request does not support asynchronous servlet processing.
at com.ibm.ws.webcontainer.srt.SRTServletRequest.startAsync(SRTServletRequest.java:3332)
at com.ibm.ws.webcontainer.srt.SRTServletRequest.startAsync(SRTServletRequest.java:3310)
at com.demo.servlet.ASyncServlet.service(ASyncServlet.java:63)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1147)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:722)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:449)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1020)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:883)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1659)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195)
at com.ibm.ws.ard.channel.ARDChannelConnLink.handleDiscrimination(ARDChannelConnLink.java:188)
at com.ibm.ws.ard.channel.ARDChannelConnLink.ready(ARDChannelConnLink.java:93)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:276)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture$1.run(AsyncChannelFuture.java:205)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1648)
]
3/30/11 3:41:23:782 IST 00000022 LocalTranCoor E WLTC0017E: Resources rolled back due to setRollbackOnly() being called.
I searched on internet about this and I found nothing related to it. Please let me in case anyone has any idea or suggestion about this error?
Irfan
Updated on 2012-05-10T20:28:22Z at 2012-05-10T20:28:22Z by JacekLaskowski
  • IrfanNagoo
    IrfanNagoo
    2 Posts

    Re: Servlet 3.0 support on WAS 8.0

    ‏2011-08-12T12:25:33Z  
    Guys,

    I got it fixed. Actually, the problem was with the web.xml entry for aSynch support. The entry that I was trying was specific to tomcat7 and the WAS 8.0 specific entry looks like this:

    <servlet>
    <description>
    </description>
    <display-name>ASyncServlet</display-name>
    <servlet-name>ASyncServlet</servlet-name>
    <servlet-class>com.demo.servlet.ASyncServlet</servlet-class>
    <init-param>
    <param-name>com.ibm.ws.webcontainer.async-supported</param-name>
    <param-value>true</param-value>
    </init-param>
    </servlet>
    Using the above mentioned entry in the web.xml I was able to get rid of the exception that I was getting.
    Thanks, Irfan
  • motaz
    motaz
    1 Post

    Re: Servlet 3.0 support on WAS 8.0

    ‏2012-04-18T10:33:21Z  
    Guys,

    I got it fixed. Actually, the problem was with the web.xml entry for aSynch support. The entry that I was trying was specific to tomcat7 and the WAS 8.0 specific entry looks like this:

    <servlet>
    <description>
    </description>
    <display-name>ASyncServlet</display-name>
    <servlet-name>ASyncServlet</servlet-name>
    <servlet-class>com.demo.servlet.ASyncServlet</servlet-class>
    <init-param>
    <param-name>com.ibm.ws.webcontainer.async-supported</param-name>
    <param-value>true</param-value>
    </init-param>
    </servlet>
    Using the above mentioned entry in the web.xml I was able to get rid of the exception that I was getting.
    Thanks, Irfan
    Irfan,

    Are you setting this property on the servlet or on the web-application or on the filter ?

    Dan Berg
  • JacekLaskowski
    JacekLaskowski
    1 Post

    Re: Servlet 3.0 support on WAS 8.0

    ‏2012-05-10T20:28:22Z  
    • motaz
    • ‏2012-04-18T10:33:21Z
    Irfan,

    Are you setting this property on the servlet or on the web-application or on the filter ?

    Dan Berg
    Hi,

    web.xml is an optional deployment descriptor in Java EE 6/WAS 8 and luckily it's not needed for asynchronous support. I didn't know about the setting yet I could successfully process async requests.

    Although the blog entries on my blog are in Polish, the examples are not and you should benefit from them a little. Have a look at the latest entry about the topic Wątki podczas obsługi asynchronicznego żądania w Servlet 3.0 i IBM WebSphere Application Server 8.0.0.3. I should soon record a screencast about the topic in English, so it gets even more consumable.

    Jacek
    Functional programming with Clojure, Java EE, and IBM WebSphere