You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2016/11/01 20:22:58 UTC

[jira] [Commented] (CALCITE-1476) MongoDB Adapter example leads to Exception

    [ https://issues.apache.org/jira/browse/CALCITE-1476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15626567#comment-15626567 ] 

Julian Hyde commented on CALCITE-1476:
--------------------------------------

It works for me, but I'm running {{sqlline}} on macOS and I suspect that you're running {{sqlline.bat}} on Windows. ({{sqlline.bat}} tends to get less love, I'm afraid.) {{sqlline.bat}} looks OK to me, including the {{mongodb\target\dependencies\*;}} as part of the class path. Try removing {{target\dependencies}} and re-running {{sqlline.bat}} and see if that improves things.

> MongoDB Adapter example leads to Exception
> ------------------------------------------
>
>                 Key: CALCITE-1476
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1476
>             Project: Calcite
>          Issue Type: Bug
>          Components: mongodb
>    Affects Versions: 1.10.0
>            Reporter: Julian Stenzel
>            Assignee: Julian Hyde
>            Priority: Minor
>
> Iam trying to run the MongoDB adapter example. 
> {panel}
> [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
> {panel}
> Its a clean install at the newest version. CSV example works fine.
> greeting 
> Julian



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)