我们有这样的代码。
HeaderCDSForPRForGuidedBuying requisitionHeader = readHeaderInternal(draftUUID);
try {
requisitionHeaderAddress = requisitionHeader.getGuidedProcmtReqnDelivAddrOrFetch();
} catch (NullPointerException ex) {
logger.error("Exception occurred: No Address is associated with the requisition header", ex);
}
可以看出,我们首先获取一个实体(header),然后是关联实体(DeliveryAddress),而此代码在应用程序中正常工作,或者在eclipse中正常工作,当作为maven执行的一部分运行时,它会中断。我们有使用maven运行的集成测试,因此它对我们来说失败了。错误是这样的。
同样的问题也在https://github.com/Wikidata/Wikidata-Toolkit/issues/58.我相信该链接中也提到了修复。
请修复它,以便我们可以运行我们的maven测试而不会出现任何错误。
谢了萨钦
正如Christoph Schubert指出的那样,错误是由依赖关系冲突引起的。引用他的评论:
org. json:json
和com.vaadin.external.google:android-json
都提供了一个org.json.JSONException
。第一个库有一个扩展RuntimeException
的库,而后者提供了一个检查的异常。
我能想到的唯一解决方案是排除依赖树中的两个库之一。