java.net.socketexception permission denied - Server choking - java

We started recently to have a problem on our production server, the application suddenly starts failing all outbound requests (calls to public APIs/local database) for a period of time and then requests start completing successfully again, and then after a while again they start failing. Every-time i restart Tomcat the issue goes away for a while and then re-appear again, and with every restart tomcat the issues start appearing within a less time until i have to restart the whole server to guarantee a lengthy period of stability.
I've looked all around through stackoverflow and google search results and not one of the suggested solutions or investigation paths has led me to solve the problem.
My server setup is :
- Windows server 2008 R2
- Tomcat 7.0.59
- JRE 7
I have used "netstat -ano" as suggested in one the answers on stackoverflow.com - i am missing the reference, sorry about that - to check if my application is leaking connections, i looked for CLOSE_WAIT status connections and there appears to be no leak, connections with CLOSE_WAIT status don't live for long they are 0 most of the times, 1 or 2 at maximum.
I have set the preferIPv4Stack java option setx _JAVA_OPTIONS -Djava.net.preferIPv4Stack=true successfully, but it didn't work. I guess its not related to it anyway, because my server wouldn't be able to send any successful requests if it was, right ? In my case, after Tomcat is restarted the server sends requests successfully for x hours, and then starts failing randomly until all requests are failing.
Can someone point me to a certain direction in investigating this issue ? What should i be looking for ?
Any help is appreciated.
EDIT :
Log :
org.springframework.web.client.ResourceAccessException: I/O error on POST request for "https://MYURL.COM": Permission denied: connect; nested exception is java.net.SocketException: Permission denied: connect
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:524) ~[spring-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:472) ~[spring-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:420) ~[spring-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at model.RestTemplateClient.AbstractRestClient.doRequest(AbstractRestClient.java:50) [OutswitchCore.jar:?]
at clients.KigoRestClient.doRequest(KigoRestClient.java:57) [KigoAdapter.jar:?]
at controller.KigoController.getProperty(KigoController.java:673) [KigoAdapter.jar:?]
at controller.KigoController.getProperty(KigoController.java:1) [KigoAdapter.jar:?]
at KigoAdapter.getProperty(KigoAdapter.java:108) [KigoAdapter.jar:?]
at com.codefish.pcms.channel.processors.PmsActionExecutor.execute(PmsActionExecutor.java:73) [OutswitchCore.jar:?]
at com.codefish.hibernate.HibernateThread.run(HibernateThread.java:27) [FishTankJava.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.7.0_76]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.7.0_76]
at java.lang.Thread.run(Unknown Source) [?:1.7.0_76]
Caused by: java.net.SocketException: Permission denied: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method) ~[?:1.7.0_76]
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source) ~[?:1.7.0_76]
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) ~[?:1.7.0_76]
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) ~[?:1.7.0_76]
at java.net.AbstractPlainSocketImpl.connect(Unknown Source) ~[?:1.7.0_76]
at java.net.PlainSocketImpl.connect(Unknown Source) ~[?:1.7.0_76]
at java.net.SocksSocketImpl.connect(Unknown Source) ~[?:1.7.0_76]
at java.net.Socket.connect(Unknown Source) ~[?:1.7.0_76]
at sun.security.ssl.SSLSocketImpl.connect(Unknown Source) ~[?:1.7.0_76]
at sun.security.ssl.BaseSSLSocketImpl.connect(Unknown Source) ~[?:1.7.0_76]
at sun.net.NetworkClient.doConnect(Unknown Source) ~[?:1.7.0_76]
at sun.net.www.http.HttpClient.openServer(Unknown Source) ~[?:1.7.0_76]
at sun.net.www.http.HttpClient.openServer(Unknown Source) ~[?:1.7.0_76]
at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source) ~[?:1.7.0_76]
at sun.net.www.protocol.https.HttpsClient.New(Unknown Source) ~[?:1.7.0_76]
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source) ~[?:1.7.0_76]
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source) ~[?:1.7.0_76]
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source) ~[?:1.7.0_76]
at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(Unknown Source) ~[?:1.7.0_76]
at org.springframework.http.client.SimpleBufferingClientHttpRequest.executeInternal(SimpleBufferingClientHttpRequest.java:76) ~[spring-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:46) ~[spring-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:49) ~[spring-web-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:509)
ANOTHER LOG PART :
ERROR org.quartz.core.ErrorLogger - An error occurred while scanning for the next triggers to fire.
org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'springNonTxDataSource.quartzJob': com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at org.quartz.impl.jdbcjobstore.JobStoreCMT.getNonManagedTXConnection(JobStoreCMT.java:168) ~[quartz-2.2.0.jar:?]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3774) ~[quartz-2.2.0.jar:?]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.acquireNextTriggers(JobStoreSupport.java:2759) ~[quartz-2.2.0.jar:?]
at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:264) [quartz-2.2.0.jar:?]
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.7.0_76]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.7.0_76]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.7.0_76]
at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.7.0_76]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:377) ~[mysql-connector-java-5.1.34-bin.jar:5.1.34]
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1036) ~[mysql-connector-java-5.1.34-bin.jar:5.1.34]
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:338) ~[mysql-connector-java-5.1.34-bin.jar:5.1.34]
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2232) ~[mysql-connector-java-5.1.34-bin.jar:5.1.34]
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2265) ~[mysql-connector-java-5.1.34-bin.jar:5.1.34]
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064) ~[mysql-connector-java-5.1.34-bin.jar:5.1.34]
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:790) ~[mysql-connector-java-5.1.34-bin.jar:5.1.34]
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44) ~[mysql-connector-java-5.1.34-bin.jar:5.1.34]
at sun.reflect.GeneratedConstructorAccessor54.newInstance(Unknown Source) ~[?:?]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.7.0_76]
at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.7.0_76]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:377) ~[mysql-connector-java-5.1.34-bin.jar:5.1.34]
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395) ~[mysql-connector-java-5.1.34-bin.jar:5.1.34]
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325) ~[mysql-connector-java-5.1.34-bin.jar:5.1.34]
at org.springframework.jdbc.datasource.SimpleDriverDataSource.getConnectionFromDriver(SimpleDriverDataSource.java:140) ~[spring-jdbc-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:153) ~[spring-jdbc-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:119) ~[spring-jdbc-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.scheduling.quartz.LocalDataSourceJobStore$2.getConnection(LocalDataSourceJobStore.java:131) ~[spring-context-support-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.quartz.utils.DBConnectionManager.getConnection(DBConnectionManager.java:108) ~[quartz-2.2.0.jar:?]
at org.quartz.impl.jdbcjobstore.JobStoreCMT.getNonManagedTXConnection(JobStoreCMT.java:165) ~[quartz-2.2.0.jar:?]
... 3 more
Caused by: java.net.SocketException: Permission denied: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method) ~[?:1.7.0_76]
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source) ~[?:1.7.0_76]
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) ~[?:1.7.0_76]
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) ~[?:1.7.0_76]
at java.net.AbstractPlainSocketImpl.connect(Unknown Source) ~[?:1.7.0_76]
at java.net.PlainSocketImpl.connect(Unknown Source) ~[?:1.7.0_76]
at java.net.SocksSocketImpl.connect(Unknown Source) ~[?:1.7.0_76]
at java.net.Socket.connect(Unknown Source) ~[?:1.7.0_76]
at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:213) ~[mysql-connector-java-5.1.34-bin.jar:5.1.34]
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:297) ~[mysql-connector-java-5.1.34-bin.jar:5.1.34]
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2232) ~[mysql-connector-java-5.1.34-bin.jar:5.1.34]
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2265) ~[mysql-connector-java-5.1.34-bin.jar:5.1.34]
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2064) ~[mysql-connector-java-5.1.34-bin.jar:5.1.34]
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:790) ~[mysql-connector-java-5.1.34-bin.jar:5.1.34]
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44) ~[mysql-connector-java-5.1.34-bin.jar:5.1.34]
at sun.reflect.GeneratedConstructorAccessor54.newInstance(Unknown Source) ~[?:?]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.7.0_76]
at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.7.0_76]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:377) ~[mysql-connector-java-5.1.34-bin.jar:5.1.34]
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:395) ~[mysql-connector-java-5.1.34-bin.jar:5.1.34]
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:325) ~[mysql-connector-java-5.1.34-bin.jar:5.1.34]
at org.springframework.jdbc.datasource.SimpleDriverDataSource.getConnectionFromDriver(SimpleDriverDataSource.java:140) ~[spring-jdbc-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:153) ~[spring-jdbc-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:119) ~[spring-jdbc-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.springframework.scheduling.quartz.LocalDataSourceJobStore$2.getConnection(LocalDataSourceJobStore.java:131) ~[spring-context-support-3.2.8.RELEASE.jar:3.2.8.RELEASE]
at org.quartz.utils.DBConnectionManager.getConnection(DBConnectionManager.java:108) ~[quartz-2.2.0.jar:?]
at org.quartz.impl.jdbcjobstore.JobStoreCMT.getNonManagedTXConnection(JobStoreCMT.java:165) ~[quartz-2.2.0.jar:?]
EDIT (NETSTAT -ANO RESULT In pastebin.com link) :
http://pastebin.com/JDnizrAs

Related

Consuming WS over SSL using JAXWS

I'm trying to consume a webservice using JAX-WS client and https.
The problem now is that i successfully created an instance of the service and get the port of the service but when trying to consume a service using that port it gives connection timeout.
> com.sun.xml.internal.ws.client.ClientTransportException: HTTP transport error: java.net.ConnectException: Connection timed out: connect
at com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.getOutput(Unknown Source)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(Unknown Source)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(Unknown Source)
at com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Unknown Source)
at com.sun.xml.internal.ws.client.Stub.process(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown Source)
at com.sun.proxy.$Proxy31.manuallyAuthorizeWithValidation(Unknown Source)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
... 15 more
Make sure service is running using SOAP,
if it's then try increasing the time
if still not working, try to change the port
Make sure the web service is running. You can use a tool such as SoapUI (free) to test SOAP web services.

Java client cannot connect ot Java server, locally, due VPN

I have problem to call locally (localhost) webservice from my Java client application to server application running on Java AS (wildfly10).
I used VM argument
-Djava.net.preferIPv4Stack=true
which was advice in other questions. There is VPN (Cisco AnyConnect) running (because there is one more WS that server application calls as client to remote server). The most probably the VPN is cause of my trouble, because without VPN running I am able to call WS. Is there any setting that make this working?
Error in logs:
09:34:36,400 [75] ERROR simulator.RequestProcess - run error
com.sun.xml.internal.ws.client.ClientTransportException: HTTP transport error: java.net.SocketException: Permission denied: connect
at com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.getOutput(Unknown Source)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(Unknown Source)
at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(Unknown Source)
at com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Unknown Source)
at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Unknown Source)
at com.sun.xml.internal.ws.client.Stub.process(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(Unknown Source)
at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(Unknown Source)
at com.sun.proxy.$Proxy30.pair(Unknown Source)
at my.code.simulator.RequestProcess.pair(RequestProcess.java:121)
at my.code.simulator.RequestProcess.run(RequestProcess.java:78)
at java.lang.Thread.run(Unknown Source)
Caused by: java.net.SocketException: Permission denied: connect
at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
... 17 more
Problem was that WSDL contains my computer alias that was not resolved by DNS (?) in standalone.xml there was
<subsystem xmlns="urn:jboss:domain:webservices:2.0">
<modify-wsdl-address>true</modify-wsdl-address>
<wsdl-host>0.0.0.0</wsdl-host>
...
working after modify to
<subsystem xmlns="urn:jboss:domain:webservices:2.0">
<modify-wsdl-address>true</modify-wsdl-address>
<wsdl-host>localhost</wsdl-host>
...

Already in use:connect exception in Neo4j

I'm writing a client for Neo4j. I have resources and users node with create and createdfor relationships. In each view resources, I query the database 11 times.
Running with 1 thread, everything goes fine. But when I run it with 40 threads the following exception arises: (I'm using java api for rest api of Neo4j and my client and server are on the same machine)
com.sun.jersey.api.client.ClientHandlerException: java.net.BindException: Address already in use: connect
at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:149)
at org.neo4j.rest.graphdb.UserAgent$1.handle(UserAgent.java:68)
at com.sun.jersey.api.client.Client.handle(Client.java:648)
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:670)
at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
at com.sun.jersey.api.client.WebResource$Builder.post(WebResource.java:553)
at org.neo4j.rest.graphdb.ExecutingRestRequest.post(ExecutingRestRequest.java:151)
at org.neo4j.rest.graphdb.ExecutingRestAPI.query(ExecutingRestAPI.java:547)
at org.neo4j.rest.graphdb.ExecutingRestAPI.query(ExecutingRestAPI.java:568)
at org.neo4j.rest.graphdb.RestAPIFacade.query(RestAPIFacade.java:235)
at org.neo4j.rest.graphdb.query.RestCypherQueryEngine.query(RestCypherQueryEngine.java:50)
at Neo4j.Neo4jRestClient.listFriends(Neo4jRestClient.java:530)
at Neo4j.Neo4jRestClient.listFriends(Neo4jRestClient.java:590)
at Neo4j.Neo4jRestClient.listFriends(Neo4jRestClient.java:590)
at Neo4j.Neo4jRestClient.listFriends(Neo4jRestClient.java:590)
at edu.usc.bg.base.DBWrapper.listFriends(DBWrapper.java:113)
at edu.usc.bg.workloads.CoreWorkload.doActionGetFriends(CoreWorkload.java:2360)
at edu.usc.bg.workloads.CoreWorkload.doTransaction(CoreWorkload.java:1065)
at edu.usc.bg.base.ClientThread.run(ClientThread.java:201)
Caused by: java.net.BindException: Address already in use: connect
at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)

Weird connection on JavaFX launch

It seems lately, my JavaFX app always tries to connect to something upon launch.
This process hangs my app for a bit and makes my app startup time about 20 seconds more longer. This is the error I see:
java.net.ConnectException: Connection timed out: connect
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unkno
wn Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown So
urce)
at com.sun.deploy.net.proxy.AbstractAutoProxyHandler.getJSFileFromURL(Un
known Source)
at com.sun.deploy.net.proxy.AbstractAutoProxyHandler.init(Unknown Source
)
at com.sun.deploy.net.proxy.DynamicProxyManager.reset(Unknown Source)
at com.sun.deploy.net.proxy.DeployProxySelector.reset(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.javafx.main.Main.tryToSetProxy(Main.java:572)
at com.javafx.main.Main.launchApp(Main.java:640)
at com.javafx.main.Main.main(Main.java:805)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown
Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Sour
ce)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown So
urce)
at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(Unknown So
urce)
at java.net.URLConnection.getContentType(Unknown Source)
at com.sun.deploy.net.proxy.AbstractAutoProxyHandler.isSupportedINSFile(
Unknown Source)
... 10 more
I don't see it trying to connect if I'm running from the IDE. So is this some sort of oracle-based spying attempt? What gives?
I think it's trying to auto-detect a proxy somehow.
I was able to make this go away in the Java Control Panel. On the General tab, in the Network Settings... dialog, switch from Use browser settings to Direct connection.
(I couldn't find any proxy settings specified in either Firefox or IE, though.)

'SEVERE: SAAJ0009: Message send failed error' while sending a message

Feb 8, 2011 11:56:49 AM com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPC
onnection post
SEVERE: SAAJ0009: Message send failed
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: java.security.PrivilegedA
ctionException: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Message s
end failed
at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.cal
l(Unknown Source)
at external.main(external.java:47)
Caused by: java.security.PrivilegedActionException: com.sun.xml.internal.messagi
ng.saaj.SOAPExceptionImpl: Message send failed
at java.security.AccessController.doPrivileged(Native Method)
... 2 more
Caused by: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Message send f
ailed
at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.pos
t(Unknown Source)
at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection$Pri
viledgedPost.run(Unknown Source)
... 3 more
Caused by: 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 java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown
Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Sour
ce)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown S
ource)
... 5 more
CAUSE:
java.security.PrivilegedActionException: com.sun.xml.internal.messaging.saaj.SOA
PExceptionImpl: Message send failed
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.cal
l(Unknown Source)
at external.main(external.java:47)
Caused by: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Message send f
ailed
at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.pos
t(Unknown Source)
at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection$Pri
viledgedPost.run(Unknown Source)
... 3 more
Caused by: 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 java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown
Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Sour
ce)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown S
ource)
... 5 more
CAUSE:
java.security.PrivilegedActionException: com.sun.xml.internal.messaging.saaj.SOA
PExceptionImpl: Message send failed
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.cal
l(Unknown Source)
at external.main(external.java:47)
Caused by: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Message send f
ailed
at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection.pos
t(Unknown Source)
at com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection$Pri
viledgedPost.run(Unknown Source)
... 3 more
Caused by: 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 java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown
Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Sour
ce)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown S
ource)
... 5 more
java.security.PrivilegedActionException: com.sun.xml.internal.messaging.saaj.SOA
PExceptionImpl: Message send failed
The above problem occurs when there is a PROXY problem occurs.
There are 2 ways to resolve this.
I was facing the same problem while creating a SOAP Envelope and calling a web service.
When I tried testing this request created by my code from SOAP-UI Client, it was working absolutely fine because I have set the proxy, username & password.
But When I tried to fetch the response by calling the web service from Eclipse code itself, this did not work for me.
I also tried to set the proxy object within Network Connections tab in Eclipse.
For this, I changed the initial setting from Native TO Manual & simply added my proxy, username & password.
But unfortunately, this also did not work for me.
I then simply added 1 line of code to pick up system set proxy within my code & this has resolved my problem.
You have to add : System.setProperty("java.net.useSystemProxies", "true");
This will simply pick up system set proxies within your code & will work fine.
If this is also not working, your request object has got some problem for sure.
Exception says :
Caused by: java.net.ConnectException: Connection timed out: connect
The URL you are trying to access for WebService isn't accessible from your machine.
double check it by ping, is there any proxy settings , firewall . ..etc.

Categories