ssaitala
Posts: 15
Joined: Fri Jan 18, 2013 9:07 am

Error while trying to use Pack200 to compress JAR files

I am getting the error in java security class while trying to generate a new certificate when i use the Pack200 to compress. If the compress in not selected, it is working fine.

I am giving my java code sample below.

import java.security.KeyPairGenerator;

0. public static X509Certificate generateCertificates(final String issuerName) throws Exception{

// Generate the EC public/private key pair
1. final keysGenerator keysGenerator = KeyPairGenerator.getInstance("RSA", "BC");

2. kpg.initialize(<int number>);
3. KeyPair kpair = kpg.generateKeyPair();

---
---
}

For getting the generated exe compressed, I have selected the below options from the AdvancedInstaller 9.8

In AdvancedInstaller 9.8, Java Products (Left Pane) --> Setting (right Pane) --> and selected the options "Use Pack200 to compress JAR files" and "Verify JAR files signature before and after packing". If I do this, i am getting an error as "java.security.NoSuchProviderException: no such provider: BC" at line 1. in the above code. The jar for this statement is rt.jar in jre6

Not able to understand how the compression is effecting this statement. I am struck of with this blocker and pending with my fixes. Please suggest me on this and Please let me know if I can provide more information on this.
Last edited by ssaitala on Fri Jan 25, 2013 2:32 pm, edited 1 time in total.
ssaitala
Posts: 15
Joined: Fri Jan 18, 2013 9:07 am

Re: Error while trying to use Pack200 to compress JAR files

Hi,

Any idea on the above issue ?


Regards,
ssaitala
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Error while trying to use Pack200 to compress JAR files

Hi,

I am not sure why this is happening. Have you tried to enable the option "Only from JRE bundle" in Advanced Installer?

Best regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ssaitala
Posts: 15
Joined: Fri Jan 18, 2013 9:07 am

Re: Error while trying to use Pack200 to compress JAR files

Hi,

If I enable "Only from JRE bundle", it is working fine. I have a problem here (Explained below)

(1) Normally without compression, my install file generated size is 56.5 MB.
(2) When I select "Use Pack200 to compress JAR files" and "Verify JAR files signature before and after packing", my install file generated size is 16 MB.
(3) If I select "Only from JRE bundle" option along with the options in point (2), then my install file size is again 56.5 MB. That means there is no compression happening (or) very less reduction in size in this case. I see a difference of bytes in this case not in MB's.

That's the reason, I am trying with only point (2), and not selecting point (3) to get the size of the installer to 16 MB. Do i need to select option (3) also ?

Please suggest me on this. I am in the middle of a deliverable, blocked by this issue.

Thanks & Regards,
ssaitala
Last edited by ssaitala on Fri Jan 25, 2013 12:04 pm, edited 1 time in total.
ssaitala
Posts: 15
Joined: Fri Jan 18, 2013 9:07 am

Re: Error while trying to use Pack200 to compress JAR files

Hi,

Any ideas in this regard ?

Thanks & Regards,
ssaitala
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Error while trying to use Pack200 to compress JAR files

Hi,

The compressions algorithm is a standard from Java, not our own implementation. So we don't know why your JAR is affected.

A workaround is to skip that file from being compressed, by changing its extension from .jar to .zip.

Best regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ssaitala
Posts: 15
Joined: Fri Jan 18, 2013 9:07 am

Re: Error while trying to use Pack200 to compress JAR files

Bogdan,

Finally got it fixed. I have bcprov-jdk15on-<version-number>.jar. When replaced with the latest version bcprov-jdk15on-147.jar, it got fixed.

Thanks & Regards,
ssaitala

Return to “Common Problems”