玩! Framework 1.2部署错误:NoClassDefFoundError:org.codehaus.groovy.reflection.ReflectionCache

时间:2014-05-27 13:46:16

标签: java groovy playframework playframework-1.x

我正在玩一场戏!具有以下依赖关系的服务器中的框架1.2.7:

# Application dependencies

require:
    - play 1.2.7
    - play -> secure
    - play -> crud
    - play -> press 1.0.36
    - localModule -> YoutubeVideosCRUD 0.2

repositories: 
    - local repo:
        type: local
        artifact: "${application.path}/local-repo/[module]-[revision].zip"
        contains:
            - localModule -> *

由于我不是服务器的root用户,我已经在我的应用程序的sibbling目录中复制并解压缩了play-1.2.7.zip,然后创建了一个这样的软件,代表/var/www/clients/[..]/web/Application

ln -s /var/www/clients/[..]/web/play-1.2.7/play play

当我运行./play start --%server时,我在日志中得到以下输出:

10:27:19,372 INFO  ~ Starting /var/www/clients/[...]/web/Application
10:27:19,373 INFO  ~ Module secure is available (/var/www/clients/[...]/web/play-1.2.7/modules/secure)
10:27:19,373 INFO  ~ Module press is available (/var/www/clients/[...]/web/play-1.2.7/modules/press-1.0.36)
10:27:19,373 INFO  ~ Module crud is available (/var/www/clients/[...]/web/play-1.2.7/modules/crud)
10:27:19,373 INFO  ~ Module YoutubeVideosCRUD is available (/var/www/clients/[...]/web/Application/modules/YoutubeVideosCRUD-0.2)
10:27:20,595 INFO  ~ Precompiling ...
10:27:29,165 ERROR ~ Cannot start in PROD mode with errors
java.lang.NoClassDefFoundError: org.codehaus.groovy.reflection.ReflectionCache
   at java.lang.Class.initializeClass(libgcj.so.10)
   at org.codehaus.groovy.runtime.dgmimpl.NumberNumberMetaMethod.<clinit>(NumberNumberMetaMethod.java:90)
   at java.lang.Class.initializeClass(libgcj.so.10)
   at java.lang.Class.initializeClass(libgcj.so.10)
   at java.lang.Class.newInstance(libgcj.so.10)
   at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.createMetaMethodFromClass(MetaClassRegistryImpl.java:212)
   at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:86)
   at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:61)
   at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:29)
   at java.lang.Class.initializeClass(libgcj.so.10)
   at org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:49)
   at java.lang.Class.initializeClass(libgcj.so.10)
   at groovy.lang.GroovyObjectSupport.<init>(GroovyObjectSupport.java:32)
   at groovy.lang.Binding.<init>(Binding.java:34)
   at groovy.lang.GroovyShell.<init>(GroovyShell.java:62)
   at play.templates.GroovyTemplate.<clinit>(GroovyTemplate.java:77)
   at java.lang.Class.initializeClass(libgcj.so.10)
   at play.templates.TemplateLoader.load(TemplateLoader.java:78)
   at play.templates.TemplateLoader.scan(TemplateLoader.java:222)
   at play.templates.TemplateLoader.scan(TemplateLoader.java:237)
   at play.templates.TemplateLoader.scan(TemplateLoader.java:237)
   at play.templates.TemplateLoader.getAllTemplate(TemplateLoader.java:205)
   at play.Play.preCompile(Play.java:608)
   at play.Play.init(Play.java:304)
   at play.server.Server.main(Server.java:162)

(目录的某些部分已被剥离)

我似乎无法找到正在发生的事情。我发现[https://stackoverflow.com/a/20691234/260389]

A NoClassDefFoundError specifies that a class was available during compile time, but missing during runtime.

但我似乎无法将其与我的问题的解决方案联系起来。

感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

确定!我发现了这个问题。问题是我们使用的java编译器是java 5的GNU编译器。我为 sun java 7 更改了它,它就像一个魅力。