[ https://issues.apache.org/jira/browse/HBASE-13889?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14692493#comment-14692493 ]
Nick Dimiduk commented on HBASE-13889: -------------------------------------- Trying the latest patch with Dmitry's project (https://github.com/dminkovsky/HBASE-13889.git). Works for me using his *unshaded* artifact. All the logging and htrace stuff was to be expected. I'm not sure what we should expect with getting into shading the shaded dependencies... Anyway, +1, thanks a lot [~eclark]. {noformat} diff --git a/pom.xml b/pom.xml index c37d77c..9ab0e19 100644 --- a/pom.xml +++ b/pom.xml @@ -18,7 +18,7 @@ <dependency> <groupId>org.apache.hbase</groupId> <artifactId>hbase-shaded-client</artifactId> - <version>2.0.0-SNAPSHOT</version> + <version>1.1.2-SNAPSHOT</version> </dependency> </dependencies> diff --git a/src/main/java/com/mycompany/app/App.java b/src/main/java/com/mycompany/app/App.java index 1a0100d..c659a6f 100644 --- a/src/main/java/com/mycompany/app/App.java +++ b/src/main/java/com/mycompany/app/App.java @@ -11,8 +11,11 @@ import org.apache.hadoop.hbase.TableName; public class App { public static void main(String[] args) throws java.io.IOException { + System.out.println("creating configuration"); Configuration config = HBaseConfiguration.create(); + System.out.println("opening connection"); Connection connection = ConnectionFactory.createConnection(config); + System.out.println("getting table"); Table table = connection.getTable(TableName.valueOf("users")); Put put = new Put(Bytes.toBytes("hello")); put.addColumn( @@ -20,5 +23,7 @@ public class App { Bytes.toBytes("name"), Bytes.toBytes("user") ); + System.out.println("writing data"); + table.put(put); } } {noformat} {noformat} $ java -cp /Users/ndimiduk/.m2/repository/org/apache/hbase/hbase-shaded-client/1.1.2-SNAPSHOT/hbase-shaded-client-1.1.2-SNAPSHOT.jar:/Users/ndimiduk/.m2/repository/commons-logging/commons-logging/1.2/commons-logging-1.2.jar:/Users/ndimiduk/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar:/Users/ndimiduk/.m2/repository/org/slf4j/slf4j-api/1.7.7/slf4j-api-1.7.7.jar:/Users/ndimiduk/.m2/repository/org/slf4j/slf4j-log4j12/1.7.7/slf4j-log4j12-1.7.7.jar:/Users/ndimiduk/.m2/repository/org/apache/htrace/htrace-core/3.1.0-incubating/htrace-core-3.1.0-incubating.jar:./target/original-my-app-1.0-SNAPSHOT.jar:/Users/ndimiduk/repos/hbase/conf/log4j.properties com.mycompany.app.App creating configuration opening connection log4j:WARN No appenders could be found for logger (org.apache.hadoop.metrics2.lib.MutableMetricsFactory). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. getting table writing data {noformat} {noformat} hbase(main):003:0> scan 'users' ROW COLUMN+CELL hello column=d:name, timestamp=1439335737899, value=user 1 row(s) in 0.0770 seconds hbase(main):004:0> {noformat} > Fix hbase-shaded-client artifact so it works on hbase-downstreamer > ------------------------------------------------------------------ > > Key: HBASE-13889 > URL: https://issues.apache.org/jira/browse/HBASE-13889 > Project: HBase > Issue Type: Bug > Components: Client > Affects Versions: 1.1.0, 1.1.0.1 > Environment: N/A? > Reporter: Dmitry Minkovsky > Assignee: Elliott Clark > Priority: Critical > Fix For: 2.0.0, 1.3.0, 1.2.1, 1.1.3 > > Attachments: 13889.wip.patch, HBASE-13889.patch, HBASE-13889.patch, > Screen Shot 2015-06-11 at 10.59.55 AM.png > > > The {{hbase-shaded-client}} artifact was introduced in > [HBASE-13517|https://issues.apache.org/jira/browse/HBASE-13517]. Thank you > very much for this, as I am new to Java building and was having a very > slow-moving time resolving conflicts. However, the shaded client artifact > seems to be missing {{javax.xml.transform.TransformerException}}. I examined > the JAR, which does not have this package/class. > Steps to reproduce: > Java: > {code} > package com.mycompany.app; > > > > > > import org.apache.hadoop.conf.Configuration; > > > import org.apache.hadoop.hbase.HBaseConfiguration; > > > import org.apache.hadoop.hbase.client.Connection; > > > import org.apache.hadoop.hbase.client.ConnectionFactory; > > > > > > public class App { > > > public static void main( String[] args ) throws java.io.IOException { > > > > Configuration config = HBaseConfiguration.create(); > > > Connection connection = ConnectionFactory.createConnection(config); > > > } > > > } > {code} > POM: > {code} > <project xmlns="http://maven.apache.org/POM/4.0.0" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 > http://maven.apache.org/xsd/maven-4.0.0.xsd"> > > <modelVersion>4.0.0</modelVersion> > > > > > > <groupId>com.mycompany.app</groupId> > > > <artifactId>my-app</artifactId> > > > <version>1.0-SNAPSHOT</version> > > > <packaging>jar</packaging> > > > > > > <name>my-app</name> > > > <url>http://maven.apache.org</url> > > > > > > <properties> > > > <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> > > > </properties> > > > > > > <dependencies> > > > <dependency> > > > <groupId>junit</groupId> > > > <artifactId>junit</artifactId> > > > <version>3.8.1</version> > > > <scope>test</scope> > > > </dependency> > > > <dependency> > > > <groupId>org.apache.hbase</groupId> > > > <artifactId>hbase-shaded-client</artifactId> > > > <version>1.1.0</version> > > > </dependency> > > > </dependencies> > > > </project> > {code} > Run: > {noformat} > $ mvn exec:java -Dexec.mainClass="com.mycompany.app.App" > [INFO] Scanning for projects... > [INFO] > > [INFO] > ------------------------------------------------------------------------ > [INFO] Building my-app 1.0-SNAPSHOT > [INFO] > ------------------------------------------------------------------------ > [INFO] > [INFO] --- exec-maven-plugin:1.4.0:java (default-cli) @ my-app --- > [WARNING] > java.lang.reflect.InvocationTargetException > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:293) > at java.lang.Thread.run(Thread.java:745) > Caused by: java.lang.NoClassDefFoundError: > org/apache/hadoop/hbase/shaded/javax/xml/transform/TransformerException > at com.mycompany.app.App.main(App.java:17) > ... 6 more > Caused by: java.lang.ClassNotFoundException: > org.apache.hadoop.hbase.shaded.javax.xml.transform.TransformerException > at java.net.URLClassLoader$1.run(URLClassLoader.java:366) > at java.net.URLClassLoader$1.run(URLClassLoader.java:355) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(URLClassLoader.java:354) > at java.lang.ClassLoader.loadClass(ClassLoader.java:425) > at java.lang.ClassLoader.loadClass(ClassLoader.java:358) > ... 7 more > [INFO] > ------------------------------------------------------------------------ > [INFO] BUILD FAILURE > [INFO] > ------------------------------------------------------------------------ > [INFO] Total time: 2.388 s > [INFO] Finished at: 2015-06-11T13:23:21-04:00 > [INFO] Final Memory: 10M/111M > [INFO] > ------------------------------------------------------------------------ > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)