RE: [ #11082] RE: Maven repo: library versions

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

RE: [ #11082] RE: Maven repo: library versions


+Hbase, Karaf


Following are the version detail:

Karaf: 3.0.3

Java: 1.7

HBase: 1.0.1

Our project:


Summarizing the issue again.

Our project runs in karaf container. We have HBase installed in the same machine where karaf is running. When our feature (project) comes up, we connect to the HBase server via hbase-client. With Hbase 0.94.*, our feature runs without any issues.


We are trying to use latest/stable HBase version - 1.0.1. We observe the classes that belongs to single JAR is splitted into hbase-client.jar and hbase-common.jar in 1.0.1. Compilation goes fine after adding all required changes in build artifacts etc (enclosed the diff) to point to 1.0.1. After bringing up the karaf and when we install our feature, it fails with ClassNotFoundException as shown in my email below.


Code pointer which initiates the connect to HBase server:


Could someone shed some light on the approach?





From: Sethuraman, Hariharan
Sent: Sunday, May 24, 2015 11:26 PM
To: '[hidden email]'
Cc: C, Yuling; '[hidden email]'; [hidden email]; Venkataraghavan, C
Subject: RE: [ #11082] RE: Maven repo: library versions




I continued with higher hbase version (1.0.1) and hitting the next issue.


java.lang.Exception: Error creating table.

                at org.opendaylight.tsdr.persistence.hbase.HBaseDataStore.createTable([303:org.opendaylight.tsdr.persistence-hbase:1.0.0.SNAPSHOT]


Caused by: java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/HBaseConfiguration

                at org.opendaylight.tsdr.persistence.hbase.HBaseDataStore.createTable([303:org.opendaylight.tsdr.persistence-hbase:1.0.0.SNAPSHOT]

                ... 10 more

Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hbase.HBaseConfiguration

                at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal([org.eclipse.osgi-3.8.2.v20130124-134944.jar:]

                at org.eclipse.osgi.internal.loader.BundleLoader.findClass([org.eclipse.osgi-3.8.2.v20130124-134944.jar:]

                at org.eclipse.osgi.internal.loader.BundleLoader.findClass([org.eclipse.osgi-3.8.2.v20130124-134944.jar:]

                at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass([org.eclipse.osgi-3.8.2.v20130124-134944.jar:]

                at java.lang.ClassLoader.loadClass([:1.7.0_75]

                ... 11 more


I have included both hbase-common and hbase-client as dependencies in persistence-hbase/pom.xml. Is the package org.apache.hbase.hadoop which exists in both hbase-common and hbase-client libraries is the root cause? Because when the classes from hbase-client is loaded first and class-loaders probably is disallowing the classes from hbase-common to be loaded into JVM sandbox!!


Attached the code diff and hbase-common,hbase-client’s common package sample screenshot  below.




I think normally we could write our own class-loader and handle this situation. I don’t know how to solve in karaf(osgi) environment. Please shed some light.




P.S: I tried to change the dependency/feature orders in pom.xml, feature.xml and seeing no change from the above behavior.


diff.txt (6K) Download Attachment