`
san_yun
  • 浏览: 2594877 次
  • 来自: 杭州
文章分类
社区版块
存档分类
最新评论

一个诡异的类冲突错误排查记录

 
阅读更多

今天遇到一个问题排查了很久,记录一下。

问题原因,日常环境的某个topology一直无法正常运行,查看日志又没有异常日志打印。现在是一段code:

logger.info("===========supplier.update!============== feedsCount=" + feedsCount);
		try {
			supplier.update(configs);
			logger.info("successfully update, totally {} feeds from {} supplier configs, path={}",
					feedsCount, configs.size(), subscribePath);
		} catch (Exception e) {
			logger.info("fail to update " + e.getMessage());
			logger.error("fail to update, totally " + feedsCount + " feeds from " + configs.size()
					+ " supplier configs, path=" + subscribePath + "",
					e);
		}

 

比较诡异的是successfully和fail to update都没有被执行。

 

后来通过远程debug才发现supplier.update内部有一个类冲突抛出NoClassDefFoundError

网上找到一片关于这个错误的说明:http://my.oschina.net/jasonultimate/blog/166932

 

为什么日志中没有异常信息,因为这个代码是通过ThreadPoolExecutor执行的:

private void runTask(Runnable task) {
	try {
		try {
		    task.run();
		} catch (RuntimeException ex) {
		    throw ex;
		}
	} finally {
		runLock.unlock();
	}
}

 可以看到他是不会抓到Error的。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics