java.lang.NoClassDefFoundError: javax/security/cert/X509Certificate

DataStax JIRA | Marcus Olsson | 1 year ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    When using the shaded 3.0.0 java driver in Apache Karaf we get the following error when the driver is connecting to the cluster: {noformat} java.lang.NoClassDefFoundError: javax/security/cert/X509Certificate at com.datastax.shaded.netty.util.internal.EmptyArrays.<clinit>(EmptyArrays.java:40) at com.datastax.shaded.netty.util.concurrent.DefaultPromise.<clinit>(DefaultPromise.java:44) at com.datastax.shaded.netty.util.concurrent.GlobalEventExecutor.<init>(GlobalEventExecutor.java:44) at com.datastax.shaded.netty.util.concurrent.GlobalEventExecutor.<clinit>(GlobalEventExecutor.java:41) at com.datastax.driver.core.Connection$Factory.<init>(Connection.java:684) at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1365) at com.datastax.driver.core.Cluster.init(Cluster.java:162) at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:333) at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:308) at com.datastax.driver.core.Cluster.connect(Cluster.java:250) {noformat} Something to note is that we did not have SSL enabled while connecting and also that this stopped working when going from versions 2.1.9 -> 3.0.0. There is a different netty version between the two, 4.0.27.Final and 4.0.33.Final. The problem seems to be that in netty-common there is an OSGI package import for *javax.security.cert* which is not imported in the shaded java driver. The fix would be to add javax.security.cert to the import package of the shaded java driver. This problem will probably affect version 2.1 of the java driver as well, but there hasn't been a release with the newer netty version yet.

    DataStax JIRA | 1 year ago | Marcus Olsson
    java.lang.NoClassDefFoundError: javax/security/cert/X509Certificate
  2. 0

    When using the shaded 3.0.0 java driver in Apache Karaf we get the following error when the driver is connecting to the cluster: {noformat} java.lang.NoClassDefFoundError: javax/security/cert/X509Certificate at com.datastax.shaded.netty.util.internal.EmptyArrays.<clinit>(EmptyArrays.java:40) at com.datastax.shaded.netty.util.concurrent.DefaultPromise.<clinit>(DefaultPromise.java:44) at com.datastax.shaded.netty.util.concurrent.GlobalEventExecutor.<init>(GlobalEventExecutor.java:44) at com.datastax.shaded.netty.util.concurrent.GlobalEventExecutor.<clinit>(GlobalEventExecutor.java:41) at com.datastax.driver.core.Connection$Factory.<init>(Connection.java:684) at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1365) at com.datastax.driver.core.Cluster.init(Cluster.java:162) at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:333) at com.datastax.driver.core.Cluster.connectAsync(Cluster.java:308) at com.datastax.driver.core.Cluster.connect(Cluster.java:250) {noformat} Something to note is that we did not have SSL enabled while connecting and also that this stopped working when going from versions 2.1.9 -> 3.0.0. There is a different netty version between the two, 4.0.27.Final and 4.0.33.Final. The problem seems to be that in netty-common there is an OSGI package import for *javax.security.cert* which is not imported in the shaded java driver. The fix would be to add javax.security.cert to the import package of the shaded java driver. This problem will probably affect version 2.1 of the java driver as well, but there hasn't been a release with the newer netty version yet.

    DataStax JIRA | 1 year ago | Marcus Olsson
    java.lang.NoClassDefFoundError: javax/security/cert/X509Certificate

    Root Cause Analysis

    1. java.lang.NoClassDefFoundError

      javax/security/cert/X509Certificate

      at com.datastax.shaded.netty.util.internal.EmptyArrays.<clinit>()
    2. DataStax Java Driver for Apache Cassandra - Core
      EmptyArrays.<clinit>
      1. com.datastax.shaded.netty.util.internal.EmptyArrays.<clinit>(EmptyArrays.java:40)
      1 frame
    3. com.datastax.shaded
      GlobalEventExecutor.<clinit>
      1. com.datastax.shaded.netty.util.concurrent.DefaultPromise.<clinit>(DefaultPromise.java:44)
      2. com.datastax.shaded.netty.util.concurrent.GlobalEventExecutor.<init>(GlobalEventExecutor.java:44)
      3. com.datastax.shaded.netty.util.concurrent.GlobalEventExecutor.<clinit>(GlobalEventExecutor.java:41)
      3 frames
    4. DataStax Java Driver for Apache Cassandra - Core
      Cluster.connect
      1. com.datastax.driver.core.Connection$Factory.<init>(Connection.java:684)
      2. com.datastax.driver.core.Cluster$Manager.init(Cluster.java:1365)
      3. com.datastax.driver.core.Cluster.init(Cluster.java:162)
      4. com.datastax.driver.core.Cluster.connectAsync(Cluster.java:333)
      5. com.datastax.driver.core.Cluster.connectAsync(Cluster.java:308)
      6. com.datastax.driver.core.Cluster.connect(Cluster.java:250)
      6 frames