Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#58905 closed defect (fixed)

pdftk-java @3.0.6 Class Not found exception

Reported by: snowflake (Dave Evans) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.5.99
Keywords: Cc: chrstphrchvz (Christopher Chavez), ryandesign (Ryan Carsten Schmidt)
Port: pdftk-java

Description

Here is the output illustrating the crash

Script started on Sat Aug 31 10:49:37 2019
command: pdftk-java m.pdf dump_data output rp.txt
Unhandled Java Exception in create_output():
java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringEscapeUtils
	at com.gitlab.pdftk_java.report.<clinit>(report.java:55)
	at com.gitlab.pdftk_java.TK_Session.create_output(TK_Session.java:3080)
	at com.gitlab.pdftk_java.pdftk.main_noexit(pdftk.java:156)
	at com.gitlab.pdftk_java.pdftk.main(pdftk.java:128)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang3.StringEscapeUtils
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	... 4 more
There was a problem with pdftk-java. Please report it at
https://gitlab.com/pdftk-java/pdftk/issues
including the message above, the version of pdftk-java (3.0.6), and if possible steps to reproduce the error.

Script done on Sat Aug 31 10:49:39 2019

Change History (8)

comment:1 Changed 5 years ago by chrstphrchvz (Christopher Chavez)

Cc: chrstphrchvz added

comment:2 Changed 5 years ago by chrstphrchvz (Christopher Chavez)

Someone may want to cc the submitter of this port (yahoo.fr:macosx12345).

There are a couple of (closed) upstream tickets that this resembles: https://gitlab.com/pdftk-java/pdftk/issues/2 https://gitlab.com/pdftk-java/pdftk/issues/7

It also appears that in the future this port may need to use Apache commons-text, since that is where StringEscapeUtils has moved to; not sure if the upstream project is aware of this.

comment:3 in reply to:  2 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign added

comment:4 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

In 7ef4e3f9fd00a365afbc9bf7781e340d0df0b2d9/macports-ports (master):

commons-text: New port, version 1.8

See: #58905

comment:5 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to ryandesign
Resolution: fixed
Status: newclosed

In f2bace85cef65f1aad4c67565c1d188d92fdc80a/macports-ports (master):

pdftk-java: Update to 3.1.1 and fix class path

Closes: #58905

comment:6 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

I think that fixes it but I should add that I'm almost completely unfamiliar with Java so it's possible I did something wrong in creating the commons-text port (I modeled it on the commons-lang3 port) or in fixing the class path issues in pdftk-java. If so, please file more tickets.

comment:7 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

In 81464b975460d1438b52331ea728e089bb2baebf/macports-ports (master):

pdftk-java: Don't use commons-text

Remove unnecessary commons-text dependency and the source patch to use
it. StringEscapeUtils may be deprecated in commons-lang3, but it's still
there. Turns out the only reason why it didn't run before was that we
weren't specifying the class path.

See: #58905

comment:8 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

In 1b1e4b37ca0cc243217498b85bd9c2e7ec560e63/macports-ports (master):

pdftk-java: Remove unused patchfile

See: #58905

Note: See TracTickets for help on using tickets.