- 浏览: 3405678 次
- 性别:
- 来自: 珠海
文章分类
- 全部博客 (1633)
- Java (250)
- Android&HTML5 (111)
- Struts (10)
- Spring (236)
- Hibernate&MyBatis (115)
- SSH (49)
- jQuery插件收集 (55)
- Javascript (145)
- PHP (77)
- REST&WebService (18)
- BIRT (27)
- .NET (7)
- Database (105)
- 设计模式 (16)
- 自动化和测试 (19)
- Maven&Ant (43)
- 工作流 (36)
- 开源应用 (156)
- 其他 (16)
- 前台&美工 (119)
- 工作积累 (0)
- OS&Docker (83)
- Python&爬虫 (28)
- 工具软件 (157)
- 问题收集 (61)
- OFbiz (6)
- noSQL (12)
最新评论
-
HEZR曾嶸:
你好博主,这个不是很理解,能解释一下嘛//左边+1,上边+1, ...
java 两字符串相似度计算算法 -
天使建站:
写得不错,可以看这里,和这里的这篇文章一起看,有 ...
jquery 遍历对象、数组、集合 -
xue88ming:
很有用,谢谢
@PathVariable映射出现错误: Name for argument type -
jnjeC:
厉害,困扰了我很久
MyBatis排序时使用order by 动态参数时需要注意,用$而不是# -
TopLongMan:
非常好,很实用啊。。
PostgreSQL递归查询实现树状结构查询
关于spring java.lang.IllegalArgumentException: Name for argument type [java.lang.String] 的错误 http://blog.csdn.net/liuguanghaoputin/article/details/8695600
Name for argument type [java.lang.String] not available http://m.blog.csdn.net/blog/kouwoo/42869779
SpringMVC强大的数据绑定(2)——第六章 注解式控制器详解——跟着开涛学SpringMVC http://jinnianshilongnian.iteye.com/blog/1705701
为了这个问题费了很大劲,主要参考了了
1.http://stackoverflow.com/questions/2622018/compile-classfile-issue-in-spring-3 这个主要是因为ant编译导致类似的问题。
2. http://stackoverflow.com/questions/10305592/error-class-names-are-only-accepted-if-annotation-processing-is-explicitly-req 一开始src的写法有些问题,改为上面的写法便可。
发现问题:
一次做下载过程中,使用get方式进行下载,
在idea和eclipse下面启动工程没问题, 但是部署的时候就出了问题,后台一直提示500错误,但看不到错误细节,后来我直接复制地址,打开标签,直接粘贴url,才看到下面错误:
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalArgumentException: Name for argument type [java.lang.String] not available, and parameter name information not found in class file either.
org.springframework.web.servlet.FrameworkServlet.finalizeProcessing(FrameworkServlet.java:947)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:893)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:781)
javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:83)
com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129)
com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
root cause
java.lang.IllegalArgumentException: Name for argument type [java.lang.String] not available, and parameter name information not found in class file either.
org.springframework.util.Assert.notNull(Assert.java:112)
org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.updateNamedValueInfo(AbstractNamedValueMethodArgumentResolver.java:134)
org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.getNamedValueInfo(AbstractNamedValueMethodArgumentResolver.java:112)
org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.resolveArgument(AbstractNamedValueMethodArgumentResolver.java:81)
org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:75)
org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:156)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:117)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:647)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:603)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:950)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:859)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:883)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:781)
javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:83)
com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129)
com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalArgumentException: Name for argument type [java.lang.String] not available, and parameter name information not found in class file either.
原因:
这个错误主要是因为action的参数标注默认是debug级别,比如
此时userName的级别时debug级别,而在linux下编译时是忽略了这些标注,导致请求时就会找不到userName的参数。eclipse默认是debug级别的函数里面的参数名保留,但是ant编译就不行了。
解决方法1:写全@RequestParam的参数
写全@PathVariable的参数
解决方法2:修改build.xml,使用javac debug=true
Name for argument type [java.lang.String] not available http://m.blog.csdn.net/blog/kouwoo/42869779
SpringMVC强大的数据绑定(2)——第六章 注解式控制器详解——跟着开涛学SpringMVC http://jinnianshilongnian.iteye.com/blog/1705701
为了这个问题费了很大劲,主要参考了了
1.http://stackoverflow.com/questions/2622018/compile-classfile-issue-in-spring-3 这个主要是因为ant编译导致类似的问题。
2. http://stackoverflow.com/questions/10305592/error-class-names-are-only-accepted-if-annotation-processing-is-explicitly-req 一开始src的写法有些问题,改为上面的写法便可。
发现问题:
一次做下载过程中,使用get方式进行下载,
@ResponseBody @RequestMapping(value = "/down/{_listid}/{type}", method = RequestMethod.GET) public ResponseEntity<byte[]> download(@PathVariable String _listid, @PathVariable String type) throws IOException { ...... }
在idea和eclipse下面启动工程没问题, 但是部署的时候就出了问题,后台一直提示500错误,但看不到错误细节,后来我直接复制地址,打开标签,直接粘贴url,才看到下面错误:
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalArgumentException: Name for argument type [java.lang.String] not available, and parameter name information not found in class file either.
org.springframework.web.servlet.FrameworkServlet.finalizeProcessing(FrameworkServlet.java:947)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:893)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:781)
javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:83)
com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129)
com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
root cause
java.lang.IllegalArgumentException: Name for argument type [java.lang.String] not available, and parameter name information not found in class file either.
org.springframework.util.Assert.notNull(Assert.java:112)
org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.updateNamedValueInfo(AbstractNamedValueMethodArgumentResolver.java:134)
org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.getNamedValueInfo(AbstractNamedValueMethodArgumentResolver.java:112)
org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver.resolveArgument(AbstractNamedValueMethodArgumentResolver.java:81)
org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:75)
org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:156)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:117)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:647)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:603)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:950)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:859)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:883)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:781)
javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:83)
com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129)
com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalArgumentException: Name for argument type [java.lang.String] not available, and parameter name information not found in class file either.
原因:
这个错误主要是因为action的参数标注默认是debug级别,比如
@RequestMapping(value = "/security/login", method = RequestMethod.POST) public ModelAndView login(@RequestParam String userName, @RequestParam String password, HttpServletRequest request) {
此时userName的级别时debug级别,而在linux下编译时是忽略了这些标注,导致请求时就会找不到userName的参数。eclipse默认是debug级别的函数里面的参数名保留,但是ant编译就不行了。
解决方法1:写全@RequestParam的参数
@RequestMapping("hello") public String helloWorld(Map<String, Object> map, HttpServletRequest request,@RequestParam(value="hhh", required = false) String hhh) { System.out.println("hello"); System.out.println("["+hhh+"]"); map.put("message", "test message111"); return "helloView"; }
写全@PathVariable的参数
@RequestMapping(value="/users/{userId}/topics/{topicId}") public String test( @PathVariable(value="userId") int userId, @PathVariable(value="topicId") int topicId)
解决方法2:修改build.xml,使用javac debug=true
<javac srcdir="${src}" destdir="${build}/WEB-INF/classes" debug="true" encoding="utf-8" classpathref="classpath" includeantruntime="on"> </javac>
发表评论
-
Spring Boot 属性配置
2016-06-24 11:04 1172Spring Boot 属性配置和使用 http://blog ... -
Spring Boot 集成MyBatis
2016-06-24 10:55 2019Spring Boot 集成MyBatis http://bl ... -
Spring MVC防重复提交
2016-06-17 15:47 1636http://my.oschina.net/zyqjustin ... -
Spring容器加载完之后执行特定任务
2016-06-17 15:36 2274http://my.oschina.net/simpleton ... -
使用spring-session和shiro来代理session的配置
2016-06-16 11:21 12043使用spring-session和redis来代理sessio ... -
JSTL 的 if else : 有 c:if 没有 else 的处理
2016-06-14 09:52 1330http://blog.csdn.net/xiyuan1999 ... -
spring mvc 请求转发和重定向
2016-06-14 09:48 1387http://blog.csdn.net/jackpk/art ... -
mvc:view-controller
2016-05-18 10:26 1076http://blog.csdn.net/lzwglory/a ... -
spring配置事物的方式:注解和aop配置
2016-05-14 00:26 4094参考: Spring AOP中pointcut express ... -
分布式任务调度组件 Uncode-Schedule
2016-05-13 14:47 2279http://www.oschina.net/p/uncode ... -
Mybatis分库分表扩展插件
2016-05-12 15:47 1611http://fangjialong.iteye.com/bl ... -
spring+mybatis+atomikos 实现JTA事务
2016-05-11 22:00 5508sping配置多个数据源 不同用户操作不同数据库 http:/ ... -
Spring中使用注解 @Scheduled执行定时任务
2016-05-10 09:39 1558原文:http://dwf07223.blog.51cto.c ... -
Spring中配置Websocket
2016-05-05 16:55 1268spring+websocket整合(springMVC+sp ... -
redis 集群中Session解决方案之Spring Session
2016-05-04 08:54 1305集群中Session解决方案之Spring Session h ... -
使用Spring-data进行Redis操作
2016-05-04 08:54 4774使用Spring-data进行Redis操作 http://z ... -
Spring4新特性——集成Bean Validation 1.1(JSR-349)到SpringMVC
2016-05-03 13:35 1053Spring4新特性——集成Bean Validation 1 ... -
SpringMVC介绍之Validation
2016-05-03 13:10 971SpringMVC介绍之Validation http://h ... -
spring 注解方式下使用commons-validator 验证表单
2016-05-03 11:08 3064原文: http://www.programgo.com/ar ... -
Spring MVC学习详解
2016-04-28 09:13 996原文 http://blog.csdn.net/alsocod ...
相关推荐
TypeError: Unexpected keyword argument passed to optimizer: learning_rate 3.问题定位: 先看报错代码:大概意思是, 传给优化器的learning_rate参数错误。 模型训练是在服务器Linux环境下进行的,之后在...
Option host requires an argument -config+ Use this config file -Cgidirs+ scan these CGI dirs: ‘none’, ‘all’, or values like “/cgi/ /cgi-a/” -dbcheck check database and other key files for ...
标题 "Cannot invoke setId on bean class 'class ' - argument type mismatch - had object" 描述的是一个在使用Spring框架或者类似的依赖注入容器时常见的错误。这个错误通常发生在尝试通过容器设置一个对象属性,...
TypeError: loop of ufunc does not support argument 0 of type Tensor which has no callable arctan method 报错行 self.u = np.round(np.dot(self.F, self.u)) #或者 self.u = np.round(self.u + np.dot(K, ...
5. 重启Keil µVision,检查是否还出现相同的错误。 在实际解决问题时,如果上述方法无效,开发者可能还需要检查以下几个方面: - 检查工程设置,确保所有配置文件(如.uvprojx)中的参数都是正确的。 - 检查源代码...
### Python 出现错误 TypeError: ‘NoneType’ object is not iterable 解决办法 #### 错误概述 在Python编程过程中,经常会遇到各种类型的错误。其中,“TypeError: ‘NoneType’ object is not iterable”是一个...
除此之外,系统更新后可能出现兼容性问题,导致adb无法正常工作。这时,可以尝试更新adb版本,或者回滚到之前稳定的adb版本。 在处理adb错误时,日志分析是非常有用的工具。通过`adb logcat`命令,我们可以获取设备...
通常不会报出这种错误,但还是有奇人能搞出来。这种错误通过断点调试就可以发现错误 在利用Python进行绘图时可能报出这种错误。 Traceback (most recent call last): File "E:\Anaconda3\envs\python27\Lib\lib-tk\...
Keil v5 Error: Encountered an improper argument 个人实测解决办法 实测运行正常咯,再也不出现仿真关不了debug情况了
OpenCV 是一个功能强大的计算机视觉库,但是有时可能会出现一些莫名其妙的错误,本文将介绍如何解决 OpenCV 报错“Unknown array type in function cvarrToMat” 并崩溃问题。 问题描述 ---------- 在使用 OpenCV ...
Boost.Python.ArgumentError: Python argument types in错误解决及Boost安装配置-附件资源
keil arm编译链 v5 版本 error: unknown register name vfpcc in asm 务必安装在keil /arm 的目录下。
Download the attached file and extract it to the folder C:\Keil_v5\UV4. If you have installed PK51 to a different folder, you need to adapt the path accordingly. The file UV4.exe is replaced with ...
Silverlight 错误代码对照 Silverlight 是一款基于 Windows Presentation Foundation(WPF)的 Rich Internet Application(RIA)框架,它提供了一个基于浏览器的富客户端应用程序开发平台。然而,在 Silverlight ...
堆栈分析器钩子( with TypeChecker('packagename'): )(不推荐使用): 发出警告而不是引发TypeError 只需对代码进行很少的修改 可以堆叠/嵌套多个TypeChecker 无法与动态定义的类型提示(例如,在嵌套函数中)...
总结一下,当Apache启动时出现“shmget() failed: Invalid argument”的错误,解决步骤如下: 1. 检查 `/etc/sysctl.conf` 文件中的 `kernel.shmmax` 和 `kernel.shmall` 设置。 2. 根据系统物理内存,合理设定这两...