You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Fred Andrews <fr...@fastmail.us> on 2015/10/24 22:18:28 UTC

Gettting error on loading password protected docs

In 2.0 todays build I am getting the following error when opening files
that have a blank password.

java.lang.NoSuchFieldError: as_sys_sec_alg_ideaCBC
	at
	org.bouncycastle.jcajce.provider.symmetric.IDEA$Mappings.configure(Unknown
	Source)
	at
	org.bouncycastle.jce.provider.BouncyCastleProvider.loadAlgorithms(Unknown
	Source)
	at
	org.bouncycastle.jce.provider.BouncyCastleProvider.setup(Unknown
	Source)
	at
	org.bouncycastle.jce.provider.BouncyCastleProvider.access$000(Unknown
	Source)
	at
	org.bouncycastle.jce.provider.BouncyCastleProvider$1.run(Unknown
	Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at
	org.bouncycastle.jce.provider.BouncyCastleProvider.<init>(Unknown
	Source)
	at
	org.apache.pdfbox.pdmodel.encryption.SecurityHandlerFactory.<clinit>(SecurityHandlerFactory.java:44)
	at
	org.apache.pdfbox.pdmodel.encryption.PDEncryption.<init>(PDEncryption.java:96)
	at
	org.apache.pdfbox.pdfparser.PDFParser.prepareDecryption(PDFParser.java:263)
	at
	org.apache.pdfbox.pdfparser.PDFParser.initialParse(PDFParser.java:196)
	at
	org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:230)
	at
	org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:972)
	at
	org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:876)

I am calling
    document = PDDocument.load(inputstream)

 with the intent to then call 

        if( document.isEncrypted() )

But am getting the above error on the initial load.

Is this a bug, a build problem, or has the call sequence for this
changed in 2.0?

I am building with the only related jar file being
pdfbox-app-2.0.0-20151024.140816-1753.jar

  Thanks
  Fred Andrews
  fred_andrews@fastmail.us

-- 
http://www.fastmail.com - A no graphics, no pop-ups email service


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: Gettting error on loading password protected docs

Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Hi,

Am 24.10.2015 um 22:18 schrieb Fred Andrews:
> In 2.0 todays build I am getting the following error when opening files
> that have a blank password.
>
> java.lang.NoSuchFieldError: as_sys_sec_alg_ideaCBC
> 	at
> 	org.bouncycastle.jcajce.provider.symmetric.IDEA$Mappings.configure(Unknown
> 	Source)
> 	at
> 	org.bouncycastle.jce.provider.BouncyCastleProvider.loadAlgorithms(Unknown
> 	Source)
> 	at
> 	org.bouncycastle.jce.provider.BouncyCastleProvider.setup(Unknown
> 	Source)
> 	at
> 	org.bouncycastle.jce.provider.BouncyCastleProvider.access$000(Unknown
> 	Source)
> 	at
> 	org.bouncycastle.jce.provider.BouncyCastleProvider$1.run(Unknown
> 	Source)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at
> 	org.bouncycastle.jce.provider.BouncyCastleProvider.<init>(Unknown
> 	Source)
> 	at
> 	org.apache.pdfbox.pdmodel.encryption.SecurityHandlerFactory.<clinit>(SecurityHandlerFactory.java:44)
> 	at
> 	org.apache.pdfbox.pdmodel.encryption.PDEncryption.<init>(PDEncryption.java:96)
> 	at
> 	org.apache.pdfbox.pdfparser.PDFParser.prepareDecryption(PDFParser.java:263)
> 	at
> 	org.apache.pdfbox.pdfparser.PDFParser.initialParse(PDFParser.java:196)
> 	at
> 	org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:230)
> 	at
> 	org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:972)
> 	at
> 	org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:876)
>
> I am calling
>      document = PDDocument.load(inputstream)
>
>   with the intent to then call
>
>          if( document.isEncrypted() )
>
> But am getting the above error on the initial load.
>
> Is this a bug, a build problem, or has the call sequence for this
> changed in 2.0?
>
> I am building with the only related jar file being
> pdfbox-app-2.0.0-20151024.140816-1753.jar
The pdfbox-app jar is meant to be a standalone jar. If you are building your own 
application you should use the jars fontbox, pdfbox and all needed external 
dependencies.

BR
Andreas

>
>    Thanks
>    Fred Andrews
>    fred_andrews@fastmail.us
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: Gettting error on loading password protected docs

Posted by Tilman Hausherr <TH...@t-online.de>.
Sounds like a BC problem. Please try this before calling any PDFBox method:

Security.addProvider(new BouncyCastleProvider());


Tilman

Am 24.10.2015 um 22:18 schrieb Fred Andrews:
> In 2.0 todays build I am getting the following error when opening files
> that have a blank password.
>
> java.lang.NoSuchFieldError: as_sys_sec_alg_ideaCBC
> 	at
> 	org.bouncycastle.jcajce.provider.symmetric.IDEA$Mappings.configure(Unknown
> 	Source)
> 	at
> 	org.bouncycastle.jce.provider.BouncyCastleProvider.loadAlgorithms(Unknown
> 	Source)
> 	at
> 	org.bouncycastle.jce.provider.BouncyCastleProvider.setup(Unknown
> 	Source)
> 	at
> 	org.bouncycastle.jce.provider.BouncyCastleProvider.access$000(Unknown
> 	Source)
> 	at
> 	org.bouncycastle.jce.provider.BouncyCastleProvider$1.run(Unknown
> 	Source)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at
> 	org.bouncycastle.jce.provider.BouncyCastleProvider.<init>(Unknown
> 	Source)
> 	at
> 	org.apache.pdfbox.pdmodel.encryption.SecurityHandlerFactory.<clinit>(SecurityHandlerFactory.java:44)
> 	at
> 	org.apache.pdfbox.pdmodel.encryption.PDEncryption.<init>(PDEncryption.java:96)
> 	at
> 	org.apache.pdfbox.pdfparser.PDFParser.prepareDecryption(PDFParser.java:263)
> 	at
> 	org.apache.pdfbox.pdfparser.PDFParser.initialParse(PDFParser.java:196)
> 	at
> 	org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:230)
> 	at
> 	org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:972)
> 	at
> 	org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:876)
>
> I am calling
>      document = PDDocument.load(inputstream)
>
>   with the intent to then call
>
>          if( document.isEncrypted() )
>
> But am getting the above error on the initial load.
>
> Is this a bug, a build problem, or has the call sequence for this
> changed in 2.0?
>
> I am building with the only related jar file being
> pdfbox-app-2.0.0-20151024.140816-1753.jar
>
>    Thanks
>    Fred Andrews
>    fred_andrews@fastmail.us
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org