Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.NoClassDefFoundError: Could not initialize class sun.security.ec.SunEC (occured after recent JRE update)

After the latest JRE (1.7.0_25) was updated my application won't launch from webstart as it used to. I haven't deployed any newer jar files or changed the JNLP file on the web server but I cannot launch the app from webstart. It runs fine from the IDE and also from local jar execution

I tried to disable all certificate checking etc in the advanced tab of the control panel but the error remains, I'm not sure if this is related to the new security setting in the latest JRE or if something else has changed (maybe on the web server?) I don't control the web server I just have a page where the app is published and have access to a drive location for the jar files, permissions are correct for the drive locations etc. I'm now lost as to what the issue is! I tried resigning the jars and verifying the signature as well

I appreciate any help that folk can give! full error is below:

            java.lang.NoClassDefFoundError: Could not initialize class sun.security.ec.SunEC
                at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
                at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
                at java.lang.reflect.Constructor.newInstance(Unknown Source)
                at java.lang.Class.newInstance(Unknown Source)
                at sun.security.jca.ProviderConfig$2.run(Unknown Source)
                at sun.security.jca.ProviderConfig$2.run(Unknown Source)
                at java.security.AccessController.doPrivileged(Native Method)
                at sun.security.jca.ProviderConfig.doLoadProvider(Unknown Source)
                at sun.security.jca.ProviderConfig.getProvider(Unknown Source)
                at sun.security.jca.ProviderList.getProvider(Unknown Source)
                at sun.security.jca.ProviderList.getService(Unknown Source)
                at sun.security.jca.GetInstance.getInstance(Unknown Source)
                at java.security.Security.getImpl(Unknown Source)
                at java.security.AlgorithmParameters.getInstance(Unknown Source)
                at sun.security.x509.AlgorithmId.decodeParams(Unknown Source)
                at sun.security.x509.AlgorithmId.<init>(Unknown Source)
                at sun.security.x509.AlgorithmId.parse(Unknown Source)
                at sun.security.x509.X509Key.parse(Unknown Source)
                at sun.security.x509.CertificateX509Key.<init>(Unknown Source)
                at sun.security.x509.X509CertInfo.parse(Unknown Source)
                at sun.security.x509.X509CertInfo.<init>(Unknown Source)
                at sun.security.x509.X509CertImpl.parse(Unknown Source)
                at sun.security.x509.X509CertImpl.<init>(Unknown Source)
                at sun.security.provider.X509Factory.engineGenerateCertificate(Unknown Source)
                at java.security.cert.CertificateFactory.generateCertificate(Unknown Source)
                at sun.security.provider.JavaKeyStore.engineLoad(Unknown Source)
                at sun.security.provider.JavaKeyStore$JKS.engineLoad(Unknown Source)
                at java.security.KeyStore.load(Unknown Source)
                at com.sun.deploy.security.RootCertStore$1.run(Unknown Source)
                at java.security.AccessController.doPrivileged(Native Method)
                at com.sun.deploy.security.RootCertStore.loadCertStore(Unknown Source)
                at com.sun.deploy.security.RootCertStore.load(Unknown Source)
                at com.sun.deploy.security.RootCertStore.load(Unknown Source)
                at com.sun.deploy.security.ImmutableCertStore.load(Unknown Source)
                at com.sun.deploy.security.LazyRootStore.loadJREStore(Unknown Source)
                at com.sun.deploy.security.LazyRootStore.getTrustAnchors(Unknown Source)
                at com.sun.deploy.security.TrustDecider.getValidationState(Unknown Source)
                at com.sun.deploy.security.TrustDecider.validateChain(Unknown Source)
                at com.sun.deploy.security.TrustDecider.isAllPermissionGranted(Unknown Source)
                at com.sun.javaws.security.AppPolicy.grantUnrestrictedAccess(Unknown Source)
                at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResourcesHelper(Unknown Source)
                at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResources(Unknown Source)
                at com.sun.javaws.Launcher.prepareResources(Unknown Source)
                at com.sun.javaws.Launcher.prepareAllResources(Unknown Source)
                at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
                at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
                at com.sun.javaws.Launcher.launch(Unknown Source)
                at com.sun.javaws.Main.launchApp(Unknown Source)
                at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
                at com.sun.javaws.Main.access$000(Unknown Source)
                at com.sun.javaws.Main$1.run(Unknown Source)
                at java.lang.Thread.run(Unknown Source)
like image 848
Matt C Avatar asked Jul 05 '13 01:07

Matt C


1 Answers

Even after your sign your jar as shown jar signing you will be not able to run your applet in the browser. once your are done with signing you should add access permission for class sun.security.ec.SunEC in java.polcy of your active jdk/jre using policytool.exe . make sure you run the policytool.exe with run as administrator so that you will be allowed to modify the java.policy file. you must add a entry for grant codeBase "file:${{java.ext.dirs}}/*" { permission java.security.AllPermission; }; as suggested by Matt C.

like image 84
Abhijeet Ranade Avatar answered Sep 30 '22 14:09

Abhijeet Ranade