Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Erich S.
Getting http timeout - own settings fail
18 luglio 2013 7.54
Risposta

Erich S.

Punteggio: New Member

Messaggi: 23

Data di Iscrizione: 1 giugno 2010

Messaggi recenti

Hi there,

I'm working with Liferay 6.0.6 (Windows XP)and I have the following problem:
From a (Vaadin) portlet I call a web service. It answers delayed so that the Liferay / Tomcat raises the following error:

 1Caused by: java.net.SocketTimeoutException: Read timed out
 2        at java.net.SocketInputStream.socketRead0(Native Method)
 3        at java.net.SocketInputStream.read(SocketInputStream.java:129)
 4        at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
 5        at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
 6        at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
 7        at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:687)
 8        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632)
 9        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1072)
10        at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:373)
11        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2223)
12        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192)
13        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036)
14        ... 186 more


That's why I've created a portal-ext.properties file in the Liferay home directory and made an entry:

1com.liferay.portal.util.HttpImpl.timeout=90000


Nevertheless there is a timeout after exact 60 (!) sec.

In the portal-impl.jar/portal.properties there is an entry with 10000 (= 10 sec), my portal-ext.properties is 90000 (= 90sec)

Questions:
Why raises the timeout after 60sec?
Why doesn't work neither the 10sec from portal-imp.jar nor the 90sec from my portal-ext.properties?
What am I doing wrong?

Can I somehow check what the actual value is and where it comes from?

Thanks in advance
Erich
David H Nebinger
RE: Getting http timeout - own settings fail
22 luglio 2013 6.17
Risposta

David H Nebinger

Community Moderator

Punteggio: Liferay Legend

Messaggi: 11770

Data di Iscrizione: 1 settembre 2006

Messaggi recenti

Erich S.:
Why raises the timeout after 60sec?


Socket timeout is controlled completely by the component opening the socket, in this case CXF. It's not going to use any of the properties in portal-ext.properties as those aren't referenced when the connection is opened.

You need to change the value specifically for your call. Check out this link: http://stackoverflow.com/questions/5270981/webservice-java-net-sockettimeoutexception-read-timed-out
Erich S.
RE: Getting http timeout - own settings fail
25 luglio 2013 0.28
Risposta

Erich S.

Punteggio: New Member

Messaggi: 23

Data di Iscrizione: 1 giugno 2010

Messaggi recenti

Hi David,

you're right, it works!

Thanks a lot!

For those who are interessted in details:

In my applicationContext.xml I added some lines to configure a timeout of 3 minutes:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd">

<context:annotation-config/>

<bean id="myPortlet" class="de.test.myPortlet" autowire="byName" scope="prototype"/>

<http-conf:conduit name="http://localhost:4444/.*">
<http-conf:client ReceiveTimeout="180000" />
</http-conf:conduit>

...
</beans>

Greetings
Erich