UnknownHostException error, building java grpc example - java

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.

Related

How do i solve this problem java.lang.NoClassDefFoundError: sun/security/ssl/HandshakeStateManager?

I'm currently working on a webservice using Netbeans 11.3 on a local Glassfish-server version 5.1.0
JDK/JRE version 1.8.0_221
When trying to post by using the webservice i receive the following error msg:
java.lang.NoClassDefFoundError: sun/security/ssl/HandshakeStateManager
at sun.security.ssl.Handshaker.init(Handshaker.java:282)
at sun.security.ssl.Handshaker.<init>(Handshaker.java:242)
at sun.security.ssl.ClientHandshaker.<init>(ClientHandshaker.java:160)
at sun.security.ssl.SSLSocketImpl.initHandshaker(SSLSocketImpl.java:1339)
at sun.security.ssl.SSLSocketImpl.doneConnect(SSLSocketImpl.java:700)
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:679)
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:463)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
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:1156)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1334)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1309)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:259)
I've tried changing both JDK and JRE using the PCs environment variables and in the IDE but i keep getting the same error msg.
I only found 1 more thread with a similar problem to mine:
java.lang.NoClassDefFoundError: sun/security/ssl/HandshakeStateManager
Where changing JDK to 1.8.0_221 resolved the issue.
Can anyone tell me why this isn't working or do you need any further information?
Thanks
I found a fix in this thread: JavaWeb java.lang.NoClassDefFoundError: sun/security/ssl/HelloExtension
"Had basically the same problem, eventually solved it with this solution here.
In your glassfish folder go to glassfish5/glassfish/modules/endorsed/ and open the grizzly-npn-bootstrap.jar file with winrar or your preferred unzipper.
Delete the sun folder and try running your program again."
I've been stuck with this for over a week and finally found this fix. Now using the post-function works!

How to fix java.net.UnknownHostException: npm.taobao.org when using Selenium through WebDriverManager

I am using Selenide version 5.3.1.
I created just sample project to open browser using open("https://www.google.com") method by Selenide.
This works fine and it automatically downloaded latest chrome driver binaries using webDriverManager.
Now If I am trying to run same sample project on another machine I am getting following error.
Can someone help to understand why I am getting this issue? I don't want to use add webdriver path using System.setproperties("key","value")
C:\New_Software\installedSoftwares\Java\jdk1.8.0_241\bin\java.exe -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:C:\Users\jaahmed\AppData\Local\JetBrains\IntelliJ IDEA 2019.2\lib\idea_rt.jar=63959:C:\Users\jaahmed\AppData\Local\JetBrains\IntelliJ IDEA 2019.2\bin" -Dfile.encoding=UTF-8 -classpath "C:\Users\jaahmed\AppData\Local\JetBrains\IntelliJ IDEA 2019.2\lib\idea_rt.jar;C:\Users\jaahmed\AppData\Local\JetBrains\IntelliJ IDEA 2019.2\plugins\testng\lib\testng-plugin.jar;C:\New_Software\installedSoftwares\Java\jdk1.8.0_241\jre\lib\charsets.jar;C:\New_Software\installedSoftwares\Java\jdk1.8.0_241\jre\lib\deploy.jar;C:\New_Software\installedSoftwares\Java\jdk1.8.0_241\jre\lib\ext\access-bridge-64.jar;C:\New_Software\installedSoftwares\Java\jdk1.8.0_241\jre\lib\ext\cldrdata.jar;C:\New_Software\installedSoftwares\Java\jdk1.8.0_241\jre\lib\ext\dnsns.jar;C:\New_Software\installedSoftwares\Java\jdk1.8.0_241\jre\lib\ext\jaccess.jar;C:\New_Software\installedSoftwares\Java\jdk1.8.0_241\jre\lib\ext\jfxrt.jar;C:\New_Software\installedSoftwares\Java\jdk1.8.0_241\jre\lib\ext\localedata.jar;C:\New_Software\installedSoftwares\Java\jdk1.8.0_241\jre\lib\ext\nashorn.jar;C:\New_Software\installedSoftwares\Java\jdk1.8.0_241\jre\lib\ext\sunec.jar;C:\New_Software\installedSoftwares\Java\jdk1.8.0_241\jre\lib\ext\sunjce_provider.jar;C:\New_Software\installedSoftwares\Java\jdk1.8.0_241\jre\lib\ext\sunmscapi.jar;C:\New_Software\installedSoftwares\Java\jdk1.8.0_241\jre\lib\ext\sunpkcs11.jar;C:\New_Software\installedSoftwares\Java\jdk1.8.0_241\jre\lib\ext\zipfs.jar;C:\New_Software\installedSoftwares\Java\jdk1.8.0_241\jre\lib\javaws.jar;C:\New_Software\installedSoftwares\Java\jdk1.8.0_241\jre\lib\jce.jar;C:\New_Software\installedSoftwares\Java\jdk1.8.0_241\jre\lib\jfr.jar;C:\New_Software\installedSoftwares\Java\jdk1.8.0_241\jre\lib\jfxswt.jar;C:\New_Software\installedSoftwares\Java\jdk1.8.0_241\jre\lib\jsse.jar;C:\New_Software\installedSoftwares\Java\jdk1.8.0_241\jre\lib\management-agent.jar;C:\New_Software\installedSoftwares\Java\jdk1.8.0_241\jre\lib\plugin.jar;C:\New_Software\installedSoftwares\Java\jdk1.8.0_241\jre\lib\resources.jar;C:\New_Software\installedSoftwares\Java\jdk1.8.0_241\jre\lib\rt.jar;C:\New_Software\Jenkins\.jenkins\workspace\testdelete\target\test-classes;C:\Users\jaahmed\.m2\repository\com\codeborne\selenide\5.3.1\selenide-5.3.1.jar;C:\Users\jaahmed\.m2\repository\org\seleniumhq\selenium\selenium-java\3.141.59\selenium-java-3.141.59.jar;C:\Users\jaahmed\.m2\repository\org\seleniumhq\selenium\selenium-api\3.141.59\selenium-api-3.141.59.jar;C:\Users\jaahmed\.m2\repository\org\seleniumhq\selenium\selenium-chrome-driver\3.141.59\selenium-chrome-driver-3.141.59.jar;C:\Users\jaahmed\.m2\repository\org\seleniumhq\selenium\selenium-edge-driver\3.141.59\selenium-edge-driver-3.141.59.jar;C:\Users\jaahmed\.m2\repository\org\seleniumhq\selenium\selenium-firefox-driver\3.141.59\selenium-firefox-driver-3.141.59.jar;C:\Users\jaahmed\.m2\repository\org\seleniumhq\selenium\selenium-ie-driver\3.141.59\selenium-ie-driver-3.141.59.jar;C:\Users\jaahmed\.m2\repository\org\seleniumhq\selenium\selenium-opera-driver\3.141.59\selenium-opera-driver-3.141.59.jar;C:\Users\jaahmed\.m2\repository\org\seleniumhq\selenium\selenium-remote-driver\3.141.59\selenium-remote-driver-3.141.59.jar;C:\Users\jaahmed\.m2\repository\org\seleniumhq\selenium\selenium-safari-driver\3.141.59\selenium-safari-driver-3.141.59.jar;C:\Users\jaahmed\.m2\repository\org\seleniumhq\selenium\selenium-support\3.141.59\selenium-support-3.141.59.jar;C:\Users\jaahmed\.m2\repository\org\apache\commons\commons-exec\1.3\commons-exec-1.3.jar;C:\Users\jaahmed\.m2\repository\com\google\guava\guava\25.0-jre\guava-25.0-jre.jar;C:\Users\jaahmed\.m2\repository\com\google\code\findbugs\jsr305\1.3.9\jsr305-1.3.9.jar;C:\Users\jaahmed\.m2\repository\org\checkerframework\checker-compat-qual\2.0.0\checker-compat-qual-2.0.0.jar;C:\Users\jaahmed\.m2\repository\com\google\errorprone\error_prone_annotations\2.1.3\error_prone_annotations-2.1.3.jar;C:\Users\jaahmed\.m2\repository\com\google\j2objc\j2objc-annotations\1.1\j2objc-annotations-1.1.jar;C:\Users\jaahmed\.m2\repository\org\codehaus\mojo\animal-sniffer-annotations\1.14\animal-sniffer-annotations-1.14.jar;C:\Users\jaahmed\.m2\repository\com\squareup\okhttp3\okhttp\3.11.0\okhttp-3.11.0.jar;C:\Users\jaahmed\.m2\repository\com\squareup\okio\okio\1.14.0\okio-1.14.0.jar;C:\Users\jaahmed\.m2\repository\net\lightbody\bmp\browsermob-core\2.1.5\browsermob-core-2.1.5.jar;C:\Users\jaahmed\.m2\repository\net\lightbody\bmp\littleproxy\1.1.0-beta-bmp-17\littleproxy-1.1.0-beta-bmp-17.jar;C:\Users\jaahmed\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.8.9\jackson-core-2.8.9.jar;C:\Users\jaahmed\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.8.9\jackson-databind-2.8.9.jar;C:\Users\jaahmed\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.8.9\jackson-annotations-2.8.9.jar;C:\Users\jaahmed\.m2\repository\dnsjava\dnsjava\2.1.8\dnsjava-2.1.8.jar;C:\Users\jaahmed\.m2\repository\org\slf4j\jcl-over-slf4j\1.7.25\jcl-over-slf4j-1.7.25.jar;C:\Users\jaahmed\.m2\repository\com\jcraft\jzlib\1.1.3\jzlib-1.1.3.jar;C:\Users\jaahmed\.m2\repository\io\netty\netty-all\4.0.51.Final\netty-all-4.0.51.Final.jar;C:\Users\jaahmed\.m2\repository\org\bouncycastle\bcprov-jdk15on\1.58\bcprov-jdk15on-1.58.jar;C:\Users\jaahmed\.m2\repository\org\bouncycastle\bcpkix-jdk15on\1.58\bcpkix-jdk15on-1.58.jar;C:\Users\jaahmed\.m2\repository\net\lightbody\bmp\mitm\2.1.5\mitm-2.1.5.jar;C:\Users\jaahmed\.m2\repository\org\testng\testng\7.0.0\testng-7.0.0.jar;C:\Users\jaahmed\.m2\repository\com\beust\jcommander\1.72\jcommander-1.72.jar;C:\Users\jaahmed\.m2\repository\org\slf4j\slf4j-log4j12\1.7.5\slf4j-log4j12-1.7.5.jar;C:\Users\jaahmed\.m2\repository\org\slf4j\slf4j-api\1.7.5\slf4j-api-1.7.5.jar;C:\Users\jaahmed\.m2\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar;C:\Users\jaahmed\.m2\repository\io\github\bonigarcia\webdrivermanager\3.8.0\webdrivermanager-3.8.0.jar;C:\Users\jaahmed\.m2\repository\commons-io\commons-io\2.6\commons-io-2.6.jar;C:\Users\jaahmed\.m2\repository\com\google\code\gson\gson\2.8.5\gson-2.8.5.jar;C:\Users\jaahmed\.m2\repository\org\apache\commons\commons-lang3\3.8.1\commons-lang3-3.8.1.jar;C:\Users\jaahmed\.m2\repository\org\apache\httpcomponents\httpclient\4.5.6\httpclient-4.5.6.jar;C:\Users\jaahmed\.m2\repository\org\apache\httpcomponents\httpcore\4.4.10\httpcore-4.4.10.jar;C:\Users\jaahmed\.m2\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar;C:\Users\jaahmed\.m2\repository\commons-codec\commons-codec\1.10\commons-codec-1.10.jar;C:\Users\jaahmed\.m2\repository\org\rauschig\jarchivelib\1.0.0\jarchivelib-1.0.0.jar;C:\Users\jaahmed\.m2\repository\org\apache\commons\commons-compress\1.18\commons-compress-1.18.jar;C:\Users\jaahmed\.m2\repository\org\jsoup\jsoup\1.11.3\jsoup-1.11.3.jar;C:\Users\jaahmed\AppData\Local\JetBrains\IntelliJ IDEA 2019.2\plugins\testng\lib\jcommander-1.27.jar" org.testng.RemoteTestNGStarter -usedefaultlisteners false -socket63958 #w#C:\New_Software\Temp\idea_working_dirs_testng.tmp -temp C:\New_Software\Temp\idea_testng.tmp
log4j:WARN No appenders could be found for logger (io.github.bonigarcia.wdm.WebDriverManager).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
io.github.bonigarcia.wdm.WebDriverManagerException: java.net.UnknownHostException: npm.taobao.org
at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:774)
at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:548)
at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:771)
at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:548)
at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:764)
at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:548)
at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:258)
at TestMe.testm(TestMe.java:14)
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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:133)
at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:584)
at org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:172)
at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46)
at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:804)
at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:145)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128)
at java.util.ArrayList.forEach(ArrayList.java:1257)
at org.testng.TestRunner.privateRun(TestRunner.java:770)
at org.testng.TestRunner.run(TestRunner.java:591)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:402)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:396)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:355)
at org.testng.SuiteRunner.run(SuiteRunner.java:304)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1180)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1102)
at org.testng.TestNG.runSuites(TestNG.java:1032)
at org.testng.TestNG.run(TestNG.java:1000)
at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:73)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
Caused by: java.net.UnknownHostException: npm.taobao.org
at java.net.InetAddress.getAllByName0(InetAddress.java:1281)
at java.net.InetAddress.getAllByName(InetAddress.java:1193)
at java.net.InetAddress.getAllByName(InetAddress.java:1127)
at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:112)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:373)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:394)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
at io.github.bonigarcia.wdm.HttpClient.execute(HttpClient.java:169)
at io.github.bonigarcia.wdm.WebDriverManager.getDriversFromMirror(WebDriverManager.java:1041)
at io.github.bonigarcia.wdm.ChromeDriverManager.getDrivers(ChromeDriverManager.java:82)
at io.github.bonigarcia.wdm.WebDriverManager.filterCandidateUrls(WebDriverManager.java:790)
at io.github.bonigarcia.wdm.WebDriverManager.downloadAndExport(WebDriverManager.java:566)
at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:545)
... 33 more
===============================================
Default Suite
Total tests run: 1, Passes: 0, Failures: 1, Skips: 0
===============================================
Process finished with exit code 0```
Following is the simple test method i am trying.
#Test
public void testme() {
open("https://www.google.com");
}
This error message...
io.github.bonigarcia.wdm.WebDriverManagerException: java.net.UnknownHostException: npm.taobao.org
...seems a connectivity issue.
As per the discussion in I am getting an error while executing the basic website launch using web driver manager
This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server (api.github.com)) ... trying again forcing to use cache
java.net.UnknownHostException: This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server (api.github.com)
The problem should be in your host or network (maybe DNS).
Solution
You need follow the below mentioned steps:
Try forcing the architecture including the line:
WebDriverManager.chromedriver().setup();
Incase you are using Maven (Gradle), delete the .m2 (MAVEN_HOME) sub-directory and rebuild the project.
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
(WindowsOS only) Use CCleaner tool to wipe off all the OS chores before and after the execution of your Test Suite.
(LinuxOS only) Free Up and Release the Unused/Cached Memory in Ubuntu/Linux Mint before and after the execution of your Test Suite.
If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
Take a System Reboot.
Execute your #Test as non-root user.

Gradle Daemon for Android Studio Project can't start

Okay, new to Android. Fresh install, Windows 10, basic template project with an empty activity. When I start the project it starts gradle sync and starts generating logs in my gradle home with the following error
org.gradle.api.UncheckedIOException: java.io.IOException: Unable to establish loopback connection
at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:43)
at org.gradle.internal.remote.internal.inet.SocketConnection.<init>(SocketConnection.java:60)
at org.gradle.internal.remote.internal.inet.SocketConnectCompletion.create(SocketConnectCompletion.java:39)
at org.gradle.launcher.daemon.server.DaemonTcpServerConnector$1.execute(DaemonTcpServerConnector.java:73)
at org.gradle.launcher.daemon.server.DaemonTcpServerConnector$1.execute(DaemonTcpServerConnector.java:69)
at org.gradle.internal.remote.internal.inet.TcpIncomingConnector$Receiver.run(TcpIncomingConnector.java:112)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Unable to establish loopback connection
at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:101)
at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:68)
at java.security.AccessController.doPrivileged(Native Method)
at sun.nio.ch.PipeImpl.<init>(PipeImpl.java:170)
at sun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:50)
at java.nio.channels.Pipe.open(Pipe.java:155)
at sun.nio.ch.WindowsSelectorImpl.<init>(WindowsSelectorImpl.java:127)
at sun.nio.ch.WindowsSelectorProvider.openSelector(WindowsSelectorProvider.java:44)
at java.nio.channels.Selector.open(Selector.java:227)
at org.gradle.internal.remote.internal.inet.SocketConnection$SocketInputStream.<init>(SocketConnection.java:142)
at org.gradle.internal.remote.internal.inet.SocketConnection.<init>(SocketConnection.java:58)
... 9 more
Caused by: java.net.SocketException: Permission denied: connect
at sun.nio.ch.Net.connect0(Native Method)
at sun.nio.ch.Net.connect(Net.java:454)
at sun.nio.ch.Net.connect(Net.java:446)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:648)
at java.nio.channels.SocketChannel.open(SocketChannel.java:189)
at sun.nio.ch.PipeImpl$Initializer$LoopbackConnector.run(PipeImpl.java:130)
at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:83)
... 19 more
I get the same error when I run the basic gradle command against the gradlew.bat file, but when I run set _JAVA_OPTIONS=-Djava.net.preferIPv4Stack=true first then it starts the daemon successfully. Question is, how do I use that information to make the gradle sync on the project work. I've tried adding -Djava.net.preferIPv4Stack=true to the gradle.properties file, tried adding set _JAVA_OPTIONS=-Djava.net.preferIPv4Stack=true to the projects gradle batch file, and now I'm out of options.
Okay, finally figured it out. I went to environment variables and set a _JAVA_OPTS user variable with -Djava.net.preferIPv4Stack=true as the value.

Maven not able to download dependencies using eclipse, proxy not working

I am trying to build a maven project using eclipse. My overall problem is Maven will not connect to the online Maven repository to collect the necessary artifacts needed to build the project. I have tried using numerous proxies, but get the following errors:
Caused by: java.io.IOException: unexpected end of stream on Connection{repo.maven.apache.org:443, proxy=HTTP # /101.96.11.44:95 hostAddress=101.96.11.44 cipherSuite=none protocol=http/1.1} (recycle count=0)
at com.squareup.okhttp.internal.http.HttpConnection.readResponse(HttpConnection.java:210)
at com.squareup.okhttp.Connection.makeTunnel(Connection.java:400)
at com.squareup.okhttp.Connection.upgradeToTls(Connection.java:229)
at com.squareup.okhttp.Connection.connect(Connection.java:159)
at com.squareup.okhttp.Connection.connectAndSetOwner(Connection.java:175)
at com.squareup.okhttp.OkHttpClient$1.connectAndSetOwner(OkHttpClient.java:120)
at com.squareup.okhttp.internal.http.HttpEngine.nextConnection(HttpEngine.java:330)
at com.squareup.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:319)
at com.squareup.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:241)
at com.squareup.okhttp.Call.getResponse(Call.java:271)
at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:228)
at com.squareup.okhttp.Call.getResponseWithInterceptorChain(Call.java:199)
at com.squareup.okhttp.Call.execute(Call.java:79)
at io.takari.aether.okhttp.OkHttpAetherClient.execute(OkHttpAetherClient.java:154)
at io.takari.aether.okhttp.OkHttpAetherClient.get(OkHttpAetherClient.java:100)
at io.takari.aether.connector.AetherRepositoryConnector$GetTask.resumableGet(AetherRepositoryConnector.java:600)
at io.takari.aether.connector.AetherRepositoryConnector$GetTask.run(AetherRepositoryConnector.java:453)
at io.takari.aether.connector.AetherRepositoryConnector.get(AetherRepositoryConnector.java:304)
... 48 more
Caused by: java.io.EOFException: \n not found: size=0 content=...
at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:200)
at com.squareup.okhttp.internal.http.HttpConnection.readResponse(HttpConnection.java:190)
... 65 more
I have also tried connecting to another network that is not my own and have had no success.
When I do not use a proxy, I get the following errors:
Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:980)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1363)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1391)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1375)
at com.squareup.okhttp.Connection.upgradeToTls(Connection.java:242)
at com.squareup.okhttp.Connection.connect(Connection.java:159)
at com.squareup.okhttp.Connection.connectAndSetOwner(Connection.java:175)
at com.squareup.okhttp.OkHttpClient$1.connectAndSetOwner(OkHttpClient.java:120)
at com.squareup.okhttp.internal.http.HttpEngine.nextConnection(HttpEngine.java:330)
at com.squareup.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:319)
at com.squareup.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:241)
at com.squareup.okhttp.Call.getResponse(Call.java:271)
at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:228)
at com.squareup.okhttp.Call.getResponseWithInterceptorChain(Call.java:199)
at com.squareup.okhttp.Call.execute(Call.java:79)
at io.takari.aether.okhttp.OkHttpAetherClient.execute(OkHttpAetherClient.java:154)
at io.takari.aether.okhttp.OkHttpAetherClient.get(OkHttpAetherClient.java:100)
at io.takari.aether.connector.AetherRepositoryConnector$GetTask.resumableGet(AetherRepositoryConnector.java:600)
at io.takari.aether.connector.AetherRepositoryConnector$GetTask.run(AetherRepositoryConnector.java:453)
at io.takari.aether.connector.AetherRepositoryConnector.get(AetherRepositoryConnector.java:304)
... 48 more
Caused by: java.io.EOFException: SSL peer shut down incorrectly
at sun.security.ssl.InputRecord.read(InputRecord.java:505)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:961)
... 67 more
The only solution that I have found is downloading the dependencies one by one from the Maven repository manually. Given that there are more than 100 dependencies left to install, I'd really prefer not to spend that much time getting this to work. If any other details need to be provided, I will be happy to do so.
Under Windows I resolved this problem by using mvn install in a command shell for my project.
Then I added/changed <localRepository> in the settings.xml of eclipse maven user settings to c:/users/ttt/.m2/repository where I found the downloaded dependencies.

ConnectException (timed out) running groovy Koans with gradle wrapper

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!

Categories

Resources