[
https://issues.apache.org/jira/browse/HBASE-24539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17133640#comment-17133640
]
Bharath Vissapragada commented on HBASE-24539:
----------------------------------------------
[~phrocker] I already had a patch for this, so I put it up for review [1].
Sorry, didn't realize that it was not assigned to me. Feel free to
review/reuse/build on top of it. Anything is fine with me. Just publishing it
out there incase it saves some time for you.
[1] https://github.com/apache/hbase-native-client/pull/4
> Fix the classpath for the local mini-cluster
> --------------------------------------------
>
> Key: HBASE-24539
> URL: https://issues.apache.org/jira/browse/HBASE-24539
> Project: HBase
> Issue Type: Sub-task
> Components: Client, native-client
> Affects Versions: 3.0.0-alpha-1
> Reporter: Bharath Vissapragada
> Assignee: Marc Parisi
> Priority: Major
>
> The classpath is created assuming the native-client is a module of the parent
> hbase repo. Since that is not the case anymore and we rely on a dynamically
> pulled HBase version, we need to fix the classpath for the JVM that is spun
> using JNI. Otherwise mini-cluster won't start..
> {noformat}
> using hbase::MiniCluster;
> JNIEnv *MiniCluster::CreateVM(JavaVM **jvm) {
> JavaVMInitArgs args;
> JavaVMOption jvm_options;
> args.version = JNI_VERSION_1_6;
> args.nOptions = 1;
> char *classpath = getenv("CLASSPATH");
> std::string clspath;
> if (classpath == NULL || strstr(classpath, "-tests.jar") == NULL) {
> std::string
> clsPathFilePath("../../../hbase-build-configuration/target/cached_classpath.txt");
> std::ifstream fd(clsPathFilePath);
> std::string prefix("");
> if (fd.is_open()) {
> if (classpath == NULL) {
> LOG(INFO) << "got empty classpath";
> } else {
> // prefix bootstrapper.jar
> prefix.assign(classpath);
> }
> std::string line;
> {noformat}
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)