初始化类路径时出错:找不到与 services.gradle.org 匹配的主题备用 DNS 名称。 -> 运行 grails 3.0.1 应用程序时
Posted
技术标签:
【中文标题】初始化类路径时出错:找不到与 services.gradle.org 匹配的主题备用 DNS 名称。 -> 运行 grails 3.0.1 应用程序时【英文标题】:Error initializing classpath: No subject alternative DNS name matching services.gradle.org found. -> when running grails 3.0.1 app 【发布时间】:2015-06-17 05:29:30 【问题描述】:我在工作中创建并运行了一个 grails 3.0.1 应用程序,但无法在我的个人计算机上运行它。我对 grails 3.0.1(通过 gvm)采用了相同的安装方法。问题似乎出在 gradle 上,因为 grails create-app 运行良好。我也可以使用 gradle assemble 编译应用程序,但无法运行该应用程序。我正在使用 gradle 2.3。
完整的错误如下:
Error Error initializing classpath: No subject alternative DNS name matching services.gradle.org found.
java.security.cert.CertificateException: No subject alternative DNS name matching services.gradle.org found.
at sun.security.util.HostnameChecker.matchDNS(HostnameChecker.java:191)
at sun.security.util.HostnameChecker.match(HostnameChecker.java:93)
at sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:347)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:203)
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:126)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1428)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:209)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:901)
at sun.security.ssl.Handshaker.process_record(Handshaker.java:837)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1023)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1332)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1359)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1343)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1301)
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.tooling.internal.consumer.DistributionFactory$ProgressReportingDownload.download(DistributionFactory.java:177)
at org.gradle.wrapper.Install$1.call(Install.java:59)
at org.gradle.wrapper.Install$1.call(Install.java:46)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:46)
at org.gradle.tooling.internal.consumer.DistributionFactory$ZippedDistribution$1.call(DistributionFactory.java:122)
at org.gradle.tooling.internal.consumer.DistributionFactory$ZippedDistribution$1.call(DistributionFactory.java:116)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
【问题讨论】:
【参考方案1】:gradle/wrapper/gradle-wrapper.properties
改一下:
-来自:distributionUrl=https\://services.gradle.org/distributions/gradle-2.3-all.zip
-to:distributionUrl=http://services.gradle.org/distributions/gradle-2.3-all.zip
【讨论】:
【参考方案2】:好像https://services.gradle.org/
的certificate is messed up
作为临时解决方法,您可以通过 http 而不是 https 下载 gradle 包装器。为此,您必须修改 grails 包装器配置。我编辑了build.gradle
task wrapper(type: Wrapper)
gradleVersion = gradleWrapperVersion
distributionUrl = 'http://services.gradle.org/distributions/gradle-2.3-bin.zip'
然后通过发出命令生成它:gradle wrapper
在此之后grails run-app
应该可以工作了。
【讨论】:
以上是关于初始化类路径时出错:找不到与 services.gradle.org 匹配的主题备用 DNS 名称。 -> 运行 grails 3.0.1 应用程序时的主要内容,如果未能解决你的问题,请参考以下文章
错误:无法写入字节码。该系统找不到指定的路径。 (os error 3). 编译基板节点模板时出错
在 android 中使用 MVVM 设计模式时出错找不到符号类 ViewModel
Symfony4加载类自定义文件夹时出错“预计找到类...但是找不到它”