开发者

Grails - Class "org.grails.tomcat.TomcatLoader" was not found in the CLASSPATH

开发者 https://www.devze.com 2022-12-18 11:08 出处:网络
grails run-app from within开发者_开发技巧 Eclipse is currently giving me the exception below for my Google App Engine/Grails test application:

grails run-app from within开发者_开发技巧 Eclipse is currently giving me the exception below for my Google App Engine/Grails test application:

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

I get this error after creating a Grails project with Spring Tools Suite (STS) and then installing the app-engine plugin "grails install-plugin app-engine". Before, I install the app-engine plugin the Grails project runs correctly.

Any ideas?


Have you tried uninstalling the Tomcat plugin? It is installed by default in a new app but looks like it causes issues when you use the GAE plugin.


More than likely, the error message from DataNucleus Enhancer is deceiving. It probably can't find the dependent classes of org.grails.tomcat.TomcatLoader. Are all the dependent libs of the grails TomcatLoader class in your classpath? I had a similar situation -- the error message was incorrect.


The reason why you are getting this error is that the tomcat plugin has not been uninstalled. Do the following steps :

  1. cd app_directory
  2. grails list-plugins

You will see a whole list of plugins and at the bottom will be a list of plugins installed for your app Note down the tomcat version_number

  1. grails uninstall-plugin tomcat version_number

The tomcat plugin will now be gone and you will not see the Tomcat loader error. I was getting a similar error when trying to use the grails app-engine plugin and it went away after the above steps.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号