java.lang.ExceptionInInitializerError

JDK Bug System | Webbug Group | 6 months ago
  1. 0

    FULL PRODUCT VERSION : Java HotSpot(TM) 64-Bit Server VM (build 25.102-b04, mixed mode) ADDITIONAL OS VERSION INFORMATION : windows 10 64 A DESCRIPTION OF THE PROBLEM : simple connect https website,it could not work when use utf-16 in source file REGRESSION. Last worked in version 8u74 STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : public class Test { public static void main(String[] args) throws Exception { URLConnection openConnection = new URL("https://www.google.com").openConnection(); openConnection.connect(); } } EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - simple code above,if save as utf-8,it runs ok,if save as utf-16,it crash ACTUAL - report error ERROR MESSAGES/STACK TRACES THAT OCCUR : Exception in thread "main" java.lang.ExceptionInInitializerError at javax.crypto.JceSecurity.loadPolicies(JceSecurity.java:317) at javax.crypto.JceSecurity.setupJurisdictionPolicies(JceSecurity.java:262) at javax.crypto.JceSecurity.access$000(JceSecurity.java:48) at javax.crypto.JceSecurity$1.run(JceSecurity.java:80) at java.security.AccessController.doPrivileged(Native Method) at javax.crypto.JceSecurity.<clinit>(JceSecurity.java:77) at javax.crypto.JceSecurityManager.<clinit>(JceSecurityManager.java:65) at javax.crypto.Cipher.getConfiguredPermission(Cipher.java:2587) at javax.crypto.Cipher.getMaxAllowedKeyLength(Cipher.java:2611) at sun.security.ssl.CipherSuite$BulkCipher.isAvailable(CipherSuite.java:548) at sun.security.ssl.CipherSuite$BulkCipher.isAvailable(CipherSuite.java:527) at sun.security.ssl.CipherSuite.isAvailable(CipherSuite.java:194) at sun.security.ssl.SSLContextImpl.getApplicableCipherSuiteList(SSLContextImpl.java:346) at sun.security.ssl.SSLContextImpl.getDefaultCipherSuiteList(SSLContextImpl.java:304) at sun.security.ssl.SSLSocketImpl.init(SSLSocketImpl.java:626) at sun.security.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:537) at sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:72) at sun.net.www.protocol.https.HttpsClient.createSocket(HttpsClient.java:405) at sun.net.NetworkClient.doConnect(NetworkClient.java:162) at sun.net.www.http.HttpClient.openServer(HttpClient.java:432) at sun.net.www.http.HttpClient.openServer(HttpClient.java:527) at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264) at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191) at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1105) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:999) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177) at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:153) at Test.main(Test.java:7) Caused by: java.lang.SecurityException: Framework jar verification can not be initialized at javax.crypto.JarVerifier.<clinit>(JarVerifier.java:192) ... 29 more Caused by: java.security.PrivilegedActionException: java.security.cert.CertificateException: Could not parse certificate: java.io.IOException: java.lang.IllegalArgumentException: Illegal base64 character -2 at java.security.AccessController.doPrivileged(Native Method) at javax.crypto.JarVerifier.<clinit>(JarVerifier.java:151) ... 29 more Caused by: java.security.cert.CertificateException: Could not parse certificate: java.io.IOException: java.lang.IllegalArgumentException: Illegal base64 character -2 at sun.security.provider.X509Factory.engineGenerateCertificate(X509Factory.java:110) at java.security.cert.CertificateFactory.generateCertificate(CertificateFactory.java:339) at javax.crypto.JarVerifier.parseCertificate(JarVerifier.java:206) at javax.crypto.JarVerifier.access$100(JarVerifier.java:37) at javax.crypto.JarVerifier$1.run(JarVerifier.java:158) at javax.crypto.JarVerifier$1.run(JarVerifier.java:152) ... 31 more Caused by: java.io.IOException: java.lang.IllegalArgumentException: Illegal base64 character -2 at sun.security.util.Pem.decode(Pem.java:49) at sun.security.provider.X509Factory.readOneBlock(X509Factory.java:638) at sun.security.provider.X509Factory.engineGenerateCertificate(X509Factory.java:96) ... 36 more Caused by: java.lang.IllegalArgumentException: Illegal base64 character -2 at java.util.Base64$Decoder.decode0(Base64.java:714) at java.util.Base64$Decoder.decode(Base64.java:526) at sun.security.util.Pem.decode(Pem.java:47) ... 38 more REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- public class Test { public static void main(String[] args) throws Exception { URLConnection openConnection = new URL("https://www.google.com").openConnection(); openConnection.connect(); } } ---------- END SOURCE ----------

    JDK Bug System | 6 months ago | Webbug Group
    java.lang.ExceptionInInitializerError
  2. 0

    Internal Error During Authentication (unable to join own server)

    GitHub | 2 years ago | LimitlessGamingmelon
    javax.net.ssl.SSLProtocolException: Signature algorithm mismatch
  3. 0

    Using Bouncy Castle to extract certificate information from android

    Stack Overflow | 4 years ago | Christian
    java.security.cert.CertificateException: Unable to initialize, java.io.IOException: DerInputStream.getLength(): lengthTag=127, too big. at sun.security.x509.X509CertImpl.&lt;init&gt;(X509CertImpl.java:199)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Going wrong in obtaining cert object

    Stack Overflow | 4 years ago | Nohsib
    java.security.cert.CertificateException: Missing input stream
  6. 0

    Repository Error | Oracle Community

    oracle.com | 1 year ago
    java.security.cert.CertificateException: Unable to initialize, java.io.IOException: DerInputStream.getLength(): lengthTag=127, too big.

    11 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      Illegal base64 character -2

      at java.util.Base64$Decoder.decode0()
    2. Java RT
      CertificateFactory.generateCertificate
      1. java.util.Base64$Decoder.decode0(Base64.java:714)
      2. java.util.Base64$Decoder.decode(Base64.java:526)
      3. sun.security.util.Pem.decode(Pem.java:47)
      4. sun.security.provider.X509Factory.readOneBlock(X509Factory.java:638)
      5. sun.security.provider.X509Factory.engineGenerateCertificate(X509Factory.java:96)
      6. java.security.cert.CertificateFactory.generateCertificate(CertificateFactory.java:339)
      6 frames
    3. Android Platform
      JarVerifier$1.run
      1. javax.crypto.JarVerifier.parseCertificate(JarVerifier.java:206)
      2. javax.crypto.JarVerifier.access$100(JarVerifier.java:37)
      3. javax.crypto.JarVerifier$1.run(JarVerifier.java:158)
      4. javax.crypto.JarVerifier$1.run(JarVerifier.java:152)
      4 frames
    4. Java RT
      AccessController.doPrivileged
      1. java.security.AccessController.doPrivileged(Native Method)
      1 frame
    5. Android Platform
      JceSecurity$1.run
      1. javax.crypto.JarVerifier.<clinit>(JarVerifier.java:151)
      2. javax.crypto.JceSecurity.loadPolicies(JceSecurity.java:317)
      3. javax.crypto.JceSecurity.setupJurisdictionPolicies(JceSecurity.java:262)
      4. javax.crypto.JceSecurity.access$000(JceSecurity.java:48)
      5. javax.crypto.JceSecurity$1.run(JceSecurity.java:80)
      5 frames
    6. Java RT
      AccessController.doPrivileged
      1. java.security.AccessController.doPrivileged(Native Method)
      1 frame
    7. Android Platform
      Cipher.getMaxAllowedKeyLength
      1. javax.crypto.JceSecurity.<clinit>(JceSecurity.java:77)
      2. javax.crypto.JceSecurityManager.<clinit>(JceSecurityManager.java:65)
      3. javax.crypto.Cipher.getConfiguredPermission(Cipher.java:2587)
      4. javax.crypto.Cipher.getMaxAllowedKeyLength(Cipher.java:2611)
      4 frames
    8. Java JSSE
      SSLSocketFactoryImpl.createSocket
      1. sun.security.ssl.CipherSuite$BulkCipher.isAvailable(CipherSuite.java:548)
      2. sun.security.ssl.CipherSuite$BulkCipher.isAvailable(CipherSuite.java:527)
      3. sun.security.ssl.CipherSuite.isAvailable(CipherSuite.java:194)
      4. sun.security.ssl.SSLContextImpl.getApplicableCipherSuiteList(SSLContextImpl.java:346)
      5. sun.security.ssl.SSLContextImpl.getDefaultCipherSuiteList(SSLContextImpl.java:304)
      6. sun.security.ssl.SSLSocketImpl.init(SSLSocketImpl.java:626)
      7. sun.security.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:537)
      8. sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:72)
      8 frames
    9. Java RT
      HttpsURLConnectionImpl.connect
      1. sun.net.www.protocol.https.HttpsClient.createSocket(HttpsClient.java:405)
      2. sun.net.NetworkClient.doConnect(NetworkClient.java:162)
      3. sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
      4. sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
      5. sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)
      6. sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)
      7. sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
      8. sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1105)
      9. sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:999)
      10. sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
      11. sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:153)
      11 frames
    10. Unknown
      Test.main
      1. Test.main(Test.java:7)
      1 frame