Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method POIXMLDocumentPart.getPackageRelationship() used in XWPFStylesDocument class was deprecated in version 3.16 #208

Closed
guilherme737 opened this issue Apr 24, 2017 · 21 comments

Comments

@guilherme737
Copy link

When trying to convert a docx to pdf bugs error:

java.lang.NoSuchMethodError: org.apache.poi.POIXMLDocumentPart.getPackageRelationship()Lorg/apache/poi/openxml4j/opc/PackageRelationship; at fr.opensagres.poi.xwpf.converter.core.styles.XWPFStylesDocument.getFontsDocument(XWPFStylesDocument.java:1480) ~[fr.opensagres.poi.xwpf.converter.core-2.0.0.jar:2.0.0] at fr.opensagres.poi.xwpf.converter.core.styles.XWPFStylesDocument.<init>(XWPFStylesDocument.java:191) ~[fr.opensagres.poi.xwpf.converter.core-2.0.0.jar:2.0.0] at fr.opensagres.poi.xwpf.converter.core.styles.XWPFStylesDocument.<init>(XWPFStylesDocument.java:185) ~[fr.opensagres.poi.xwpf.converter.core-2.0.0.jar:2.0.0] at fr.opensagres.poi.xwpf.converter.core.XWPFDocumentVisitor.createStylesDocument(XWPFDocumentVisitor.java:167) ~[fr.opensagres.poi.xwpf.converter.core-2.0.0.jar:2.0.0] at fr.opensagres.poi.xwpf.converter.core.XWPFDocumentVisitor.<init>(XWPFDocumentVisitor.java:160) ~[fr.opensagres.poi.xwpf.converter.core-2.0.0.jar:2.0.0] at fr.opensagres.poi.xwpf.converter.pdf.internal.PdfMapper.<init>(PdfMapper.java:149) ~[fr.opensagres.poi.xwpf.converter.pdf-2.0.0.jar:2.0.0] at fr.opensagres.poi.xwpf.converter.pdf.PdfConverter.doConvert(PdfConverter.java:56) ~[fr.opensagres.poi.xwpf.converter.pdf-2.0.0.jar:2.0.0] at fr.opensagres.poi.xwpf.converter.pdf.PdfConverter.doConvert(PdfConverter.java:39) ~[fr.opensagres.poi.xwpf.converter.pdf-2.0.0.jar:2.0.0] at fr.opensagres.poi.xwpf.converter.core.AbstractXWPFConverter.convert(AbstractXWPFConverter.java:46) ~[fr.opensagres.poi.xwpf.converter.core-2.0.0.jar:2.0.0] at fr.opensagres.xdocreport.converter.docx.poi.itext.XWPF2PDFViaITextConverter.convert(XWPF2PDFViaITextConverter.java:67) ~[fr.opensagres.xdocreport.converter.docx.xwpf-2.0.0.jar:2.0.0]

@angelozerr
Copy link
Member

Perhaps #206 fix this problem?

@icode
Copy link

icode commented May 4, 2017

waiting push to maven repo.......

@icode
Copy link

icode commented May 8, 2017

@angelozerr when publish release to maven repo?

@angelozerr
Copy link
Member

@pascalleclercq what do you think?

@icode
Copy link

icode commented May 8, 2017

@pascalleclercq I want down load from repo new version 2.0.1

@StoneRivers
Copy link

@pascalleclercq @pascalleclercq. Do you have any plan about publishing the 2.0.1 ?

@ryanthon
Copy link

Any updates on this? @pascalleclercq

@joelchrist
Copy link

Any updates on this? Downgrade POI for now?

@jwhitmarsh
Copy link

Any updates?

@angelozerr
Copy link
Member

angelozerr commented Nov 23, 2017

@pascalleclercq what do you think about that?

@ghost
Copy link

ghost commented Jan 29, 2018

Did we just give up on this? Why is no one responding with a plan to publish a fix - it's obviously effecting a lot of users. Still happening in January 2018!

@ghost
Copy link

ghost commented Jan 29, 2018

P.S. - usually when a function or feature is deprecated you give users a reasonable amount of time to migrate before dramatically terminating use. Is there some combination of legacy builds that still work or are we forced to build our own? clusterfup

@ghost
Copy link

ghost commented Jan 29, 2018

Backed up to 3.15 - works, not fast but it works

@angelozerr
Copy link
Member

@pascalleclercq when you will have time, do you think it's possible to create a new release? Thanks!

@angelozerr
Copy link
Member

Still happening in January 2018!

Please note that we do XDocReport in our free time. It's hard for us to find time today.

@Heanthor
Copy link

Heanthor commented Feb 28, 2018

Has there been any movement on this?

I'm using org.apache.poi.xwpf.converter.pdf.. do I need to also use fr.opensagres.xdocreport.document 2.0.1?

@khausam
Copy link

khausam commented Mar 12, 2018

I was using:
compile group: 'fr.opensagres.xdocreport', name: 'org.apache.poi.xwpf.converter.xhtml', version: '1.0.6'

I switched to:
compile group: 'fr.opensagres.xdocreport', name: 'fr.opensagres.poi.xwpf.converter.xhtml', version: '2.0.1'

And the problem was resolved. Can anyone confirm whether this is a reasonable and viable upgrade path?

@dschulten
Copy link

I was using

<dependency>
	<groupId>fr.opensagres.xdocreport</groupId>
	<artifactId>org.apache.poi.xwpf.converter.pdf</artifactId>
	<version>1.0.5</version>
</dependency>

which has a dependency on poi 3.15 and had problems because tika insisted that It needed poi 3.16.

Switched to:

<dependency>
    <groupId>fr.opensagres.xdocreport</groupId>
    <artifactId>fr.opensagres.poi.xwpf.converter.pdf-gae</artifactId>
    <version>2.0.1</version>
</dependency>

and had to adjust a few package names, then it worked

@habean
Copy link

habean commented Apr 2, 2019

I was using

org.apache.poi
poi
3.17


org.apache.poi
poi-ooxml
3.17


org.apache.poi
poi-scratchpad
3.17


fr.opensagres.xdocreport
fr.opensagres.xdocreport.document
2.0.1


fr.opensagres.xdocreport
org.apache.poi.xwpf.converter.xhtml
1.0.6



org.apache.commons.io
commonsIO
2.5.0


com.aspose.words
aspose-words
15.8.0

This problem still occurs during the process of use.
java.lang.NoSuchMethodError: org.apache.poi.POIXMLDocumentPart.getPackageRelationship()Lorg/apache/poi/openxml4j/opc/PackageRelationship;
Is there any solution? It seems that the package conflicts.

@angelozerr
Copy link
Member

2.0.3 has been released. Thanks so much @pascalleclercq !

@Alension
Copy link

Alension commented Sep 5, 2023

I was using org.apache.poi poi 3.17 org.apache.poi poi-ooxml 3.17 org.apache.poi poi-scratchpad 3.17 fr.opensagres.xdocreport fr.opensagres.xdocreport.document 2.0.1 fr.opensagres.xdocreport org.apache.poi.xwpf.converter.xhtml 1.0.6 org.apache.commons.io commonsIO 2.5.0 com.aspose.words aspose-words 15.8.0 This problem still occurs during the process of use. java.lang.NoSuchMethodError: org.apache.poi.POIXMLDocumentPart.getPackageRelationship()Lorg/apache/poi/openxml4j/opc/PackageRelationship; Is there any solution? It seems that the package conflicts.

I have the same problem as you. I switch to the following, then it worked.

              ` <dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi-ooxml</artifactId>
			<version>5.2.2</version>
			<exclusions>
				<exclusion>
					<groupId>org.apache.logging.log4j</groupId>
					<artifactId>log4j-api</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>fr.opensagres.xdocreport</groupId>
			<artifactId>fr.opensagres.xdocreport.document.docx</artifactId>
			<version>2.0.4</version>
		</dependency>
		<dependency>
			<groupId>fr.opensagres.xdocreport</groupId>
			<artifactId>fr.opensagres.poi.xwpf.converter.pdf</artifactId>
			<version>2.0.4</version>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-to-slf4j</artifactId>
			<version>2.17.2</version>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-api</artifactId>
			<version>2.17.2</version>
		</dependency>
                    <dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>2.11.0</version>
		</dependency>`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests