Hey folks - i'm trying to get the jdbc client work...
# getting-started
z
Hey folks - i'm trying to get the jdbc client working but running into an issue:
Copy code
java.lang.NoClassDefFoundError: org/apache/pinot/client/JsonAsyncHttpPinotClientTransportFactory
i've tried running both v0.6.0 (latest) and 0.5.0 (version called out in docs) but both produce the same error. I've also tried compiling the jar from source, as well as including it as an explicit dependency in maven. Any help is appreciated, thanks!
x
can you try to put pinot-java-client.jar into your classpath as well?
z
It is in the classpath. And for what it's worth, i'm not having any issue loading other classes such as
PinotDriver
.
x
hmm, how do you use this jdbc client? @Kartik Khare any idea
k
That's strange. can you try with keeping pinot-all.jar in the classpath
z
Thanks @Xiang Fu and @Kartik Khare.. here's a sample app which demonstrates the issue. This is effectively taking the code from the pinot docs, and adding it to a functioning project.
Copy code
mvn clean test
[INFO] Scanning for projects...
[INFO] 
[INFO] ----------------< org.example:pinot-jdbc-driver-error >-----------------
[INFO] Building pinot-jdbc-driver-error 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ pinot-jdbc-driver-error ---
[INFO] Deleting /Users/zacfarrell/Projects/mode/pinot-jdbc-driver-error/target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ pinot-jdbc-driver-error ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ pinot-jdbc-driver-error ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ pinot-jdbc-driver-error ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/zacfarrell/Projects/mode/pinot-jdbc-driver-error/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ pinot-jdbc-driver-error ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 1 source file to /Users/zacfarrell/Projects/mode/pinot-jdbc-driver-error/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ pinot-jdbc-driver-error ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running PinotTest
log4j:WARN No appenders could be found for logger (org.apache.pinot.client.PinotDriver).
log4j:WARN Please initialize the log4j system properly.
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.042 s <<< FAILURE! - in PinotTest
[ERROR] testIt  Time elapsed: 0.04 s  <<< ERROR!
java.lang.NoClassDefFoundError: org/apache/pinot/client/JsonAsyncHttpPinotClientTransportFactory
        at PinotTest.testIt(PinotTest.java:17)
Caused by: java.lang.ClassNotFoundException: org.apache.pinot.client.JsonAsyncHttpPinotClientTransportFactory
        at PinotTest.testIt(PinotTest.java:17)

[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Errors: 
[ERROR]   PinotTest.testIt:17 » NoClassDefFound org/apache/pinot/client/JsonAsyncHttpPin...
[INFO] 
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.990 s
[INFO] Finished at: 2021-01-21T09:25:48-08:00
[INFO] ------------------------------------------------------------------------
k
@Zac Farrell are you building just the jdbc driver or the whole project?
z
just the jdbc driver
FWIW, this is what i ran from the root directory of
incubator-pinot
source code cloned from github:
mvn package -pl pinot-clients/pinot-jdbc-client -am
k
aah. I think that's the issue. Currently, you will have to build the whole project. The downloaded jar also requires https://mvnrepository.com/artifact/org.apache.pinot/pinot-java-client
Or You can just run
mvn clean package -DskipTests
in
incubator-pinot
repo. Running all the tests will take a lot of time.
z
ok let me give that a try. if
pinot-java-client
is a dependency of
pinot-jdbc-client
, should it be added as such to the pom? Doing that would include
pinot-java-client
when packaging
pinot-jdbc-client
Thanks @Kartik Khare, adding
pinot-java-client
fixed the issue! Thoughts on updating the
pinot-jdbc-client
pom? Or at least updating the docs to mention this?
k
Will update the docs. The dependency was removed due to some issues in older version. Will try to fix this.
z
if you point me to the repo that hosts the docs, i'm happy to make a PR.
x
This is the repo for pinot docs
it will reflect this website: https://docs.pinot.apache.org/