Ant编译项目运行出错:
2011-09-21 09:47:43,485 INFO [STDOUT] 2011-09-21 09:47:43,466 [http-0.0.0.0-18080-9] WARN com.infindo.appcreate.servlet.ExceptionHandler - Handle exception: org.springframework.web.bind.annotation.support.HandlerMethodInvocationException
2011-09-21 09:47:43,489 ERROR [STDERR] org.springframework.web.bind.annotation.support.HandlerMethodInvocationException: Failed to invoke handler method [public java.lang.String com.infindo.appcreate.action.front.FrontController.login(java.lang.String,java.lang.String,org.springframework.ui.ModelMap,org.springframework.web.bind.support.SessionStatus)]; nested exception is java.lang.IllegalStateException: No parameter name specified for argument of type [java.lang.String], and no parameter name information found in class file either.
该错误是因为如下原因引起的:
(引用 http://bigcat.easymorse.com/?p=472%0A)
在使用SpringMVC绑定基本类型(如String,Integer等)参数时,应通过@RequestParam注解指定具体的参数名称,否则,当源代码在非debug模式下编译后,运行时会引发HandlerMethodInvocationException异常,这是因为只有在debug模式下编译,其参数名称才存储在编译好的代码中。
解决办法有2个
1. 添加@RequestParam注解,代码如下:public void findsessions(HttpServletRequest request, ModelMap modelMap,HttpServletResponse response,@RequestParam String keys) { ……}
2. ant编译时以debug模式编译,脚本中增加 debug="true"
<javac
srcdir="${src.default}"
destdir="${project.dist.classes}"
debug="true"
deprecation="${compile.deprecation}"
optimize="${compile.optimize}"
verbose="${javac.verbose}"
fork="${javac.fork}" source="1.6" encoding="UTF-8">
<classpath refid="project.classpath"/>
</javac>
分享到:
相关推荐
介绍了如何通过ant进行java web工程的编译操作的详细配置
ant 编译jar包
Ant编译后的zookeeper源码 版本:zookeeper-release-3.4.11、apache-ant-1.9.14 可直接导入eclipse或idea
ant脚本编译出jar
使用Ant编译打包
作为apache下的一个编译工具,可以用来编译一些较大的java web项目,简单实用方便!
在网页后台,使用Ant编译项目多渠道自动打包app应用
Ant编译环境配置 文章《使用ant编译之签名问题》的相关资料。主要讲一些Ant编译问题。
App自动化之使用Ant编译项目多渠道打包[定义].pdf
Apache Ant,是一个将软件编译、测试、部署等步骤联系在一起加以自动化的一个工具,大多用于Java环境中的软件开发。由Apache软件基金会所提供。
NULL 博文链接:https://liuna718-163-com.iteye.com/blog/1859773
ant 管理整个项目的编译和运行
本文档中的内容多是从实际开发中总结出来的。 ANT 最佳实践 http://www.ossez.com/forum.php?mod=viewthread&tid=13460&fromuid=426
Ant 编译 多目录demo,同时编译多个目录的Ant demo代码。
适合在ant下进行编译的工具,以及一些checkstyle,方便实用
ant编译staf插件
在编译flex/java工程是采用Ant自动编译,将编译好的工程进行打包发布.
Android SDK 26以后ant编译错误解决办法(错误信息:taskdef A class needed by class com.android.ant.GetUiTargetTask) https://blog.csdn.net/xlyrh/article/details/107766878
直接使用flex的sdk生成swc文件,很繁琐,而且对于大项目来说,是个头痛的事情。ant在对java打包生成jar时,它优良的设计显露无疑,这里我们使用它,来生成swc,完成项目编译打包。
Ant编译打包android工程,签名,多渠道