我正在尝试在Intellij Idea中运行现有的Grails项目。该项目将使用grails run-app
从命令行运行,但是当我尝试从Intellij中运行项目时,我收到错误
java.lang.NoClassDefFoundError: org/springframework/web/filter/GenericFilterBean
GenericFilterBean类存在于位于C:\ grails-2.4.3 \ lib \ org.springframework \ spring-web \ jars的grails目录中,我还试图将Jar添加为模块的依赖项在项目结构内(以确保它包含在类路径中)。 我不明白为什么项目将从命令行运行但在Intellij中失败。
我使用的是Grails版本2.4.3和Java 1.8。
有没有人对为什么会这样做有任何想法?
2015-07-20 12:33:46,752 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener - Error initializing the application: org/springframework/web/filter/GenericFilterBean
java.lang.NoClassDefFoundError: org/springframework/web/filter/GenericFilterBean
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethods(Class.java:1975)
at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
at SpringSecurityCoreGrailsPlugin$_closure2.doCall(SpringSecurityCoreGrailsPlugin.groovy:209)
at grails.spring.BeanBuilder.invokeBeanDefiningClosure(BeanBuilder.java:754)
at grails.spring.BeanBuilder.beans(BeanBuilder.java:584)
at grails.spring.BeanBuilder.invokeMethod(BeanBuilder.java:527)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.springframework.web.filter.GenericFilterBean
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 21 more
Error |
Forked Grails VM exited with error
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=256m; support was removed in 8.0
Process finished with exit code 1