[jboss-jira] [JBoss JIRA] (WFLY-4476) Unable to configure cxf socket timeout in wildfly_8.2.Final

Alessio Soldano (JIRA) issues at jboss.org
Thu Apr 2 12:24:19 EDT 2015


    [ https://issues.jboss.org/browse/WFLY-4476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13055843#comment-13055843 ] 

Alessio Soldano commented on WFLY-4476:
---------------------------------------

This appears as a regression likely because in the past the JBossWS-CXF implementation of javax.xml.soap.SOAPConnection was not automatically resolved.
Anyway, the HTTPConduit is going to be configurable when the JBWS-3901 changes will be included in WildFly, that is after next Beta or CR release of JBossWS 5.

> Unable to configure cxf socket timeout in wildfly_8.2.Final
> -----------------------------------------------------------
>
>                 Key: WFLY-4476
>                 URL: https://issues.jboss.org/browse/WFLY-4476
>             Project: WildFly
>          Issue Type: Bug
>          Components: Web Services
>    Affects Versions: 8.1.0.Final, 8.2.0.Final, 9.0.0.Beta2
>         Environment: Java8, Ubuntu Linux Desktop
>            Reporter: George Mathias
>            Assignee: Alessio Soldano
>            Priority: Critical
>              Labels: cxf, saaj, undertow
>             Fix For: 8.2.0.Final
>
>
> Socket times out after 60 seconds when calling SAAJ webservices from a wildfly servlet. Wildfly uses CXF internally and CXF HTTP Conduit times out in 60 seconds by default. Cannot find a way to configure this timeout (Receive timeout) in standalone.xml file.
> Following line throws socket read time out exception
> 		    responseMsg = soapConn.call(soapMessage, wsdlLoc);
> Java Call is:
> 	private static String callWebService(String serviceName, 
> 			String userName,
> 			org.w3c.dom.Document soapRequestDoc,
> 			String serviceType,
> 			String endPointAddress,
> 			String remoteClientAddress,
> 			String remoteClientHostname,
> 			String remoteClientUser,
> 			String clientApplicationId)
> 	throws SOAPException,java.io.IOException,CommunicationException
> 	{
> 		SOAPConnection soapConn = null;
> 		String wsdlLoc=endPointAddress;
> 		String resp = "";
> 		MessageFactory msgFactory;
> 		SOAPFactory soapFactory;
> 		SOAPMessage soapMessage;
> 		SOAPConnectionFactory soapConnFactory;
> 		SOAPMessage responseMsg;
> 		
> 		try
> 		{
> 			if (wsdlLoc == null)
> 				throw new SOAPException("Error: Endpoint address is NULL.");
> 			msgFactory = MessageFactory.newInstance();
> 			soapFactory = SOAPFactory.newInstance();
> 			soapMessage = msgFactory.createMessage();
>             
> 			//Add headers
> 			addSoapHeaders(soapMessage,soapFactory,
> 					serviceType,userName,remoteClientAddress,remoteClientHostname,
> 					remoteClientUser,
> 					clientApplicationId);
> 			
> 			//Add Body			addBody(soapMessage,soapFactory,soapRequestDoc,serviceName);
> 		    		    
> 		    logger.debug(soapMessage);			
> 		    soapConnFactory = SOAPConnectionFactory.newInstance();
> 		    soapConn = soapConnFactory.createConnection();
> 		    logger.debug("Invoking service ["+serviceName+
> 		    		"] on WSDL ["+
> 		    		wsdlLoc+"] ...");		 
> 		    		    
> 		    responseMsg = soapConn.call(soapMessage, wsdlLoc);
> 		    logger.debug("Call completed ["+serviceName+
> 		    		"] on WSDL ["+
> 		    		wsdlLoc+"]!");
> 		    resp = processResponseMessageStringParser(responseMsg);
> 			logger.debug("Return Document [" + resp + "]");
> 		}
> 		catch (SOAPException e)
> 		{
> 				logger.error(e);
> 				throw new CommunicationException(errorBuffer.toString());
> 		}
> 		finally
> 		{
> 			try
> 			{
> 				if (soapConn != null)
> 					soapConn.close();
> 			}
> 			catch (Exception e)
> 			{
> 				e.printStackTrace();
> 			}
> 		}
> 		
> 		return resp;
> 	}
> Exception thrown is:
> javax.xml.soap.SOAPException: JBWS024004: SOAP message could not be sent
>         at org.jboss.wsf.stack.cxf.saaj.SOAPConnectionImpl.call(SOAPConnectionImpl.java:124)
>         at com.qwest.servlet.Client.callWebService(Client.java:225)
>         at com.qwest.servlet.Client.call(Client.java:138)
>         at com.qwest.servlet.TestServlet.doGet(TestServlet.java:73)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
>         at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:86)
>         at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
>         at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
>         at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
>         at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
>         at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
>         at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
>         at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
>         at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
>         at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
>         at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)
>         at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70)
>         at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)
>         at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
>         at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
>         at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
>         at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
>         at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:278)
>         at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:255)
>         at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:80)
>         at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:174)
>         at io.undertow.server.Connectors.executeRootHandler(Connectors.java:199)
>         at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:774)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>         at java.lang.Thread.run(Thread.java:745)
> Caused by: java.net.SocketTimeoutException: SocketTimeoutException invoking http://localhost:8080/TestWS/v2.0.0/TestServer?wsdl: Read timed out
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
>         at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:1347)
>         at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1331)
>         at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
>         at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:632)
>         at org.jboss.wsf.stack.cxf.saaj.SOAPConnectionImpl.call(SOAPConnectionImpl.java:120)
>         ... 31 more
> Caused by: java.net.SocketTimeoutException: Read timed out
>         at java.net.SocketInputStream.socketRead0(Native Method)
>         at java.net.SocketInputStream.read(SocketInputStream.java:150)
>         at java.net.SocketInputStream.read(SocketInputStream.java:121)
>         at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
>         at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
>         at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
>         at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:703)
>         at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:647)
>         at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1534)
>         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1439)
>         at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
>         at org.apache.cxf.transport.http.URLConnectionHTTPConduit$URLConnectionWrappedOutputStream.getResponseCode(URLConnectionHTTPConduit.java:266)
>         at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1545)
>         at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1515)
>         at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1318)



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)


More information about the jboss-jira mailing list