解决Hander dispatch failed;nested exception is java .lang. AbstractMethodError:Method com/mchange/v2/c

解决Hander dispatch failed;nested exception is java .lang. AbstractMethodError:Method com/mchange/v2/c3p0/impl/NewProxyResultSet.isClosed() is abstract错误

这个是报错的一张截图:(确认一下报错信息有利于精准的找到错误)
在这里插入图片描述
原因分析:(可能有多种原因)

第一种:是你使用的c3p0的版本信息是0.9.1.2。导致版本不够,建议使用0.9.5.5版本的,配置信息如下:

<dependency>
            <groupId>com.mchange</groupId>
            <artifactId>c3p0</artifactId>
            <version>0.9.5.5</version>
        </dependency>

第二种:你在之前运行项目时,由于在target 文件夹中生成了 jar包,新启动时Tomcat加载时存有之前的代码缓存,导致 jar包冲突。
(这种情况下的解决方法很简单,清除缓存,重新运行项目即可)

操作步骤:
在图片中找到Maven中的Lifecycle下的clean,双击clean;之后在双击compile。这样就可以清除项目中的缓存

在这里插入图片描述
之后只需要重新运行项目,问题应该就可以解决了

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
在微信小游戏中使用 downloadFile 下载下来的 JSON 文件,并去除 handler。可以通过以下方式实现: 1. 在 downloadFile 回调函数中获取下载的文件路径和临时文件路径: ```javascript wx.downloadFile({ url: 'https://example.com/example.json', success: function(res) { var filePath = res.filePath; var tempFilePath = res.tempFilePath; // ... 去除 handler } }); ``` 2. 使用 wx.getFileSystemManager 创建文件系统管理器,并使用 writeFile 将临时文件复制到本地文件(即将下载的文件存储到本地): ```javascript wx.downloadFile({ url: 'https://example.com/example.json', success: function(res) { var filePath = res.filePath; var tempFilePath = res.tempFilePath; wx.getFileSystemManager().writeFile({ filePath: filePath, data: "", success: function() { wx.getFileSystemManager().copyFile({ srcPath: tempFilePath, destPath: filePath, success: function(res) { console.log('copyFile success', res); }, fail: function(res) { console.log('copyFile fail', res); } }); }, fail: function(res) { console.log('writeFile fail', res); } }); } }); ``` 3. 在去除 handler 前,先读取本地文件中的 JSON 内容,然后解析出对象: ```javascript wx.downloadFile({ url: 'https://example.com/example.json', success: function(res) { var filePath = res.filePath; var tempFilePath = res.tempFilePath; wx.getFileSystemManager().writeFile({ filePath: filePath, data: "", success: function() { wx.getFileSystemManager().copyFile({ srcPath: tempFilePath, destPath: filePath, success: function(res) { wx.getFileSystemManager().readFile({ filePath: filePath, encoding: 'utf-8', success: function(res) { var json = JSON.parse(res.data); // ... 去除 handler }, fail: function(res) { console.log('readFile fail', res); } }); }, fail: function(res) { console.log('copyFile fail', res); } }); }, fail: function(res) { console.log('writeFile fail', res); } }); } }); ``` 4. 最后,可以使用解析出的 JSON 对象进行后续的操作。 完整的示例代码: ```javascript wx.downloadFile({ url: 'https://example.com/example.json', success: function(res) { var filePath = res.filePath; var tempFilePath = res.tempFilePath; wx.getFileSystemManager().writeFile({ filePath: filePath, data: "", success: function() { wx.getFileSystemManager().copyFile({ srcPath: tempFilePath, destPath: filePath, success: function(res) { wx.getFileSystemManager().readFile({ filePath: filePath, encoding: 'utf-8', success: function(res) { var json = JSON.parse(res.data); delete json.handler; // 去除 handler // ... 后续操作 console.log(json); }, fail: function(res) { console.log('readFile fail', res); } }); }, fail: function(res) { console.log('copyFile fail', res); } }); }, fail: function(res) { console.log('writeFile fail', res); } }); } }); ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值