ERLEDIGT
JA
JA
ANTWORTEN
0
0
ZUGRIFFE
410
410
EMPFEHLEN
-
Guten Morgen zusammen,
ich habe ein Problem beim Logging. Und zwar habe ich einen Web Service Client der eine Verbindung zu einem Web Service aufbaut. Diese Verbindung wird aufrecht erhalten, bis entweder ein Ereignis passiert oder eine Zeit x (Timeout) abgelaufen ist. In beiden Fällen wird die Verbindung sofort wieder neu aufgebaut. Beim Timeout wird jedes Mal eine SocketTimeoutException geworfen und ich schaffe es nicht diese abzufangen. Hier mal ein paar Details:
Zum Loggen verwende ich die Logging Facade Logback mit slf4j. Der Web Service benutzt Axis 2. Die Exception die ich gerne abfangen möchte, sieht so aus:
Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) ~[na:1.6.0_26] at java.net.SocketInputStream.read(SocketInputStream.java:129) ~[na:1.6.0_26] at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) ~[na:1.6.0_26] at java.io.BufferedInputStream.read(BufferedInputStream.java:237) ~[na:1.6.0_26] at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78) ~[commons-httpclient-3.1.jar:na] at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106) ~[commons-httpclient-3.1.jar:na] at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116) ~[commons-httpclient-3.1.jar:na] at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1413) ~[commons-httpclient-3.1.jar:na] at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973) ~[commons-httpclient-3.1.jar:na] at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735) ~[commons-httpclient-3.1.jar:na] at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098) ~[commons-httpclient-3.1.jar:na] at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398) ~[commons-httpclient-3.1.jar:na] at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171) ~[commons-httpclient-3.1.jar:na] at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) ~[commons-httpclient-3.1.jar:na] at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346) ~[commons-httpclient-3.1.jar:na] at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:542) ~[axis2-kernel-1.4.1.jar:na] at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:189) [axis2-kernel-1.4.1.jar:na] at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75) [axis2-kernel-1.4.1.jar:na] at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:371) [axis2-kernel-1.4.1.jar:na] at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:209) [axis2-kernel-1.4.1.jar:na] at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448) [axis2-kernel-1.4.1.jar:na] at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:401) [axis2-kernel-1.4.1.jar:na] at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228) [axis2-kernel-1.4.1.jar:na] at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163) [axis2-kernel-1.4.1.jar:na] at de.gen.service.impl.IncidentServiceStub.PullOp(IncidentServiceStub.java:601) [IncidentServiceStub.class:na] at de.services.Listener.pullOp(Listener.java:293) [OMUListener.class:na] at de.services.Listener.run(Listener.java:158) [OMUListener.class:na] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_26] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_26] at java.lang.Thread.run(Thread.java:662) [na:1.6.0_26]
Ich komme dort einfach nicht ran. Mein Ziel ist es, das diese (gewollte) Exception nicht ins Log geschrieben wird, sondern höchstens eine Nachricht. Kann mir jemand einen Tipp geben was ich noch machen könnte um diese Exception selbst behandeln zu können?
Zur Ergänzung: Es sieht so aus, als wenn das Framework direkt diese Exception loggt.
Das Problem ist überraschend von selbst verschwunden. Die Exception wird anscheinend nur geworfen, wenn man den default Timeout benutzt. Das explizite Setzen von options.setTimeOutInMilliSeconds(60000); führt dazu, dass die Exception nicht mehr geworfen wird. Soll mir recht sein
Geändert von sheel (15.12.11 um 10:11 Uhr) Grund: Doppel
Ähnliche Themen
-
Problem mit Eclipse und Tomcat logging.properties
Von ScoopDTN im Forum Enterprise Java (JEE, J2EE, Spring & Co.)Antworten: 0Letzter Beitrag: 15.02.11, 15:06 -
Problem mit Zend Framework
Von lgorse im Forum PHPAntworten: 11Letzter Beitrag: 28.11.10, 21:58 -
Welches php Framework (inkl. Framework-Übersicht)
Von rethus im Forum PHPAntworten: 10Letzter Beitrag: 14.11.07, 13:34 -
.net 1.x Framework wird installiert trotz .net 2.0 Framework
Von BWilhelm im Forum .NET CaféAntworten: 5Letzter Beitrag: 12.06.06, 07:28 -
Problem Custom Logging in Axis
Von cham im Forum JavaAntworten: 0Letzter Beitrag: 23.11.04, 09:16





Zitieren
Login





