Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1476

MongoDB Adapter example leads to Exception

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.10.0
    • Fix Version/s: 1.11.0
    • Component/s: mongodb-adapter
    • Labels:
      None

      Description

      Iam trying to run the MongoDB adapter example.

      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESS
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 5.415 s
      [INFO] Finished at: 2016-10-31T08:48:14+01:00
      [INFO] Final Memory: 27M/310M
      [INFO] ------------------------------------------------------------------------
      sqlline version 1.1.9
      sqlline> !connect jdbc:calcite:model=mongodb/target/test-classes/mongo-zips-model.json admin admin
      SLF4J: Class path contains multiple SLF4J bindings.
      SLF4J: Found binding in [jar:file:/C:/Users/Julian/Desktop/calcite/core/target/dependencies/slf4j-log4j12-1.7.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      SLF4J: Found binding in [jar:file:/C:/Users/Julian/Desktop/calcite/cassandra/target/dependencies/slf4j-log4j12-1.7.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      SLF4J: Found binding in [jar:file:/C:/Users/Julian/Desktop/calcite/mongodb/target/dependencies/slf4j-log4j12-1.7.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      SLF4J: Found binding in [jar:file:/C:/Users/Julian/Desktop/calcite/spark/target/dependencies/slf4j-log4j12-1.7.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      SLF4J: Found binding in [jar:file:/C:/Users/Julian/Desktop/calcite/splunk/target/dependencies/slf4j-log4j12-1.7.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
      SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
      Connecting to jdbc:calcite:model=mongodb/target/test-classes/mongo-zips-model.json
      java.lang.RuntimeException: Error instantiating JsonCustomSchema(name=mongo_raw)
      at org.apache.calcite.model.ModelHandler.visit(ModelHandler.java:220)
      at org.apache.calcite.model.JsonCustomSchema.accept(JsonCustomSchema.java:45)
      at org.apache.calcite.model.ModelHandler.visit(ModelHandler.java:143)
      at org.apache.calcite.model.ModelHandler.<init>(ModelHandler.java:85)
      at org.apache.calcite.jdbc.Driver$1.onConnectionInit(Driver.java:104)
      at org.apache.calcite.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:145)
      at sqlline.DatabaseConnection.connect(DatabaseConnection.java:157)
      at sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:203)
      at sqlline.Commands.connect(Commands.java:1064)
      at sqlline.Commands.connect(Commands.java:996)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:36)
      at sqlline.SqlLine.dispatch(SqlLine.java:803)
      at sqlline.SqlLine.begin(SqlLine.java:681)
      at sqlline.SqlLine.start(SqlLine.java:398)
      at sqlline.SqlLine.main(SqlLine.java:292)
      Caused by: java.lang.RuntimeException: Property 'org.apache.calcite.adapter.mongodb.MongoSchemaFactory' not valid for plugin type org.apache.calcite.schema.SchemaFactory
      at org.apache.calcite.avatica.AvaticaUtils.instantiatePlugin(AvaticaUtils.java:207)
      at org.apache.calcite.model.ModelHandler.visit(ModelHandler.java:211)
      ... 18 more
      Caused by: java.lang.ClassNotFoundException: org.apache.calcite.adapter.mongodb.MongoSchemaFactory
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Unknown Source)
      at org.apache.calcite.avatica.AvaticaUtils.instantiatePlugin(AvaticaUtils.java:195)
      ... 19 more

      Its a clean install at the newest version. CSV example works fine.

      greeting
      Julian

        Attachments

          Activity

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              JulianS91 Julian Stenzel
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: