org.springframework.beans.TypeMismatchException

1:BUG详细描述:

在访问 http://localhost:8090/sm/user/showUser 时控制台出现台下错误:

[org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping]Mapping [/user/showUser] to HandlerExecutionChain with handler [[email protected]] and 2 interceptors
[org.springframework.web.servlet.DispatcherServlet]Last-Modified value for [/sm/user/showUser] is: -1
[org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver]Resolving exception from handler [[email protected]]: org.springframework.beans.TypeMismatchException: Failed to convert value of type ‘java.lang.String‘ to required type ‘int‘; nested exception is java.lang.NumberFormatException: For input string: "showUser"
[org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver]Resolving exception from handler [[email protected]]: org.springframework.beans.TypeMismatchException: Failed to convert value of type ‘java.lang.String‘ to required type ‘int‘; nested exception is java.lang.NumberFormatException: For input string: "showUser"
[org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver]Resolving exception from handler [[email protected]]: org.springframework.beans.TypeMismatchException: Failed to convert value of type ‘java.lang.String‘ to required type ‘int‘; nested exception is java.lang.NumberFormatException: For input string: "showUser"

2:解决方法:

1):在showUser方法中的@RequestMapping的标签中添加(value="showUser")后在次访问

时间: 2024-11-09 02:56:52

org.springframework.beans.TypeMismatchException的相关文章

springsecurity启动出现org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: You must use a 3.0 schema with Spring Security 3.0.

在换了spring-security的jar包以后启动出现org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: You must use a 3.0 schema with Spring Security 3.0.Please update your schema declarations to the 3.0.3 schema (spring-securi

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'App' is defined

工具:Eclipse mars 环境:jdk1.8 说明:这是在学习Spring Task时遇到的一个bug,代码如下: 定时任务类: package com.task.test; import java.util.Date; import org.springframework.stereotype.Component; @Component public class App { public void execute1(){ System.out.printf("Task: %s, Curr

异常:Struts:org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find BasicDataSource

org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'dataSource' defined in class path resource [beans.xml]; nested exception is java.lang.ClassNotFoundExcepti

Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException:

严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'daoSupport': Injection of resou

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException

1.错误描写叙述 usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { -help | start | stop } 2014-7-13 18:02:58 org.apache.catalina.core.AprLifecycleListener init 信息: Loaded APR based Apache Tomcat Native library 1.1.29 usi

?--Porg.springframework.beans.MethodInvocationException: Property 'username' threw exception; nested exception is java.lang.NullPointerException

使用BoneCP作为连接池,在启动Tomcat报出以下异常: 一月 02, 2016 2:12:17 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:mynewdpi' did not find a

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [/Users/lonecloud/tomcat/apache-tomcat-7.0.70 2/webapps/myproject/WEB-INF/classes/cn/lone

解决这个报错的解决办法: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [/Users/lonecloud/tomcat/apache-tomcat-7.0.70 2/webapps/myproject/WEB-INF/classes/cn/lonecloud/dao/Impl/UserDaoImpl.class]; ne

nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException

You should autowire interface AbstractManager instead of class MailManager. If you have different implemetations of AbstractManager you can write @Component("mailService") and then @Autowired @Qualifier("mailService") combination to au

org.springframework.beans.factory.config.PropertyPlaceholderConfigurer

可以将上下文(配置文件)中的属性值放在另一个单独的标准java Properties文件中去.在XML文件中用${key}替换指定的properties文件中的值.这样的话,只需要对properties文件进行修改,而不用对xml配置文件进行修改. 从上图中,我们看到PropertyPlaceholderConfigurer实现了三个bean生命周期的接口:BeanFactoryAware & BeanNameAware & BeanFactoryPostProcessor.关于sprin