我正在尝试使用Windows 10上的IDEA 2017.1.4为Grails应用程序构建WAR文件。 我收到以下错误:
|Compiling 17 GSP files for package [AECommand]
.Error
|WAR packaging error: G:\Dropbox\thePlatform\AETN\aetn-dd-custom-commands\target\classes\gsp\views.properties (The requested operation cannot be performed on a file with a user-mapped section open)
Process finished with exit code 1
应用程序在IDEA中运行良好,在PowerShell中给出了同样的错误。它在我的MacPro上使用终端“grails war”命令运行并构建得很好,目前我无法使用该命令。
MacPro和Windows IDEA项目使用JDK7。
当我尝试使用JDK8在PowerShell中运行应用程序时,我得到了下面的错误,它确实有“不兼容的JVM?”信息:
Oct 24, 2017 6:45:17 AM org.springsource.loaded.jvm.JVM copyMethod
SEVERE: Problems copying method. Incompatible JVM?
java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springsource.loaded.jvm.JVM.copyMethod(JVM.java:134)
at org.springsource.loaded.ri.OriginalClassInvoker.createJavaMethod(OriginalClassInvoker.java:68)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlClassGetDeclaredMethods(ReflectiveInterceptor.java:151)
at org.codehaus.groovy.reflection.CachedClass$3$1.run(CachedClass.java:84)
at java.security.AccessController.doPrivileged(Native Method)
at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:81)
at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:79)
at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
at org.codehaus.groovy.reflection.CachedClass.getMethods(CachedClass.java:250)
at groovy.lang.MetaClassImpl.populateMethods(MetaClassImpl.java:343)
at groovy.lang.MetaClassImpl.fillMethodIndex(MetaClassImpl.java:293)
at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:3048)
at groovy.lang.ExpandoMetaClass.initialize(ExpandoMetaClass.java:483)
at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:176)
答案 0 :(得分:0)
有趣的是,将JAVA_HOME设置为JDK7并使用PowerShell解决了这个问题 - JAR已经构建完毕。