Java application fails to start with java.lang.ClassNotFoundException: sun.security.x509.CertAndKeyGen
Issue
Java application fails to start with failure trying to find class sun.security.x509.CertAndKeyGen
. Issue started happening after upgrading to java-1.7.0-openjdk-1.7.0.111
.
SEVERE: Container startup failed
java.io.IOException: Failed to start a listener: winstone.HttpsConnectorFactory
at winstone.Launcher.spawnListener(Launcher.java:207)
at winstone.Launcher.<init>(Launcher.java:149)
at winstone.Launcher.main(Launcher.java:352)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at Main._main(Main.java:246)
at Main.main(Main.java:91)
Caused by: java.lang.NoClassDefFoundError: sun/security/x509/CertAndKeyGen
at winstone.HttpsConnectorFactory.start(HttpsConnectorFactory.java:101)
at winstone.Launcher.spawnListener(Launcher.java:205)
... 8 more
Caused by: java.lang.ClassNotFoundException: sun.security.x509.CertAndKeyGen
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 10 more
Environment
- Red Hat Enterprise Linux
- Java OpenJDK 1.7
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.