Wildfly 8.2/undertow read time out

前端 未结 3 680
我寻月下人不归
我寻月下人不归 2021-01-13 20:24

I recently migrated my project from jboss4 to wildfly 8.2 with java1.8. I have a webservice call using SAAJ which runs fine in command line. But when its run from within wil

相关标签:
3条回答
  • 2021-01-13 20:52

    Alternatively, this issue has been resolved in wildfly 9. Developers can override the default CXF HTTP conduit values by setting system properties. More detail is available at https://docs.jboss.org/author/display/WFLY9/Apache+CXF+integration#ApacheCXFintegration-ApacheCXFinterceptors

    0 讨论(0)
  • 2021-01-13 21:05

    I was able to fix this by changing receive timeout in apache-cxf source and rebuilding it for wildfly8.2

    Brief instructions: (versions have to be exactly these otherwise compile fails).

    1. Download CXF2.7.15 src from apache
    2. Download jdk1.6 latest release
    3. Download 3.0.4
    4. Export JAVA_HOME=path-to-jdk1.6
    5. Add jdk1.6/bin and maven/bin to PATH
    6. export MAVEN_OPTS=-Xmx512m to fix permgen errors
    7. Open ./rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd and change ReceiveTimeout from 60000 to whatever needed for eg. 600000 (10 minutes)
    8. Run mvn -Pfastinstall

    File that has HTTPConduit socket timeout is HTTPClientPolicy.java which is in ./rt/transports/http/target/cxf-rt-transports-http-2.7.15.jar. Copy this jar into wildfly8.2 modules under apache/cxf/impl/main folder. And also, edit module.xml to use this jar.

    I also had to change undertow read-timeout settings in standalone.xml to higher value to stop it from reattempting the request.

    Hope this helps.

    0 讨论(0)
  • 2021-01-13 21:10

    Enough to add the following code to Your webservice consumer:

    //import javax.xml.ws.BindingProvider;
    
    //Set timeout until a connection is established
    ((BindingProvider)this.myService).getRequestContext().put("javax.xml.ws.client.connectionTimeout", "60000"); //one minute
    
    //Set timeout until the response is received
            ((BindingProvider)this.myService).getRequestContext().put("javax.xml.ws.client.receiveTimeout", "600000"); //ten minutes
    
    0 讨论(0)
提交回复
热议问题