Gen Java EJB Web Service call timeout at 60 seconds (JBoss/WildFly)
search cancel

Gen Java EJB Web Service call timeout at 60 seconds (JBoss/WildFly)


Article ID: 188942


Updated On:


Gen Gen - Run Time Distributed


We are developing a new Gen app, which is generated and compiled as Java.
The app is cooperative packaged.
The client are generated as: JVM/Java/INTERNET
The servers are generated as: JVM/JAVA/EJB Web services/Oracle/Java RMI
The Application Server is jboss/wildfly-14.0.1.Final

There are some servers that do quite a lot of processing, so the EJB request can take a lot to complete and sometimes a timeout error occurs i.e.

09:58:39,674 WARNING [org.apache.cxf.phase.PhaseInterceptorChain] ( Interceptor for {{}Invoke has thrown exception, unwinding now: org.apache.cxf.interceptor.Fault: Could not receive Message.
        at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
        at org.apache.cxf.endpoint.ClientImpl.doInvoke(
        at org.apache.cxf.endpoint.ClientImpl.invoke(
        at org.apache.cxf.endpoint.ClientImpl.invoke(
        at org.apache.cxf.endpoint.ClientImpl.invoke(
        at org.apache.cxf.endpoint.ClientImpl.invokeWrapped(
        at org.apache.cxf.jaxws.DispatchImpl.invoke(
        at org.apache.cxf.jaxws.DispatchImpl.invoke(
        at Source)
Caused by: SocketTimeoutException invoking http://localhost:8080/.../.../...: Read timed out
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
        at java.lang.reflect.Constructor.newInstance(
        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(
        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(
        at org.apache.cxf.transport.AbstractConduit.close(
        at org.apache.cxf.transport.http.HTTPConduit.close(
        at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(
        ... 43 more
Caused by: Read timed out
        at Method)
        at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream$
        at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream$
        at Method)
        at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.getResponseCode(
        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.doProcessResponseCode(
        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(
        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(
        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(
        ... 46 more
09:58:39,685 INFO  [stdout] ( 04/16/20-09:58:39:685[]: WSDynamicCoopFlow.processException.WS.Exception(): Read timed out

The timeout seems to be 60 seconds, How can we increase the timeout?


Gen Enterprise Java Beans


This is a web service call where JBoss/WildFly uses Apache CXF which itself has a client side receive timeout parameter ReceiveTimeout that defaults to 60000 milliseconds i.e. 60 seconds:
"ReceiveTimeout: Specifies the amount of time, in milliseconds, that the client will wait for a response before it times out. The default is 60000.
0 specifies that the client will wait indefinitely."


The Apache CXF/HTTPConduit timeouts can be configured in WildFly as system properties per this WildFly 14 Developer Guide page:
See section "HTTPConduit configuration"
cxf.client.receiveTimeout corresponds to the ReceiveTimeout.

The environment variable JAVA_OPTS in file standalone.conf (or under Windows standalone.conf.bat) was used to set the system property "cxf.client.receiveTimeout" to 900 seconds (15 minutes) i.e.

It was also found that 2 additional timeout settings needed to be set as follows:
1. In standalone.xml, for the datasource definition set the idle timeout to 15 minutes:
3. In standalone.xml, add <coordinator-environment default-timeout="900" /> to this existing section to set the transaction timeout to 900 seconds (15 minutes):
        <subsystem xmlns="urn:jboss:domain:transactions:5.0">
            <core-environment node-identifier="${}">
            <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
            <object-store path="tx-object-store" relative-to=""/>
            <coordinator-environment default-timeout="900" />

Additional Information

NOTE: Gen 8.5 is only officially supported with JBoss Application Server 5.1, and has not been certified with the WildFly or JBoss EAP Application Servers. Gen 8.6 is officially supported with the WildFly or JBoss EAP Application Servers. More details here:
Gen™ 8.5
Gen™ 8.6 Technical Requirements Third-Party Software Version