C3p0Plugin类中的start方法报错
Exception in thread "main" java.lang.NoSuchMethodError: com.mchange.v2.c3p0.impl.C3P0Defaults.dataSourceName()Ljava/lang/String;
at com.mchange.v2.c3p0.impl.PoolBackedDataSourceBase.<init>(PoolBackedDataSourceBase.java:54)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.<init>(AbstractPoolBackedDataSource.java:74)
at com.mchange.v2.c3p0.AbstractComboPooledDataSource.<init>(AbstractComboPooledDataSource.java:142)
at com.mchange.v2.c3p0.AbstractComboPooledDataSource.<init>(AbstractComboPooledDataSource.java:138)
at com.mchange.v2.c3p0.ComboPooledDataSource.<init>(ComboPooledDataSource.java:47)
at com.jfinal.plugin.c3p0.C3p0Plugin.start(C3p0Plugin.java:150)
at com.demo.GeneratorDemo.GeneratorDemo.getDataSource(GeneratorDemo.java:23)
at com.demo.GeneratorDemo.GeneratorDemo.main(GeneratorDemo.java:39)
at com.mchange.v2.c3p0.impl.PoolBackedDataSourceBase.<init>(PoolBackedDataSourceBase.java:54)
at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.<init>(AbstractPoolBackedDataSource.java:74)
at com.mchange.v2.c3p0.AbstractComboPooledDataSource.<init>(AbstractComboPooledDataSource.java:142)
at com.mchange.v2.c3p0.AbstractComboPooledDataSource.<init>(AbstractComboPooledDataSource.java:138)
at com.mchange.v2.c3p0.ComboPooledDataSource.<init>(ComboPooledDataSource.java:47)
at com.jfinal.plugin.c3p0.C3p0Plugin.start(C3p0Plugin.java:150)
at com.demo.GeneratorDemo.GeneratorDemo.getDataSource(GeneratorDemo.java:23)
at com.demo.GeneratorDemo.GeneratorDemo.main(GeneratorDemo.java:39)
下面试start()方法的一部分内容
public boolean start() { if(this.isStarted) { return true; } else { //在实例化这个的时候报错 this.dataSource = new ComboPooledDataSource(); this.dataSource.setJdbcUrl(this.jdbcUrl); this.dataSource.setUser(this.user); this.dataSource.setPassword(this.password); ... }
我看了ComboPooledDataSource的构造方法什么也没有为什么会保存 球大神解答public ComboPooledDataSource() { }
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
已解决,final jar报版本不对
感觉版本不太对, NoSuchMethod, 就是以为它有这个方法, 实际没有, 多是版本问题引起的