当前位置: 首页 > 知识库问答 >
问题:

Cloud Foundry无法部署grails应用程序[UnknownHostException]

夔庆
2023-03-14

我最近试图在cloud foundry上部署一个Grails项目,但在执行“Grails cf-push”时出现了以下错误

Environment set to production.....
Error Error executing script_ CfPush: org.springframework.web.client.ResourceAccessException: I/O error on POST request for "http://api.cloudfoundry.com/users/username@gmail.com/tokens":api.cloudfoundry.com; nested exception is java.net.UnknownHostException: api.cloudfoundry.com (Use --stacktrace to see the full trace)

对于“grails cf-push--stacktrace”:

Error Error executing script_ CfPush: org.springframework.web.client.ResourceAccessException: I/O error: api.cloudfoundry.com; nested exception is java.net.UnknownHostException: api.cloudfoundry.com (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
org.springframework.web.client.ResourceAccessException: I/O error: api.cloudfoundry.com; nested exception is java.net.UnknownHostException: api.cloudfoundry.com
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:461)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:409)
at org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:287)
at org.cloudfoundry.client.lib.CloudFoundryClient.login(CloudFoundryClient.java:210)
at ClientWrapper.methodMissing(_CfCommon_groovy:536)
at _CfCommon_groovy$_run_closure5.doCall(_CfCommon_groovy:110)
at _CfCommon_groovy$_run_closure5.call(_CfCommon_groovy)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at CfPush$_run_closure1.doCall(CfPush:40)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
at java_util_concurrent_Callable$call.call(Unknown Source)
at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
at java_util_concurrent_Callable$call.call(Unknown Source)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at java_util_concurrent_Callable$call.call(Unknown Source)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:591)
at gant.Gant.executeTargets(Gant.groovy:590)
Caused by: java.net.UnknownHostException: api.cloudfoundry.com
at grails.plugin.cloudfoundry.GrailsHttpRequestFactory$1.intercept(GrailsHttpRequestFactory.java:91)
at $java.net.HttpURLConnection$$EnhancerByCGLIB$$7c6bfa30.connect(<generated>)
at grails.plugin.cloudfoundry.GrailsHttpRequest.executeInternal(GrailsHttpRequest.java:75)
at grails.plugin.cloudfoundry.GrailsHttpRequest.executeInternal(GrailsHttpRequest.java:89)
at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:49)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:446)
... 30 more

就在几个月前,一切都很顺利,但我不得不在一段时间内停止这个项目的工作。当我回到it领域时,我意识到再也不可能像以前那样部署它了。

我假设我需要升级我的云铸造插件,所以在一天的工作中,我升级了整个Groovy/Grails环境:

“VMC信息”告诉我“api.cloudfoundry.com”不存在。我没主意了。地址改了吗?有没有什么按部就班的方法来解决它,还是这里发生了其他事情?

共有1个答案

艾泉
2023-03-14

“api.cloudfoundry.com”是hosted Cloud Foundry v1的URL,该v1已不存在。“CloudFoundry.com”已经被http://run.pivotal.io所取代,这就是Cloud Foundry V2。

Cloud Foundry Grails插件尚未更新以支持CF v2。您应该使用“CF”CLI与CF交互,而不是使用Grails插件脚本。参见http://docs.cloudfoundry.com/docs/using/management-apps/cf/index.html和http://docs.cloudfoundry.com/docs/using/deploying-apps/jvm/index.html。

 类似资料:
  • “grails cf-ush”会导致下面列出的错误。有没有办法使用云铸造插件“重新开始”。我不希望在MySQL数据库和MongoDB数据库中丢失我的测试数据。 严重:错误监听器开始2012年5月18日下午6:31:26组织。阿帕奇。卡塔琳娜。果心StandardContext启动严重:由于之前的错误,Context[]启动失败2012年5月18日下午6:31:26组织。阿帕奇。卡塔琳娜。加载器。W

  • 我无法在Tomcat 6上部署Grails 2.2.4应用程序。我尝试了新安装的tomcat,甚至我的应用程序的旧版本(以前运行过)。 此异常在一分钟后引发。在tomcat启动后: 我真的不知道从哪里开始修理它-/

  • 我可以用cloud foundry grails插件和cf-push将我的grails 2.0.3应用程序部署到云中,一切都很好。 现在,我想使用STS/eclipse cloud foundry扩展来部署eclipse(而不是使用grails命令cf-push!)并在服务器视图中查看服务器实例等等。

  • 我有一个Grails(2.5.3版)应用程序,当我通过选项:要部署的WAR文件在Tomcat中部署时,选择WAR文件,会出现以下错误。如果我尝试一个更简单的应用程序(大小、复杂度等),它运行得很好。 但是,如果在从manager运行应用程序时手动将war文件的内容复制到Tomcat路径:pathTomcat/webapps/myApplication,则效果良好。出现任何错误。 错误: Grail

  • 我试图通过更新apache-tomcat-8.0.39\conf\catalina.properties在带有选项strict_servlet_compliance=true的Tomcat 8.0.39上部署一个应用程序,但一旦我这样做,我的应用程序部署就失败了。也就是说,我开始出现错误:SEVERE[localhost-startStop-1]org.apache.tomcat.util.dig

  • 我的android应用程序没有正确构建和部署。当启动一个新实例时,它会将我的应用程序启动到我的物理移动设备上,并且我能够在Visual Studio中进行调试。但现在它不会将应用程序启动到移动设备,而且当我手动运行应用程序时,它也不会在Visual Studio中调试。这个项目有可移植的类,并且正在使用Xamarin.Forms。 我确实更改了对AndroidManifest.xml的构建操作。