I'm trying to run groovy koans http://groovykoans.org/ and when I use the gradlew script it tries to download gradle from the internet (from http://services.gradle.org/distributions/gradle-1.8-bin.zip)
But it crashes with a connection timed out exception. I'm able to download the file fine from firefox. I've included http proxy args on the command line as per the instructions and I can ping services.gradle.org from my machine.
I'm on windows.
C:\Users\me\My Documents\documents\work\build_system\groovykoans-master>gradlew removeSolutions -Dhttp.proxyHost=proxy.blah.com -Dhttp.proxyPort=8000
Downloading http://services.gradle.org/distributions/gradle-1.8-bin.zip
Exception in thread "main" java.lang.RuntimeException: java.net.ConnectException: Connection timed out: connect
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:78)
at org.gradle.wrapper.Install.createDist(Install.java:47)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:69)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:378)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:473)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:203)
at sun.net.www.http.HttpClient.New(HttpClient.java:290)
at sun.net.www.http.HttpClient.New(HttpClient.java:306)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:995)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:931)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:849)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1299)
at org.gradle.wrapper.Download.downloadInternal(Download.java:59)
at org.gradle.wrapper.Download.download(Download.java:45)
at org.gradle.wrapper.Install$1.call(Install.java:60)
at org.gradle.wrapper.Install$1.call(Install.java:47)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
... 3 more
If I can't solve the connect issue is there a way I can manually install the gradle that I've successfully downloaded via my browser and bypass the download step from the gradlewrapper?
Well I managed to work out where the gradle zip was being put (C:\Users\me\.gradle\wrapper\dists\gradle-1.8-bin\vruqmccc8532n7gr46qavsii8 so I dropped my separately downloaded zip in there and it got me past the issue.
However since then I've also realized I was specifying the -Dhttp properties after the command and not before it so I suspect had I done that it would have worked. (Haven't retried it with a cleaned install area though) i.e I should have had
gradlew -Dhttp.proxyHost=proxy.blah.com -Dhttp.proxyPort=8000 removeSolutions
instead of:
gradlew removeSolutions -Dhttp.proxyHost=proxy.blah.com -Dhttp.proxyPort=8000
duh!
Related
Recently, the stable version (1.6.2) of apache flink was released. I read this instruction. But when I run the following command:
./bin/flink run examples/streaming/SocketWindowWordCount.jar --port 9000
I get the following error:
The program finished with the following exception:
org.apache.flink.client.program.ProgramInvocationException: Job failed. (JobID: 264564a337d4c6705bde681b34010d28)
at org.apache.flink.client.program.rest.RestClusterClient.submitJob(RestClusterClient.java:268)
at org.apache.flink.client.program.ClusterClient.run(ClusterClient.java:486)
at org.apache.flink.streaming.api.environment.StreamContextEnvironment.execute(StreamContextEnvironment.java:66)
at org.apache.flink.streaming.examples.socket.SocketWindowWordCount.main(SocketWindowWordCount.java:92)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:529)
at org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:421)
at org.apache.flink.client.program.ClusterClient.run(ClusterClient.java:426)
at org.apache.flink.client.cli.CliFrontend.executeProgram(CliFrontend.java:816)
at org.apache.flink.client.cli.CliFrontend.runProgram(CliFrontend.java:290)
at org.apache.flink.client.cli.CliFrontend.run(CliFrontend.java:216)
at org.apache.flink.client.cli.CliFrontend.parseParameters(CliFrontend.java:1053)
at org.apache.flink.client.cli.CliFrontend.lambda$main$11(CliFrontend.java:1129)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1836)
at org.apache.flink.runtime.security.HadoopSecurityContext.runSecured(HadoopSecurityContext.java:41)
at org.apache.flink.client.cli.CliFrontend.main(CliFrontend.java:1129)
Caused by: org.apache.flink.runtime.client.JobExecutionException: Job execution failed.
at org.apache.flink.runtime.jobmaster.JobResult.toJobExecutionResult(JobResult.java:146)
at org.apache.flink.client.program.rest.RestClusterClient.submitJob(RestClusterClient.java:265)
... 20 more
Caused by: java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.flink.streaming.api.functions.source.SocketTextStreamFunction.run(SocketTextStreamFunction.java:96)
at org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:94)
at org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:58)
at org.apache.flink.streaming.runtime.tasks.SourceStreamTask.run(SourceStreamTask.java:99)
at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:300)
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:711)
at java.lang.Thread.run(Thread.java:748)
I found this link:Flink program cannot submit when i follow flink-1.4's quickstart and use "./bin/flink run examples/streaming/SocketWindowWordCount.jar --port 9000". However, it didn't help. I tried with Flink 1.6.2 with Hadoop® 2.8 as well as Flink 1.5.5 with Hadoop® 2.8 on mac os and ubuntu. But I just got the same error.
Works fine for me. Only difference I can see is that I'm using the version of Flink without hadoop, but I doubt that's the issue.
java.net.ConnectException: Connection refused usually means that there is no service listening on port 9000. You should have netcat running on this port via
$ nc -l 9000
(see https://ci.apache.org/projects/flink/flink-docs-stable/quickstart/setup_quickstart.html#run-the-example). If netcat is running, and it's not working, maybe try another port? It might also help to check all the log files for additional clues.
I solved the annoying problem by reading the nc -h (in Linux):
connect to somewhere: nc [-options] hostname port[s] [ports] ...
listen for inbound: nc -l -p port [-options] [hostname] [port]
So for listening a port, -p is mandatory, and I tried the following command:
nc -l -p 9000
and It worked.
I am following this grpc tutorial and I haven't even been able to make it through the first step. The first step is to git clone the project and then run
cd examples
./gradlew installDist
I am hit with this stack trace
Downloading https://services.gradle.org/distributions/gradle-2.13-bin.zip
Exception in thread "main" java.net.UnknownHostException: services.gradle.org
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:668)
at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173)
at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1105)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:999)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1513)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
at org.gradle.wrapper.Download.download(Download.java:44)
at org.gradle.wrapper.Install$1.call(Install.java:61)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
I thought that was a proxy issue, so I took some inspiration from this post and opened up the file
gradle/wrapper/gradle-wrapper.properties
and added the lines
systemProp.http.proxyHost=<my proxy>
systemProp.http.proxyPort=<my port>
I also replaced distributionUrl line with this
distributionUrl=http\://services.gradle.org/distributions/gradle-2.13-bin.zip
That is, I switched https --> http.
After all of this, I am still getting the same stack trace.
Anybody have advice?
EDIT : I added a
gradle.properties
file in the home directory, and added the fields
systemProp.http.proxyHost
systemProd.http.proxyPort
and
systemProp.https.proxyHost
systemProp.https.proxyPort
but I still got the same error as before. HOWEVER, the build script appeared to stall on this line
Downloading https://services.gradle.org/distributions/gradle-2.13-bin.zip
For about 10 seconds or so, before failing. So... progress?
I had the same problem and finally found this solution after 2 hours...
Go to the file gradlew.bat in your project and change DEFAULT_JVM_OPTS variable as below:
set DEFAULT_JVM_OPTS=-Dhttp.proxyHost=YOUR_HOST -Dhttp.proxyPort=PORT -Dhttp.proxyUser=USERNAME -Dhttp.proxyPassword=PASSWORD -Dhttps.proxyHost=YOUR_HOST -Dhttps.proxyPort=PORT -Dhttps.proxyUser=USERNAME -Dhttps.proxyPassword=PASSWORD
then run gradlew clean build.
I don't know if it is an optimal solution, but what eventually worked for me was to replace
distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip
with
distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-bin.zip
Essentially upgrading the version of gradle I am grabbing.
I also added a global
~/.gradle/gradle.properties
In my home directory with all the proxy info I had previously declared. My attempt to build after doing this was unsuccessful, but I can't say for sure if doing this had zero impact.
I have IntelliJ and other development tools stopped working today.
IntelliJ says on start:
Cannot start internal HTTP server. Git integration, JavaScript
debugger and LiveEdit may operate with errors. Please check your
firewall settings and restart IntelliJ IDEA
Before this happened I was receiving strange errors on loopback connection on build which is now gone. Currently it says
Error:failed to create a child event loop
Gradle build says:
Protocol family unavaliable
Disabling firewall does not help.
UPDATE
IntelliJ log is full of messages like this:
Caused by: java.rmi.RemoteException: Cannot start maven service; nested exception is:
java.rmi.ConnectIOException: Exception creating connection to: localhost; nested exception is:
java.net.SocketException: Permission denied: connect
at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:165)
at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:71)
at org.jetbrains.idea.maven.server.RemoteObjectWrapper.getOrCreateWrappee(RemoteObjectWrapper.java:41)
at org.jetbrains.idea.maven.server.MavenServerManager$5.create(MavenServerManager.java:494)
at org.jetbrains.idea.maven.server.MavenServerManager$5.create(MavenServerManager.java:490)
at org.jetbrains.idea.maven.server.RemoteObjectWrapper.getOrCreateWrappee(RemoteObjectWrapper.java:41)
at org.jetbrains.idea.maven.server.MavenIndexerWrapper.getRemoteId(MavenIndexerWrapper.java:169)
at org.jetbrains.idea.maven.server.MavenIndexerWrapper.access$100(MavenIndexerWrapper.java:37)
at org.jetbrains.idea.maven.server.MavenIndexerWrapper$1.execute(MavenIndexerWrapper.java:64)
at org.jetbrains.idea.maven.server.RemoteObjectWrapper.perform(RemoteObjectWrapper.java:105)
... 39 more
Caused by: java.rmi.ConnectIOException: Exception creating connection to: localhost; nested exception is:
java.net.SocketException: Permission denied: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:631)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:342)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at com.intellij.execution.rmi.RemoteProcessSupport$3.compute(RemoteProcessSupport.java:256)
at com.intellij.execution.rmi.RemoteUtil.executeWithClassLoader(RemoteUtil.java:181)
at com.intellij.execution.rmi.RemoteProcessSupport.a(RemoteProcessSupport.java:252)
at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:164)
at org.jetbrains.idea.maven.server.MavenServerManager.create(MavenServerManager.java:162)
... 48 more
Caused by: java.net.SocketException: Permission denied: connect
at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at java.net.Socket.connect(Socket.java:538)
at java.net.Socket.<init>(Socket.java:434)
at java.net.Socket.<init>(Socket.java:211)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:148)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
... 57 more
UPDATE 2
I found the root of the problem: this was caused by proxy autoconfiguration. By some reason address of 127.0.0.1 was processing by proxy and was leading to the web page of proxy server. The addition of
function FindProxyForURL(url,host)
{
if( host == '127.0.0.1' ) {
return "DIRECT";
}
to wpad.dat helped but I still don't understand an entire effect. I have proxy for a long time and it was no causing such an effect previously.
So I think this is also somehow related with IPv6 or something.
I am trying to access a webpage on a Virtual Machine with Htmlunit/webclient etc. My code is doing just this for the time being.
When I run the program, I get the following error:
Exception in thread "main" org.apache.http.conn.HttpHostConnectException: Connection to https://www.google.com refused
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:158)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:149)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:121)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:573)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:425)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:776)
at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:152)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1439)
at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1358)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:307)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:373)
at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:358)
at autoPEC.main(autoPEC.java:7)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:649)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:375)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:148)
... 13 more
Problem: When I run the same piece of code on eclipse on my laptop(outside the Virtual Machine), the code runs fine without any error.
Can anyone explain why I am getting this on the Virtual Machine? Because the code seems to be good. Is there some security which is prevented my IDE on the VM from accessing the site or something else?my antivirus?
How can I access a website on my Virtual Machine just the way I am accessing it outside the VM?
I'm working on a java project in which cassandra is included in the repository itself. I'm having trouble getting it to run however, receiving the following error:
/Users/xxx/dev/xxxx/build/cassandra/bin/cassandra-cli -h localhost -p 9052 -f
/Users/xxx/dev/xxxx/schema.txt
return code: 0
stderr: org.apache.thrift.transport.TTransportException: java.net.ConnectException: Connection refused
at org.apache.thrift.transport.TSocket.open(TSocket.java:183)
at org.apache.thrift.transport.TFramedTransport.open(TFramedTransport.java:81)
at org.apache.cassandra.cli.CliMain.connect(CliMain.java:73)
at org.apache.cassandra.cli.CliMain.main(CliMain.java:249)
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at org.apache.thrift.transport.TSocket.open(TSocket.java:178)
... 3 more
Exception connecting to localhost/9052. Reason: Connection refused.
stdout: Not connected to a cassandra instance.
Not connected to a cassandra instance.
I've tried altering the port and the localhost hostname to 127.0.0.1 and 0.0.0.0 but this makes no difference really.
I'm using java version "1.7.0_71"
Any ideas would be appreciated, thanks
The issue was cassandra trying to start on a hostname that was not in my /etc/hosts file.
I found which hostname by running /Users/xxx/dev/xxxx/build/cassandra/bin/cassandra -f which gave better output as to what the issue was.