Quantcast

RE: [opendaylight.org #11082] RE: Maven repo: library versions

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

RE: [opendaylight.org #11082] RE: Maven repo: library versions

Hariharan_Sethuraman

+Hbase, Karaf

 

Following are the version detail:

Karaf: 3.0.3

Java: 1.7

HBase: 1.0.1

Our project: https://github.com/opendaylight/tsdr

 

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: https://github.com/opendaylight/tsdr/blob/master/persistence-hbase/src/main/java/org/opendaylight/tsdr/persistence/hbase/HBaseDataStore.java

 

Could someone shed some light on the approach?

 

Thanks,

Hari

 

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: [opendaylight.org #11082] RE: Maven repo: library versions

 

Hi,

 

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(HBaseDataStore.java:171)[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(HBaseDataStore.java:149)[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(BundleLoader.java:455)[org.eclipse.osgi-3.8.2.v20130124-134944.jar:]

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

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

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

                at java.lang.ClassLoader.loadClass(ClassLoader.java:358)[: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.

 

cid:image001.png@01D0989F.B411ECC0

 

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.

 

Thanks,

Hari

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

<Snipped>


diff.txt (6K) Download Attachment
Loading...