如何在Grails中配置多部分?

如何在Grails中配置多部分?,grails,multipart,Grails,Multipart,我在Grails应用程序中使用Servlet3.0和。当我在Glassfish中运行应用程序时,当安全插件在请求中查找访问令牌时,会引发以下异常: java.lang.IllegalStateException: Request.getParts is called without multipart configuration. Either add a @MultipartConfig to the servlet, or a multipart-config element to web.

我在Grails应用程序中使用Servlet3.0和。当我在Glassfish中运行应用程序时,当安全插件在请求中查找访问令牌时,会引发以下异常:

java.lang.IllegalStateException: Request.getParts is called without multipart configuration. Either add a @MultipartConfig to the servlet, or a multipart-config element to web.xml
at org.apache.catalina.connector.Request.checkMultipartConfiguration(Request.java:4533)
at org.apache.catalina.connector.Request.getParts(Request.java:4539)
at org.apache.catalina.connector.RequestFacade.getParts(RequestFacade.java:1086)
at javax.servlet.http.HttpServletRequestWrapper.getParts(HttpServletRequestWrapper.java:375)
at javax.servlet.http.HttpServletRequestWrapper.getParts(HttpServletRequestWrapper.java:375)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaBeanProperty.getProperty(MetaBeanProperty.java:60)
at groovy.lang.MetaBeanProperty$getProperty.call(Unknown Source)
at org.codehaus.groovy.grails.plugins.web.ServletsGrailsPluginSupport$_enhanceServletApi_closure1.doCall(ServletsGrailsPluginSupport.groovy:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaMethod.invoke(ClosureMetaMethod.java:81)
at groovy.lang.ExpandoMetaClass.getProperty(ExpandoMetaClass.java:1161)
at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:174)
at org.codehaus.groovy.runtime.callsite.PojoMetaClassGetPropertySite.getProperty(PojoMetaClassGetPropertySite.java:33)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:293)
at grails.plugin.springsecurity.rest.token.bearer.BearerTokenReader.findToken(BearerTokenReader.groovy:47)
我必须在哪里放置多部分配置

我没有上传文件,所以我想我不能使用注释。但是Grails中也没有web.xml

我正在使用Grails2.5.0和GlassFish 4.1


提前谢谢

显示导致此错误的请求日志我怀疑请求日志是否有帮助。简言之,在本例中,它是一个带有一些表单数据的HTTPPOST请求,但对于其他请求也会引发异常。我知道引发异常的原因,但我不知道将多部分配置放置在何处。也许我必须在Config.groovy中添加一些东西,但我没有找到任何相关文档。我昨天发现可以生成web.xml模板,但这是预期的配置方式吗?