astro 2012-04-24 16:06 采纳率: 100%
浏览 503
已采纳

org.springframework.beans.NotWritablePropertyException:求解决

[code="java"]
XML code(applicationContext.xml)
destroy-method="close">
<!-- com.mchange.v2.c3p0.ComboPooledDataSource -->
<!-- 指定连接数据库的驱动 -->

<!-- 指定连接数据库的URL -->

<!-- 指定连接数据库的用户名 -->

<!-- 指定连接数据库的密码 -->

<!-- 指定连接数据库连接池的最大连接数 -->

<!-- 指定连接数据库连接池的最小连接数 -->

<!-- 指定连接数据库连接池的初始化连接数 -->

<!-- 指定连接数据库连接池的连接的最大空闲时间 -->


[/code]
严重: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'username' of bean class [com.mchange.v2.c3p0.ComboPooledDataSource]: Bean property 'username' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

username是连接数据库的登录名 为什么还要getter setter啊 求教 c3p0的包我导了

  • 写回答

3条回答 默认 最新

  • zyn010101 2012-04-24 16:35
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 (关键词-电路设计)
  • ¥15 如何解决MIPS计算是否溢出
  • ¥15 vue中我代理了iframe,iframe却走的是路由,没有显示该显示的网站,这个该如何处理
  • ¥15 操作系统相关算法中while();的含义
  • ¥15 CNVcaller安装后无法找到文件
  • ¥15 visual studio2022中文乱码无法解决
  • ¥15 关于华为5g模块mh5000-31接线问题
  • ¥15 keil L6007U报错
  • ¥15 webapi 发布到iis后无法访问
  • ¥15 初学者如何快速上手学习stm32?