I am trying the build a SOAP client to access the National Weather Service NDFD SOAP Service. I'm using Axis2 1.6.2 with code generated with wsdl2java.
Every time I try to retrieve data, I receive a AxisFault saying Read timed out.
I have tried to increase the timeout time to up to 500 s, but all that does is make it wait longer before giving the same error.
Exception in thread "main" org.apache.axis2.AxisFault: [was class java.net.SocketTimeoutException] Read timed out
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at gov.weather.graphical.xml.dwmlgen.wsdl.ndfdxml_wsdl.NdfdXMLStub.fromOM(NdfdXMLStub.java:26499)
at gov.weather.graphical.xml.dwmlgen.wsdl.ndfdxml_wsdl.NdfdXMLStub.nDFDgen(NdfdXMLStub.java:595)
at he.andrew.ndfd.NDFDData.getData(NDFDData.java:47)
at he.andrew.ndfd.NDFDData.main(NDFDData.java:25)
Caused by: java.lang.RuntimeException: [was class java.net.SocketTimeoutException] Read timed out
at com.ctc.wstx.util.ExceptionUtil.throwRuntimeException(ExceptionUtil.java:18)
at com.ctc.wstx.sr.StreamScanner.throwLazyError(StreamScanner.java:731)
at com.ctc.wstx.sr.BasicStreamReader.safeFinishToken(BasicStreamReader.java:3657)
at com.ctc.wstx.sr.BasicStreamReader.getText(BasicStreamReader.java:809)
at com.ctc.wstx.sr.BasicStreamReader.getElementText(BasicStreamReader.java:679)
at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.getElementText(XMLStreamReaderWrapper.java:100)
at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.getElementText(XMLStreamReaderWrapper.java:100)
at org.apache.axiom.om.impl.llom.SwitchingWrapper.getElementText(SwitchingWrapper.java:936)
at javax.xml.stream.util.StreamReaderDelegate.getElementText(Unknown Source)
at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.getElementText(XMLStreamReaderWrapper.java:100)
at org.apache.axiom.util.stax.debug.XMLStreamReaderValidator.getElementText(XMLStreamReaderValidator.java:75)
at gov.weather.graphical.xml.dwmlgen.wsdl.ndfdxml_wsdl.NdfdXMLStub$NDFDgenResponse$Factory.parse(NdfdXMLStub.java:5612)
at gov.weather.graphical.xml.dwmlgen.wsdl.ndfdxml_wsdl.NdfdXMLStub.fromOM(NdfdXMLStub.java:26353)
... 3 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at org.apache.commons.httpclient.WireLogInputStream.read(WireLogInputStream.java:69)
at org.apache.commons.httpclient.ChunkedInputStream.read(ChunkedInputStream.java:182)
at java.io.FilterInputStream.read(Unknown Source)
at org.apache.commons.httpclient.AutoCloseInputStream.read(AutoCloseInputStream.java:108)
at java.io.FilterInputStream.read(Unknown Source)
... more not included
The error seems to be the same as the one here: Exception in thread "main" org.apache.axis2.AxisFault: Read timed out. However, I don't quite understand any of the responses to that question.
One final note. In order to avoid a "411 Error: Length Required", I had to turn off the Chunked option. I'm not sure if this is relevant.
Does anyone know what might be the problem?
I ran into this error on a project, and the root cause was a proxy server setting. I had to modify the proxy to allow the communication to the service I was trying to hit. My code was running as part of a custom application that used its own proxy. So this may also be something to try.
Related
I'm trying to connect a Java application to a Redshift database. When I run DriverManager.getConnection(), it sits for a long time (minutes) and finally throws an exception:
Exception in thread "main" java.sql.SQLException:
[Amazon](600001) The server closed the connection.
at com.amazon.support.channels.TLSSocketChannel.readBytes(Unknown Source)
at com.amazon.support.channels.TLSSocketChannel.doHandshake(Unknown Source)
at com.amazon.support.channels.TLSSocketChannel.<init>(Unknown Source)
at com.amazon.redshift.client.PGClient.checkSSL(Unknown Source)
at com.amazon.redshift.client.PGClient.<init>(Unknown Source)
at com.amazon.redshift.core.PGJDBCConnection.connect(Unknown Source)
at com.amazon.jdbc.common.BaseConnectionFactory.doConnect(Unknown Source)
at com.amazon.jdbc.common.AbstractDriver.connect(Unknown Source)
at com.amazon.redshift.jdbc.Driver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
I can connect using the same connection string and credentials from SQL Workbench on the same machine. Also, if I supply bad credentials to the connection, it gives an authentication error. So I don't believe this is an Amazon security issue, which seems to be the most common reason for an inability to connect.
Other ideas?
Update: The mystery deepens. Other members of the team are able to check out the code and run it successfully. We have the driver in our team's shared maven repository.
Well... not sure what the problem was. But I did an Eclipse update and it went away.
I am not a java developer Here we have an open source AS2 server. But we are getting frequently some exceptions like below.
A problem occurred on the AS2 server instance. Most of these notifications are not critical for your AS2 system status. If the related transaction is on status "green" you could be sure that the transaction has been finished. Anyway please have a look at your AS2 system to see what happened there.
Category: SQLTransientConnectionException
Message: connection exception: connection failure: java.net.SocketException: Broken pipe (Write failed)
org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source)
org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:281)
org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement(PoolingDataSource.java:313)
de.mendelson.util.database.DebuggableConnection.prepareStatement(DebuggableConnection.java:156)
de.mendelson.comm.as2.sendorder.SendOrderAccessDB.getNext(SendOrderAccessDB.java:180)
de.mendelson.comm.as2.sendorder.SendOrderReceiver.run(SendOrderReceiver.java:102)
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
java.util.concurrent.FutureTask.run(FutureTask.java:262)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:745)
So what could be the reason to get this kind of errors? Any idea about this?
I am trying out GCM for communication between android client and a server application in java.
I am using XMPP based GCM as i need asynchronous, bidirectional messages.
On my client side,
1. Google Play Service check showed that an update is required.
google play services is out of date. Requires 4242000 but found 3136130
Api level- 17, Using AVD with google API, Android 4.2.2
Google play services Revision 15
How can i solve this?
But i can successfully register the device.
On Server side, i use
2. I am using smack library 3.4.1
i used the sample code in google docs.
I get the following error
gcm.googleapis.com:5235 Exception: XMPPError connecting to gcm.googleapis.com:5235.; : remote-server-error(502)
-- caused by: XMPPError connecting to gcm.googleapis.com:5235.: remote-server-error(502) XMPPError connecting to gcm.googleapis.com:5235.
-- caused by: java.net.ConnectException: Connection timed out: connect
at org.jivesoftware.smack.XMPPConnection.connectUsingConfiguration(XMPPConnection.java:592)
at org.jivesoftware.smack.XMPPConnection.connect(XMPPConnection.java:1010)
at SmackCcsClient.connect(SmackCcsClient.java:247)
at SmackCcsClient.main(SmackCcsClient.java:341)
Nested Exception:
XMPPError connecting to gcm.googleapis.com:5235.: remote-server-error(502) XMPPError connecting to gcm.googleapis.com:5235.
-- caused by: java.net.ConnectException: Connection timed out: connect
at org.jivesoftware.smack.XMPPConnection.connectUsingConfiguration(XMPPConnection.java:565)
at org.jivesoftware.smack.XMPPConnection.connect(XMPPConnection.java:1010)
at SmackCcsClient.connect(SmackCcsClient.java:247)
at SmackCcsClient.main(SmackCcsClient.java:341)
Nested Exception:
java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(Unknown Source)
at org.jivesoftware.smack.XMPPConnection.connectUsingConfiguration(XMPPConnection.java:557)
at org.jivesoftware.smack.XMPPConnection.connect(XMPPConnection.java:1010)
at SmackCcsClient.connect(SmackCcsClient.java:247)
at SmackCcsClient.main(SmackCcsClient.java:341)
Exception in thread "main" java.lang.IllegalStateException: Not connected to server.
at org.jivesoftware.smack.XMPPConnection.sendPacket(XMPPConnection.java:483)
at SmackCcsClient.send(SmackCcsClient.java:131)
at SmackCcsClient.main(SmackCcsClient.java:356)
I have signed up the form for upstream messaging. but the approval is still pending. But the connection itself fails here. How can i solve this.
Please Help!
Thank you in advance!!
The ERROR CODE 502 implies that there is problem with connecting SERVER, There might be several reasons but some common problem are,
1 ) FIREWALL PROBLEM ----[configure properly your firewall]
2 ) Server internal error ----[retry latter]
I am able to request darwin server and also getting response from darwin server but i am not getting, How to get that requested video file streaming data on my client side?
i am using socket DatagramConnection socket= (DatagramConnection)Connector.open("datagram://:8080"); but i am getting following error
connection class not found
org.microemu.microedition.io.ConnectorImpl.openSecure(null:-1)
Exception in thread "main" javax.microedition.io.ConnectionNotFoundException
at org.microemu.microedition.io.ConnectorImpl.openSecure(Unknown Source)
at org.microemu.microedition.io.ConnectorImpl.access$200(Unknown Source)
at me2.h.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at org.microemu.microedition.io.ConnectorImpl.open(Unknown Source)
at org.microemu.microedition.io.ConnectorAdapter.open(Unknown Source)
at javax.microedition.io.Connector.open(Unknown Source)
at RTPSourceStream.<init>(RTPSourceStream.java:46)
at RTSPrequest.main(RTSPrequest.java:48)
How to get streaming data of requested URL? I am not getting link related to this
can anyone suggest me link for it?
You need to use DataInputStream class to get the relevant streaming data.
Just like downloading of an Image with Stream Data Connection.
Iam using HTTPClient 4.0 to connect a remote server and transfer file using HTTPS.
When i tried to connect i get the exception "java.net.SocketException: Unconnected sockets not implemented".
Please look at the stack trace
java.net.SocketException: Unconnected sockets not implemented
at java.lang.Throwable.<init>(Throwable.java:196)
at java.lang.Exception.<init>(Exception.java:41)
at java.io.IOException.<init>(IOException.java:40)
at java.net.SocketException.<init>(SocketException.java:29)
at javax.net.SocketFactory.createSocket(SocketFactory.java:2)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(Unknown Source)
at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(Unknown Source)
at org.apache.commons.httpclient.HttpConnection.open(Unknown Source)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(Unknown Source)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(Unknown Source)
at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown Source)
at org.apache.commons.httpclient.HttpClient.executeMethod(Unknown Source)
at co.com.personalsoft.ftpseguro.utilidades.TransmisionHTTP.ejecutarTransmisionHTTP(TransmisionHTTP.java:107)
at co.com.personalsoft.ftpseguro.utilidades.TransmisionFTPNew.ejecutarTransmisionAuto(TransmisionFTPNew.java:483)
at co.com.personalsoft.ftpseguro.utilidades.TransmisionFTPNew.ejecutarTransmision(TransmisionFTPNew.java:1016)
at co.com.personalsoft.ftpautomatico.ConexionThread.run(ConexionThread.java:58)
at java.lang.Thread.run(Thread.java:595)
The same error is found while using HTTP Client 3.1.
My Environment
Application Server : Websphere application server 6.1.0.23
Java : JDK 1.5.0.16
Actually a more complete answer than suppressingfire is
Add com.ibm.ws.admin.client_7.0.0.jar to java build
This solves the java.lang.NoClassDefFoundError: com.ibm.ffdc.Manager error.
Add to setup:
import java.security.Security;
...
Security.setProperty("ssl.SocketFactory.provider", "com.ibm.jsse2.SSLSocketFactoryImpl");
This solves the Cannot find the specified class com.ibm.websphere.ssl.protocol.SSLSocketFactory
When I enabled javax.net.debug, I noticed that there was a missing class com.ibm.websphere.com.ibm.websphere.ssl.protocol.SSLSocketFactory.
I was experiencing trouble in unit tests that invoke httpclient. What I ended up doing was to add this line to my TestClass.setUp()
Security.setProperty("ssl.SocketFactory.provider", "com.ibm.jsse2.SSLSocketFactoryImpl");