cancel
Showing results for 
Search instead for 
Did you mean: 

Servlet 3.0 async support

02-14-2013 2:14 PM
1749 views 9 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

Hi,

I'm currently trying to make use of the servlet 3.0 async api. I have a very simple web app with a single servlet with async supported set to true. If I run this webapp on a local tomcat 7.0.30 it runs fine. But when I run the same web app on either the local or the hosted netweaver cloud I get the following exception:

java.lang.IllegalStateException: Async support must be enabled on a servlet and for all filters involved in async request processing. This is done in Java code using the Servlet API or by adding "<async-supported>true</async-supported>" to servlet and filter declarations in web.xml.

    at org.springframework.util.Assert.state(Assert.java:384)

    at org.springframework.web.context.request.async.StandardServletAsyncWebRequest.startAsync(StandardServletAsyncWebRequest.java:98)

    at org.springframework.web.context.request.async.WebAsyncManager.startAsyncProcessing(WebAsyncManager.java:424)

    at org.springframework.web.context.request.async.WebAsyncManager.startDeferredResultProcessing(WebAsyncManager.java:403)

    at org.springframework.web.servlet.mvc.method.annotation.DeferredResultMethodReturnValueHandler.handleReturnValue(DeferredResultMethodReturnValueHandler.java:49)

    at org.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite.handleReturnValue(HandlerMethodReturnValueHandlerComposite.java:69)

    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:122)

    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745)

    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686)

    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)

    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)

    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)

    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:920)

    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:816)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)

    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:801)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)

    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)

    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)

    at com.sap.security.auth.service.webcontainer.internal.Authenticator.invoke(Authenticator.java:147)

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)

    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)

    at com.sap.core.tenant.valve.TenantValidationValve.invokeNextValve(TenantValidationValve.java:169)

    at com.sap.core.tenant.valve.TenantValidationValve.invoke(TenantValidationValve.java:84)

    at com.sap.core.js.monitoring.tomcat.valve.RequestTracingValve.invoke(RequestTracingValve.java:27)

    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)

    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)

    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)

    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)

    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)

    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:662)|

I think its maybe one (or all) of the SAP Valves which isn't ready for async support?

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

Ok I've narrowed down the problem: it is the TenantValidationValve which doesn't support async operation. I've verified this locally using neo sdk tools version 1.20.0. If I replace the TenantValidationValve with a custom osgi fragment (which just does nothing but supports async operation) the application runs fine. Would be nice if this gets fixed soon.

nikolai_tankov
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Tobias,

    This is a known issue and unfortunately not that simple. We had several discussions how to fix it  and the implementation for single tenant VM-s will be provided in few weeks.

Since the fix for multi-tenant VM-s is more complex it will be implemented later.

Best regards,

  Nikolai.

Former Member
0 Likes

Hi Nikolai,

I'm glad that this problem is going to be fixed. I'm a little bit worried about the time frame here though. We're currently developing a product for the NWC which will make use of some server push technology. Since servlet 3.0 async isn't supported right now and also comet support doesn't seem to be available (or ever be supported? - see http://scn.sap.com/thread/3177696 and http://scn.sap.com/thread/3260605) I suppose we have to fall back to normal polling. This might be ok for now or some small demos but will for sure not be sufficient for the final product.

Best regards,

Tobias

nikolai_tankov
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Tobias,

  When you plan to release your productive version ?  I will check if we can speed up the delivery of this feature at least for the single tenant VMs. I hope that you do not plan to work with different tenants(accounts) on one application instance ?

Best regards,

  Nikolai.

Former Member
0 Likes

Hi Nikolai,

no currently we plan to have only a single tenant scenario which means 1 customer per application instance. For development we're using the NWC starter package. It is planned to show case server push in Q1 and the final product going live in Q3 this year.

Best regards,

Tobias

Former Member
0 Likes

Any update on this issue? Looks like it hasn't been fixed in yesterdays nwc update / neo-sdk 1.22.0 ...

nikolai_tankov
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Tobias,

  We fixed the issues this week and the fix will come with the next regular update after approximately 2 weeks.

Best regards,

  Nikolai.

Former Member
0 Likes

Hi Nikolai,

thanks for the info. I'm really looking forward to the next release.

Best regards,

Tobias

Answers (1)

Answers (1)

Former Member
0 Likes

Hi,

I just wanted to confirm that async is finally working in neo-sdk 1.23.1. Many thanks for fixing that!

Best regards,

Tobias