Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2701

ClientMetadataHelper.getDriverVersion throws NullPointerException

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.6.1
    • Affects Version/s: 3.6.0
    • Component/s: Wire Protocol
    • None

      I am trying to run a topology code in storm that uses mongoclient.
      Upon submitting the command storm jar <jarname> <mainclass>, I am getting following null pointer in the mongo client.

      java.lang.NullPointerException
      at com.mongodb.connection.ClientMetadataHelper.getDriverVersion(ClientMetadataHelper.java:117) ~[stormjar.jar:?]
      at com.mongodb.connection.ClientMetadataHelper.getDriverInformation(ClientMetadataHelper.java:214) ~[stormjar.jar:?]
      at com.mongodb.connection.ClientMetadataHelper.addDriverInformation(ClientMetadataHelper.java:195) ~[stormjar.jar:?]
      at com.mongodb.connection.ClientMetadataHelper.<clinit>(ClientMetadataHelper.java:65) ~[stormjar.jar:?]
      ... 50 more

      Complete stack trace:
      2017-12-12T17:23:03.764+0530 worker [ERROR] Error on initialization of server mk-worker
      java.lang.ExceptionInInitializerError
      at com.mongodb.connection.InternalStreamConnectionFactory.<init>(InternalStreamConnectionFactory.java:45) ~[stormjar.jar:?]
      at com.mongodb.connection.DefaultClusterableServerFactory.create(DefaultClusterableServerFactory.java:64) ~[stormjar.jar:?]
      at com.mongodb.connection.BaseCluster.createServer(BaseCluster.java:364) ~[stormjar.jar:?]
      at com.mongodb.connection.SingleServerCluster.<init>(SingleServerCluster.java:52) ~[stormjar.jar:?]
      at com.mongodb.connection.DefaultClusterFactory.createCluster(DefaultClusterFactory.java:181) ~[stormjar.jar:?]
      at com.mongodb.Mongo.createCluster(Mongo.java:738) ~[stormjar.jar:?]
      at com.mongodb.Mongo.createCluster(Mongo.java:732) ~[stormjar.jar:?]
      at com.mongodb.Mongo.<init>(Mongo.java:298) ~[stormjar.jar:?]
      at com.mongodb.Mongo.<init>(Mongo.java:293) ~[stormjar.jar:?]
      at com.mongodb.Mongo.<init>(Mongo.java:289) ~[stormjar.jar:?]
      at com.mongodb.MongoClient.<init>(MongoClient.java:191) ~[stormjar.jar:?]
      at com.mongodb.MongoClient.<init>(MongoClient.java:166) ~[stormjar.jar:?]
      at com.mongodb.MongoClient.<init>(MongoClient.java:156) ~[stormjar.jar:?]
      at com.flipkart.alchemist.hooks.AffAbstractModule.configure(AffAbstractModule.java:46) ~[stormjar.jar:?]
      at com.google.inject.AbstractModule.configure(AbstractModule.java:62) ~[stormjar.jar:?]
      at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:340) ~[stormjar.jar:?]
      at com.google.inject.spi.Elements.getElements(Elements.java:110) ~[stormjar.jar:?]
      at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:138) ~[stormjar.jar:?]
      at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:104) ~[stormjar.jar:?]
      at com.google.inject.Guice.createInjector(Guice.java:99) ~[stormjar.jar:?]
      at com.google.inject.Guice.createInjector(Guice.java:73) ~[stormjar.jar:?]
      at com.google.inject.Guice.createInjector(Guice.java:62) ~[stormjar.jar:?]
      at com.flipkart.alchemist.hooks.AffWorkerHook.start(AffWorkerHook.java:26) ~[stormjar.jar:?]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_92]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_92]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_92]
      at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_92]
      at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93) ~[clojure-1.7.0.jar:?]
      at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28) ~[clojure-1.7.0.jar:?]
      at org.apache.storm.daemon.worker$run_worker_start_hooks$iter_84208424$fn_8425.invoke(worker.clj:569) ~[storm-core-1.0.1.jar:1.0.1]
      at clojure.lang.LazySeq.sval(LazySeq.java:40) ~[clojure-1.7.0.jar:?]
      at clojure.lang.LazySeq.seq(LazySeq.java:49) ~[clojure-1.7.0.jar:?]
      at clojure.lang.RT.seq(RT.java:507) ~[clojure-1.7.0.jar:?]
      at clojure.core$seq__4128.invoke(core.clj:137) ~[clojure-1.7.0.jar:?]
      at clojure.core$dorun.invoke(core.clj:3009) ~[clojure-1.7.0.jar:?]
      at clojure.core$doall.invoke(core.clj:3025) ~[clojure-1.7.0.jar:?]
      at org.apache.storm.daemon.worker$run_worker_start_hooks.invoke(worker.clj:566) ~[storm-core-1.0.1.jar:1.0.1]
      at org.apache.storm.daemon.worker$fn_8450$exec_fn2461auto$reify_8452.run(worker.clj:635) ~[storm-core-1.0.1.jar:1.0.1]
      at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_92]
      at javax.security.auth.Subject.doAs(Subject.java:422) ~[?:1.8.0_92]
      at org.apache.storm.daemon.worker$fn_8450$exec_fn2461auto___8451.invoke(worker.clj:609) ~[storm-core-1.0.1.jar:1.0.1]
      at clojure.lang.AFn.applyToHelper(AFn.java:178) ~[clojure-1.7.0.jar:?]
      at clojure.lang.AFn.applyTo(AFn.java:144) ~[clojure-1.7.0.jar:?]
      at clojure.core$apply.invoke(core.clj:630) ~[clojure-1.7.0.jar:?]
      at org.apache.storm.daemon.worker$fn_8450$mk_worker_8545.doInvoke(worker.clj:583) [storm-core-1.0.1.jar:1.0.1]
      at clojure.lang.RestFn.invoke(RestFn.java:512) [clojure-1.7.0.jar:?]
      at org.apache.storm.daemon.worker$_main.invoke(worker.clj:771) [storm-core-1.0.1.jar:1.0.1]
      at clojure.lang.AFn.applyToHelper(AFn.java:165) [clojure-1.7.0.jar:?]
      at clojure.lang.AFn.applyTo(AFn.java:144) [clojure-1.7.0.jar:?]
      at org.apache.storm.daemon.worker.main(Unknown Source) [storm-core-1.0.1.jar:1.0.1]
      Caused by: java.lang.NullPointerException
      at com.mongodb.connection.ClientMetadataHelper.getDriverVersion(ClientMetadataHelper.java:117) ~[stormjar.jar:?]
      at com.mongodb.connection.ClientMetadataHelper.getDriverInformation(ClientMetadataHelper.java:214) ~[stormjar.jar:?]
      at com.mongodb.connection.ClientMetadataHelper.addDriverInformation(ClientMetadataHelper.java:195) ~[stormjar.jar:?]
      at com.mongodb.connection.ClientMetadataHelper.<clinit>(ClientMetadataHelper.java:65) ~[stormjar.jar:?]
      ... 50 more

        1. Error trace
          147 kB
        2. stormtest-shaded.jar
          29.25 MB
        3. stormtest-shaded.jar
          29.25 MB

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            akshay mendole akshay mendole
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: