Grails 生成WebApp War文件-将忽略该参数的错误
我正在尝试在Tomcat7上运行一个项目,该项目需要一些插件,并且是用Grails编写的 使用命令grails prod war创建-war会导致一个错误,告诉我不支持[java.util.List]类型的参数 在何处以及如何查看哪些参数受支持以及为什么列表不受支持 包含错误的日志文件如下所示:Grails 生成WebApp War文件-将忽略该参数的错误,grails,Grails,我正在尝试在Tomcat7上运行一个项目,该项目需要一些插件,并且是用Grails编写的 使用命令grails prod war创建-war会导致一个错误,告诉我不支持[java.util.List]类型的参数 在何处以及如何查看哪些参数受支持以及为什么列表不受支持 包含错误的日志文件如下所示: | Loading Grails 2.4.1 | Configuring classpath | Configuring classpath. | Environment set to producti
| Loading Grails 2.4.1
| Configuring classpath
| Configuring classpath.
| Environment set to production
| Environment set to production.
| Environment set to production..
| Environment set to production...
| Environment set to production....
| Environment set to production.....
| Packaging Grails application
| Packaging Grails application.
| Packaging Grails application..
| Packaging Grails application...
| Packaging Grails application....
| Packaging Grails application.....
| Compiling 70 source files
| Warning The [listFullAccessResources] action in [VsGrantController] accepts a parameter of type [java.util.List]. Interface types and abstract class types are not supported as command objects. This parameter will be ignored.
List listFullAccessResources(VsUser loggedInUser, List resultsGoups) {
^
[groovyc] org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
[groovyc] General error during class generation: java.lang.NoClassDefFoundError: Unable to load class org.jets3t.service.impl.rest.httpclient.RestS3Service due to missing dependency org/apache/http/client/methods/HttpHead
[groovyc]
[groovyc] java.lang.RuntimeException: java.lang.NoClassDefFoundError: Unable to load class org.jets3t.service.impl.rest.httpclient.RestS3Service due to missing dependency org/apache/http/client/methods/HttpHead
[groovyc] at org.codehaus.groovy.control.CompilationUnit.convertUncaughtExceptionToCompilationError(CompilationUnit.java:1083)
VsGrantController.groovy如下所示
import org.apache.commons.lang.StringUtils
class VsGrantController {
def vsAuthenticateService
def vsGrantService
def index = { redirect(action:list,params:params) }
// the delete, save and update actions only accept POST requests
static allowedMethods = [delete:'POST', save:'POST', update:'POST']
List listFullAccessResources(VsUser loggedInUser, List resultsGoups) {
// labels user has full access to
def cLabels = VsLabel.createCriteria()
def resultsLabelsFullAccess = cLabels.listDistinct {
grants {
and {
permission {
eq("name", 'Full')
}
or {
eq("accessor", loggedInUser)
if(resultsGoups) {
or {
for (g in resultsGoups) {
eq("accessor", g)
}
}
}
}
}
}
order("name")
}
我对Grails/Groovy Tomcat WebApp的主题有些陌生
所以我希望这个问题不是很糟糕你的实际错误是
Unable to load class org.jets3t.service.impl.rest.httpclient.RestS3Service due to missing dependency org/apache/http/client/methods/HttpHead
您需要在类路径中包含httpclient.jar,将其更改为:
def List listFullAccessResources(VsUser loggedInUser, List resultsGoups)
警告将消失…警告接口类型和抽象类类型不支持作为命令对象。投诉,因为控制器操作具有List resultsGoups参数。这是不受支持的 您可以从隐式“params”映射或使用 像这样的
def listFullAccessResources(AccessResourcesCommand cmd) {
}
class AccessResourcesCommand {
Bar loggedInUser
List resultsGroups
}
谢谢你的快速回复。好的,如果我忽略警告并添加httpclient.jar-错误消息更改为:无法加载类org.jets3t.service.impl.rest.httpclient.RestS3Service,因为缺少依赖项org/apache/http/HttpRequestok还添加了httpcore.jar,修复了错误。。。但是警告仍然存在,或者在方法是内部控制器方法的情况下将其标记为私有。