【发布时间】:2023-03-29 20:41:01
【问题描述】:
在 Maven POM 文件中,我有以下内容:
<dependency>
<groupId>org.codehaus.groovy.modules.http-builder</groupId>
<artifactId>http-builder</artifactId>
<version>0.7.1</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.5</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>stax</groupId>
<artifactId>stax</artifactId>
<version>1.2.0</version>
</dependency>
我想在我的项目中使用Httpbuilder 和Workbook 来解析Excel 文件。
def res = http.post("path": "....", "requestContentType": JSON, contentType: ContentType.BINARY)
Workbook book = WorkbookFactory.create(res.responseData)
错误:
- 如果我使用我的 Maven 依赖项
java.lang.LinkageError: loader constraint violation in interface itable
initialization: when resolving method "org.apache.xerces.dom.NodeImpl
- 如果我向 stax 或 httpbuilder 添加排除项
java.lang.NoSuchMethodError: javax.xml.parsers.DocumentBuilderFactory.setFeature(Ljava/lang/String;Z)V
- 如果我删除 stax 依赖项
javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.EventFactory not found
关于如何将HttpBuilder 与Workbook 一起使用有什么想法吗?
【问题讨论】:
标签: maven groovy httpbuilder