Grails - 在CLASSPATH中找不到类“org.grails.tomcat.TomcatLoader”

时间:2010-01-24 20:06:44

标签: java eclipse google-app-engine grails sts-springsourcetoolsuite

Eclipse中的

grails run-app目前正在为我的Google App Engine / Grails测试应用程序提供以下例外:

Enhancing JDO classes
  [enhance] DataNucleus Enhancer (version 1.1.4) : Enhancement of classes
  [enhance] Jan 24, 2010 5:11:42 AM org.datanucleus.metadata.MetaDataManager loadClasses
  [enhance] SEVERE: Class "org.grails.tomcat.TomcatLoader" was not found in the CLASSPATH. Please check your specification and your CLASSPATH.
  [enhance] org.datanucleus.exceptions.ClassNotResolvedException: Class "org.grails.tomcat.TomcatLoader" was not found in the CLASSPATH. Please check your specification and your CLASSPATH.
  [enhance]     at org.datanucleus.JDOClassLoaderResolver.classForName(JDOClassLoaderResolver.java:250)
  [enhance]     at org.datanucleus.JDOClassLoaderResolver.classForName(JDOClassLoaderResolver.java:415)
  [enhance]     at org.datanucleus.metadata.MetaDataManager.loadClasses(MetaDataManager.java:379)
  [enhance]     at org.datanucleus.enhancer.DataNucleusEnhancer.getFileMetadataForInput(DataNucleusEnhancer.java:743)
  [enhance]     at org.datanucleus.enhancer.DataNucleusEnhancer.enhance(DataNucleusEnhancer.java:545)
  [enhance]     at org.datanucleus.enhancer.DataNucleusEnhancer.main(DataNucleusEnhancer.java:1252)
  [enhance]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  [enhance]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  [enhance]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  [enhance]     at java.lang.reflect.Method.invoke(Method.java:597)
  [enhance]     at com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:57)
  [enhance]     at com.google.appengine.tools.enhancer.Enhance.<init>(Enhance.java:60)
  [enhance]     at com.google.appengine.tools.enhancer.Enhance.main(Enhance.java:41)
  [enhance] DataNucleus Enhancer completed with success for 0 classes. Timings : input=487 ms, enhance=0 ms, total=487 ms. Consult the log for full details
  [enhance] DataNucleus Enhancer completed and no classes were enhanced. Consult the log for full details

使用Spring Tools Suite(STS)创建Grails项目然后安装app-engine插件“grails install-plugin app-engine”后出现此错误。之前,我安装了Grails项目正确运行的app-engine插件。

有什么想法吗?

3 个答案:

答案 0 :(得分:3)

您是否尝试过卸载Tomcat插件?它默认安装在新的应用程序中,但看起来在使用GAE插件时会导致问题。

答案 1 :(得分:0)

很可能,来自DataNucleus Enhancer的错误消息是欺骗性的。它可能找不到org.grails.tomcat.TomcatLoader的依赖类。在类路径中是否有grails TomcatLoader类的所有依赖库?我有类似的情况 - 错误消息不正确。

答案 2 :(得分:0)

您收到此错误的原因是尚未卸载tomcat插件。 执行以下步骤:

  1. cd app_directory
  2. grails list-plugins
  3. 您将看到完整的插件列表,底部将显示为您的应用安装的插件列表 记下tomcat version_number

    1. grails uninstall-plugin tomcat version_number
    2. tomcat插件现在已经消失,您将看不到Tomcat加载程序错误。我在尝试使用grails app-engine插件时遇到了类似的错误,经过上述步骤后它就消失了。