启动就报错

qq_im5pzj7l SpringMVC 与底层数据... 最后由 极客学院_吕布 于10月17日回复

  • 1 回答
  • 592 浏览

10-Oct-2018 18:11:39.222 警告 [RMI TCP Connection(5)-127.0.0.1] org.springframework.web.context.support.XmlWebApplicationContext.refresh Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sysUserServiceImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdbcTemplate' defined in URL [file:/C:/Users/Charles/work/linkyoyo/SpringMVCStd/target/SpringMVCStd/WEB-INF/classes/applicationContext.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in URL [file:/C:/Users/Charles/work/linkyoyo/SpringMVCStd/target/SpringMVCStd/WEB-INF/classes/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'int' for property 'maxActive'; nested exception is java.lang.NumberFormatException: For input string: "${jdbc.pool.maxActive}"

10-Oct-2018 18:11:39.225 严重 [RMI TCP Connection(5)-127.0.0.1] org.springframework.web.context.ContextLoader.initWebApplicationContext Context initialization failed

 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sysUserServiceImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jdbcTemplate' defined in URL [file:/C:/Users/Charles/work/linkyoyo/SpringMVCStd/target/SpringMVCStd/WEB-INF/classes/applicationContext.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in URL [file:/C:/Users/Charles/work/linkyoyo/SpringMVCStd/target/SpringMVCStd/WEB-INF/classes/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'int' for property 'maxActive'; nested exception is java.lang.NumberFormatException: For input string: "${jdbc.pool.maxActive}"

  • 极客学院_吕布 10月17日 回答 #1楼
  • 在Spring MVC中,bean的scope有singleton, prototype, request, session等级别request级别表示每次http请求时都会创建新的对象,在spring mvc中,如果依赖了HttpServletRequest 和 HttpServletResponse对象,就会在每次请求时重新计算依赖,创建新示例。

  • 0 评论