2
我正在嘗試將Apache POI導入Atlassian Jira Plugin以讀取excel文件。使用Apache Felix的Apache POI
在開始的時候,我開始將只是
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
</dependency>
poi.version是3.14
然後當我開始它給
Unresolved constraint in bundle com.tezExtensions [165]: Unable to resolve 165.0: missing requirement [165.0] osgi.wiring.package; (osgi.wiring.package=com.sun.javadoc)
插件然後我編輯POM一些我在另一個StackOverflow問題上找到的說明Pax Exam issue with Apache POI wrapped bundle
<instructions>
<Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>
<!-- Add package to export here -->
<Export-Package>com.sony.poc.api,</Export-Package>
<_exportcontents>
org.apache.poi.*;version=${poi.version},
org.openxmlformats.schemas.*;version=${poi.schema.version},
schemasMicrosoftComOfficeExcel.*;version=${poi.schema.version},
schemasMicrosoftComOfficeOffice.*;version=${poi.schema.version},
schemasMicrosoftComOfficePowerpoint.*;version=${poi.schema.version},
schemasMicrosoftComVml.*;version=${poi.schema.version},
org.etsi.uri.*;version=${poi.security.version}
</_exportcontents>
<!-- Add package import here -->
<Import-Package>
com.sun.javadoc;resolution:=optional,
com.sun.tools.javadoc;resolution:=optional,
org.apache.crimson.jaxp;resolution:=optional,
org.apache.tools.ant;resolution:=optional,
org.apache.tools.ant.taskdefs;resolution:=optional,
org.apache.tools.ant.types;resolution:=optional,
junit.framework.*;resolution:=optional,
junit.textui.*;resolution:=optional,
org.junit.*;resolution:=optional,
org.apache.xml.security.*;resolution:=optional,
org.apache.jcp.xml.dsig.internal.dom.*;resolution:=optional,
org.springframework.osgi.*;resolution:="optional", org.eclipse.gemini.blueprint.*;resolution:="optional", *</Import-Package>
<DynamicImport-Package>
org.apache.xmlbeans.*,
schemaorg_apache_xmlbeans.*
</DynamicImport-Package>
有了這個配置,我得到這個錯誤;
Unable to resolve 165.0: missing requirement [165.0] osgi.wiring.package; (osgi.wiring.package=org.apache.xml.resolver)
有沒有人有想法?
喜奧馬爾, 我使用的服務組合,並試圖讀取使用POI的XLSX,但我收到以下錯誤: **產生的原因:java.lang.ClassCastException: org.apache.xerces.stax。無法在javax.xml.stream處將XMLEventFactoryImpl轉換爲 javax.xml.stream.XMLEventFactory 。 XMLEventFactory.newInstance(XMLEventFactory.java: 30)at org.apache.poi.openxml4j.opc.internal.marshallers。 PackagePropertiesMarshaller。 (PackagePropertiesMarshaller.java:41)** 但是。當我創建一個單獨的java項目並閱讀xlsx時,它工作得很好。 –
Umer
嗨Umer,我沒有服務組合的經驗,如果沒有看到您的實施,我什麼也不能說。如果你能爲你的問題開一個新的問題,我想有人會幫助你。祝你好運! –