CloudFoundry Grails - 无法检测java编译器,请确保您使用的是JDK而不是JRE

时间:2015-02-16 12:39:05

标签: java grails groovy cloudfoundry

我有一些非常奇怪的问题,当我将grails应用程序部署到CloudFOundry(run.pivotal.io)时,我得到了奇怪的例外。

2015-02-16T11:12:18.000+00:00 [App/0] OUT at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:370)
2015-02-16T11:12:18.000+00:00 [App/0] OUT at org.vertx.java.platform.impl.java.JavaVerticleFactory.createVerticle(JavaVerticleFactory.java:51)
2015-02-16T11:12:18.000+00:00 [App/0] OUT java.lang.RuntimeException: Compilation failed
2015-02-16T11:12:18.000+00:00 [App/0] OUT vert.x-eventloop-thread-2] ERROR impl.DefaultContext - Unhandled exception
2015-02-16T11:12:18.000+00:00 [App/0] OUT ... 7 more
2015-02-16T11:12:18.000+00:00 [App/0] OUT Caused by: java.lang.RuntimeException: Unable to detect java compiler, make sure you're using a JDK not a JRE!
2015-02-16T11:12:18.000+00:00 [App/0] OUT at java.lang.Thread.run(Thread.java:745)
2015-02-16T11:12:18.000+00:00 [App/0] OUT at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)
2015-02-16T11:12:18.000+00:00 [App/0] OUT at org.vertx.java.platform.impl.java.CompilingClassLoader.<init>(CompilingClassLoader.java:108)
2015-02-16T11:12:18.000+00:00 [App/0] OUT at org.vertx.java.platform.impl.DefaultPlatformManager$21.run(DefaultPlatformManager.java:1740)
2015-02-16T11:12:06.000+00:00 [App/0] OUT Configuring Spring Security Core ...
2015-02-16T11:12:00.000+00:00 [App/0] OUT [CONTAINER] udAutoReconfigurationApplicationContextInitializer INFO Adding cloud service auto-reconfiguration to ApplicationContext
2015-02-16T11:11:58.000+00:00 [App/0] OUT [CONTAINER] org.apache.tomcat.util.digester.Digester INFO TLD skipped. URI: http://www.springframework.org/tags/form is already defined
2015-02-16T11:11:58.000+00:00 [App/0] OUT [CONTAINER] org.apache.tomcat.util.digester.Digester INFO TLD skipped. URI: http://www.springframework.org/tags is already defined
那是什么? 在BootStrap.groovy我定义了 -

def init = { servletContext ->
vertxPlatformManager = PlatformLocator.factory.createPlatformManager()
URL[] classpath = [new File("src/java/pizzaVerticles/src/vertx/java/hello").toURI().toURL()]
vertxPlatformManager.deployVerticle("RateFetcherVerticleFirebase.java", null, classpath, 1, null, null)
vertxPlatformManager.deployVerticle("Server.java", null, classpath, 1, null, null)
vertxPlatformManager.deployVerticle("SocialTweety.java", null, classpath, 1, null, null)
}

还有其他一些东西,但它们是数据库的记录,有效。

首先,我遇到了一些问题,我发现资源未找到错误:Server.java

错误是针对所有三个java文件。然后我将这些java文件放在web-app文件夹中,在创建war时它也会将它们拾起来。但现在我有这个奇怪的例外。用Google搜索并找不到任何相关内容。我非常感谢你的帮助,谢谢!

我对CloudFoundry很新。应用程序在grails,vertx上运行,并使用gradle构建并部署到CF.它在本地运行时工作正常。

1 个答案:

答案 0 :(得分:0)

尝试运行本教程(http://docs.cloudfoundry.org/buildpacks/java/gsg-grails.html),看看它是否先工作,然后尝试找出你的工作不起作用。