【问题标题】:Deployment error Could not create a new instance of class [SearchableGrailsPlugin]!部署错误 无法创建类 [SearchableGrailsPlugin] 的新实例!
【发布时间】:2013-05-27 12:47:47
【问题描述】:

当我尝试部署我的 war 文件时,这个错误已经有一段时间了。我尝试搜索,但似乎没有任何帮助。当我在我的系统上的 tomcat 上部署时,war 文件有效,但当我在另一个系统上部署时,我收到此错误:

    SEVERE: Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [SearchableGrailsPlugin]!
    at java.lang.Thread.run(Unknown Source)
Caused by: org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [SearchableGrailsPlugin]!

【问题讨论】:

  • 您使用的是什么版本的 Grails,构建和部署系统上的 Tomcat 和 Java 是什么版本?
  • Apache Tomcat/6.0.37 JVM 版本 1.6.0_33-b05 Grails 版本 1.3.5 用于部署系统。 (Windows 7 机器)。用于构建系统的 Apache Tomcat/6.0.37 JVM 版本 1.7.0_03-b05 Grails 版本 1.3.5。 (Ubuntu)。这可能是问题吗?我会检查并回来

标签: tomcat grails war


【解决方案1】:

您的评论表明您在构建机器上使用 Java 7,但在部署机器上使用 Java 6。这可能是问题的根源,如果你想在 Java 6 上部署,那么你也需要在 Java 6 上构建。

如果这是纯 Java,您可以在 Java 7 javac 中使用 -source 1.6 -target 1.6 -bootclasspath ... 选项,但在 Grails 中,这在构建机制中有些隐藏,到目前为止,最简单的方法是使用 Java 版本构建。而不是您将部署的那个(即,可以在 6 上构建并在 7 上部署,但反之则不行)。

【讨论】:

  • 非常感谢,它现在正在工作。我觉得自己很愚蠢,反正我是 grails 的新手。
猜你喜欢
  • 2014-07-25
  • 1970-01-01
  • 2016-12-03
  • 1970-01-01
  • 2021-04-12
  • 1970-01-01
  • 2011-09-09
  • 2015-02-20
  • 2023-02-23
相关资源
最近更新 更多