1

起初(某天),我从命令行练习了 Moqui。现在我想从 Intellij IDEA 开始。所以我在我的项目目录中添加了 Moqui 框架,并在 runtime/lib 目录中添加了所有的 jar 文件。但是当我编译时,它会给我以下错误。

/org/moqui/impl/pollEmailServer.groovy Error:(27,1) Groovyc: Modifier 'static' not allowed here. 还会产生以下错误。

net.sf.ehcache.CacheException: Unable to load class net.sf.ehcache.store.DefaultElementValueComparator. Initial cause was net.sf.ehcache.store.DefaultElementValueComparator.<init>(net.sf.ehcache.config.CacheConfiguration) at net.sf.ehcache.util.ClassLoaderUtil.createNewInstance(ClassLoaderUtil.java:100) at net.sf.ehcache.config.ElementValueComparatorConfiguration.createElementComparatorInstance(ElementValueComparatorConfiguration.java:57) at net.sf.ehcache.Cache.<init>(Cache.java:797) at net.sf.ehcache.Cache.clone(Cache.java:2817) at net.sf.ehcache.Cache.clone(Cache.java:170) at net.sf.ehcache.CacheManager.cloneDefaultCache(CacheManager.java:1952) at net.sf.ehcache.CacheManager.addCacheIfAbsent(CacheManager.java:1934) at net.sf.ehcache.CacheManager$addCacheIfAbsent$1.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at org.moqui.impl.context.CacheFacadeImpl.initCache(CacheFacadeImpl.groovy:109) at org.moqui.impl.context.CacheFacadeImpl.getCacheImpl(CacheFacadeImpl.groovy:71) at org.moqui.impl.context.CacheFacadeImpl.getCache(CacheFacadeImpl.groovy:63) at org.moqui.context.CacheFacade$getCache.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at org.moqui.impl.context.renderer.FtlTemplateRenderer.init(FtlTemplateRenderer.groovy:42) at org.moqui.context.TemplateRenderer$init.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at org.moqui.impl.context.ResourceFacadeImpl.<init>(ResourceFacadeImpl.groovy:66) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77) at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:57) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190) at org.moqui.impl.context.ExecutionContextFactoryImpl.<init>(ExecutionContextFactoryImpl.groovy:182) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77) at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:57) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:186) at org.moqui.impl.webapp.MoquiContextListener.contextInitialized(MoquiContextListener.groovy:44) at net.winstone.core.WebAppConfiguration.<init>(WebAppConfiguration.java:782) at net.winstone.core.HostConfiguration.initWebApp(HostConfiguration.java:282) at net.winstone.core.HostConfiguration.addWebAppConfiguration(HostConfiguration.java:190) at net.winstone.core.HostConfiguration.<init>(HostConfiguration.java:111) at net.winstone.core.HostGroup.addHostConfiguration(HostGroup.java:115) at net.winstone.core.HostGroup.<init>(HostGroup.java:85) at net.winstone.Server.initialize(Server.java:122) at net.winstone.Server.start(Server.java:106) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at MoquiStart.main(MoquiStart.java:152) Caused by: java.lang.NoSuchMethodException: net.sf.ehcache.store.DefaultElementValueComparator.<init>(net.sf.ehcache.config.CacheConfiguration) at java.lang.Class.getConstructor0(Class.java:2849) at java.lang.Class.getConstructor(Class.java:1718) at net.sf.ehcache.util.ClassLoaderUtil.createNewInstance(ClassLoaderUtil.java:91) ... 56 more Error initializing webapp context: net.sf.ehcache.CacheException: Unable to load class net.sf.ehcache.store.DefaultElementValueComparator. Initial cause was net.sf.ehcache.store.DefaultElementValueComparator.<init>(net.sf.ehcache.config.CacheConfiguration) ERROR 25/08/14 18:51:20.625 [main]: Error during context startup for webapp webapp net.sf.ehcache.CacheException: Unable to load class net.sf.ehcache.store.DefaultElementValueComparator. Initial cause was net.sf.ehcache.store.DefaultElementValueComparator.<init>(net.sf.ehcache.config.CacheConfiguration) at net.sf.ehcache.util.ClassLoaderUtil.createNewInstance(ClassLoaderUtil.java:100) at net.sf.ehcache.config.ElementValueComparatorConfiguration.createElementComparatorInstance(ElementValueComparatorConfiguration.java:57) at net.sf.ehcache.Cache.<init>(Cache.java:797) at net.sf.ehcache.Cache.clone(Cache.java:2817) at net.sf.ehcache.Cache.clone(Cache.java:170) at net.sf.ehcache.CacheManager.cloneDefaultCache(CacheManager.java:1952) at net.sf.ehcache.CacheManager.addCacheIfAbsent(CacheManager.java:1934) at net.sf.ehcache.CacheManager$addCacheIfAbsent$1.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at org.moqui.impl.context.CacheFacadeImpl.initCache(CacheFacadeImpl.groovy:109) at org.moqui.impl.context.CacheFacadeImpl.getCacheImpl(CacheFacadeImpl.groovy:71) at org.moqui.impl.context.CacheFacadeImpl.getCache(CacheFacadeImpl.groovy:63) at org.moqui.context.CacheFacade$getCache.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at org.moqui.impl.context.renderer.FtlTemplateRenderer.init(FtlTemplateRenderer.groovy:42) at org.moqui.context.TemplateRenderer$init.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at org.moqui.impl.context.ResourceFacadeImpl.<init>(ResourceFacadeImpl.groovy:66) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77) at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:57) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190) at org.moqui.impl.context.ExecutionContextFactoryImpl.<init>(ExecutionContextFactoryImpl.groovy:182) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77) at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:57) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:186) at org.moqui.impl.webapp.MoquiContextListener.contextInitialized(MoquiContextListener.groovy:44) at net.winstone.core.WebAppConfiguration.<init>(WebAppConfiguration.java:782) at net.winstone.core.HostConfiguration.initWebApp(HostConfiguration.java:282) at net.winstone.core.HostConfiguration.addWebAppConfiguration(HostConfiguration.java:190) at net.winstone.core.HostConfiguration.<init>(HostConfiguration.java:111) at net.winstone.core.HostGroup.addHostConfiguration(HostGroup.java:115) at net.winstone.core.HostGroup.<init>(HostGroup.java:85) at net.winstone.Server.initialize(Server.java:122) at net.winstone.Server.start(Server.java:106) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at MoquiStart.main(MoquiStart.java:152)

我想我做错了什么。您能否建议我在 Intellij IDE 中添加 Moqui 框架的正确方法是什么?

4

1 回答 1

0

在 IntelliJ IDEA 中设置的最简单方法是基于 Gradle 构建文件创建一个新项目(IntelliJ 现在支持这一点)。

发生此特定错误是因为 framework/src/main/resources 目录中的文件只是类路径资源,应该按原样复制到 JAR 中,而不是编译。这个 groovy 文件是一个脚本,旨在在运行时解释,而不是提前编译。

于 2014-08-27T04:57:31.340 回答