[ 
https://issues.apache.org/jira/browse/PDFBOX-3313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15986945#comment-15986945
 ] 

Tilman Hausherr edited comment on PDFBOX-3313 at 4/29/17 5:28 PM:
------------------------------------------------------------------

Files from my test set that fail when not using twelvemonkeys and not using 
{{field.setAccessible(true)}}:

gs-bugzilla691650-1.pdf
PDFBOX-1348.pdf
PDFBOX-2700-JCS_YCCK.pdf
PDFBOX-2128-PORSCHE_CMYK.pdf
PDFBOX-2128-573636.pdf
PDFBOX-3156.pdf

InaccessibleObjectException does not exist pre JDK9, so we can't catch it, 
unless we catch Exception... and then I thought, why not use brute force for 
the few cases where getAdobeTransform() fails. And this worked :-) I'm also 
catching NegativeArraySizeException, which is for the file from PDFBOX-3156. Of 
course, this solution is the second best. The best is to use twelvemonkeys 
(PDFBOX-2694).

After change the only one left is

PDFBOX-2128-573636.pdf

which has an error when reading.

Update 29.4.2017:
I did an additional test, calling {{getAdobeTransformByBruteForce()}} only and 
not {{getAdobeTransform}}. This worked fine, except for PDFBOX-2128-CAPITAL.pdf 
and PDFBOX-2128-PORSCHE_CMYK.pdf. Image I2200001 in the Porsche file has two 
App14 data blocks, the first one has transform=1 (wrong) and the second one has 
transform=2 (right).


was (Author: tilman):
Files from my test set that fail when not using twelvemonkeys and not using 
{{field.setAccessible(true)}}:

gs-bugzilla691650-1.pdf
PDFBOX-1348.pdf
PDFBOX-2700-JCS_YCCK.pdf
PDFBOX-2128-PORSCHE_CMYK.pdf
PDFBOX-2128-573636.pdf
PDFBOX-3156.pdf

InaccessibleObjectException does not exist pre JDK9, so we can't catch it, 
unless we catch Exception... and then I thought, why not use brute force for 
the few cases where getAdobeTransform() fails. And this worked :-) I'm also 
catching NegativeArraySizeException, which is for the file from PDFBOX-3156. Of 
course, this solution is the second best. The best is to use twelvemonkeys 
(PDFBOX-2694).

After change the only one left is

PDFBOX-2128-573636.pdf

which has an error when reading.

> Java 9 InaccessibleObjectException
> ----------------------------------
>
>                 Key: PDFBOX-3313
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3313
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Rendering
>    Affects Versions: 2.0.0
>            Reporter: simon steiner
>            Assignee: Tilman Hausherr
>              Labels: JDK9
>             Fix For: 2.0.6, 3.0.0
>
>         Attachments: expected.pdf
>
>
> java -jar ~/pdf-box-svn/app/target/pdfbox-app-2.1.0-SNAPSHOT.jar PDFToImage 
> expected.pdf 
> Exception in thread "main" java.lang.reflect.InaccessibleObjectException: 
> Unable to make member of class com.sun.imageio.plugins.jpeg.JPEGImageReader 
> accessible:  module java.desktop does not export com.sun.imageio.plugins.jpeg 
> to unnamed module @72d1ad2e
>       at 
> sun.reflect.Reflection.throwInaccessibleObjectException(java.base@9-ea/Reflection.java:420)
>       at 
> java.lang.reflect.AccessibleObject.checkCanSetAccessible(java.base@9-ea/AccessibleObject.java:174)
>       at 
> java.lang.reflect.Field.checkCanSetAccessible(java.base@9-ea/Field.java:170)
>       at java.lang.reflect.Field.setAccessible(java.base@9-ea/Field.java:164)
>       at org.apache.pdfbox.filter.DCTFilter.decode(DCTFilter.java:119)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to