cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sridhar Jonnalagadda (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CXF-5374) Rejected Execution from ThreadPool
Date Mon, 04 Nov 2013 14:46:22 GMT

    [ https://issues.apache.org/jira/browse/CXF-5374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13812876#comment-13812876
] 

Sridhar Jonnalagadda commented on CXF-5374:
-------------------------------------------

I configured a Provider and this is my class:

@Component("serverBusy")
public class ServerBusy implements ExceptionMapper<TaskRejectedException> {

    @Override
    public Response toResponse(final TaskRejectedException exception){
       return Response.status(Response.Status.SERVICE_UNAVAILABLE).build();
    }

}


Spring Config:

    <task:executor id="workerPool" pool-size="10" queue-capacity="50"/>

     <jaxrs:server id="restContainer"  address="/" >
        <jaxrs:executor>
            <ref bean="workerPool"/>
        </jaxrs:executor>
        <jaxrs:providers>
            <ref bean="serverBusy"/>
        </jaxrs:providers>
        <jaxrs:serviceBeans>
            <ref bean="tokenService" />
        </jaxrs:serviceBeans>
    </jaxrs:server>


web.xml


   <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/*Context.xml</param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <servlet>
        <servlet-name>CXFServlet</servlet-name>
        <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
        <async-supported>true</async-supported>
    </servlet>


Sinnpet from  Spring ThreadPoolTaskExecutor:

	public void execute(Runnable task) {
		Executor executor = getThreadPoolExecutor();
		try {
			executor.execute(task);
		}
		catch (RejectedExecutionException ex) {
			throw new TaskRejectedException("Executor [" + executor + "] did not accept task: " + task,
ex);
		}
	}

CXF 2.7.7 code :  org.apache.cxf.interceptor.ServiceInvokerInterceptor

Line 106:  executor.execute(o); receives TaskRejectedException from Spring. On the response
I'm expecting the response to be 503. but I see stack trace.





> Rejected Execution from ThreadPool
> ----------------------------------
>
>                 Key: CXF-5374
>                 URL: https://issues.apache.org/jira/browse/CXF-5374
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.7.7
>            Reporter: Sridhar Jonnalagadda
>            Priority: Critical
>
> When RejectedExecutionException is thrown then it the exception mapper for converting
into 503 error. This is because handleFault is much below in the stack calls.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message