[ 
https://issues.apache.org/jira/browse/DRILL-4931?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16374140#comment-16374140
 ] 

Hasyimi Bahrudin edited comment on DRILL-4931 at 2/23/18 9:53 AM:
------------------------------------------------------------------

Still a problem in Drill 1.12.

Looking at log/sqlline.log, I can see the following error:
{noformat}
2018-02-23 17:24:17,502 [main] WARN o.a.drill.exec.util.GuavaPatcher - Unable 
to patch Guava classes.
javassist.CannotCompileException: by java.lang.LinkageError: loader (instance 
of sun/misc/Launcher$AppClassLoader): attempted duplicate class definition for 
name: "com/google/common/base/Stopwatch"
at javassist.ClassPool.toClass(ClassPool.java:1099) 
~[javassist-3.16.1-GA.jar:na]
at javassist.ClassPool.toClass(ClassPool.java:1042) 
~[javassist-3.16.1-GA.jar:na]
at javassist.ClassPool.toClass(ClassPool.java:1000) 
~[javassist-3.16.1-GA.jar:na]
at javassist.CtClass.toClass(CtClass.java:1140) ~[javassist-3.16.1-GA.jar:na]
at org.apache.drill.exec.util.GuavaPatcher.patchStopwatch(GuavaPatcher.java:66) 
~[drill-java-exec-1.12.0.jar:1.12.0]
at org.apache.drill.exec.util.GuavaPatcher.patch(GuavaPatcher.java:36) 
~[drill-java-exec-1.12.0.jar:1.12.0]
at org.apache.drill.exec.server.Drillbit.<clinit>(Drillbit.java:69) 
[drill-java-exec-1.12.0.jar:1.12.0]
at 
org.apache.drill.jdbc.impl.DrillConnectionImpl.<init>(DrillConnectionImpl.java:132)
 [drill-jdbc-1.12.0.jar:1.12.0]
at 
org.apache.drill.jdbc.impl.DrillJdbc41Factory.newDrillConnection(DrillJdbc41Factory.java:72)
 [drill-jdbc-1.12.0.jar:1.12.0]
at org.apache.drill.jdbc.impl.DrillFactory.newConnection(DrillFactory.java:69) 
[drill-jdbc-1.12.0.jar:1.12.0]
at 
org.apache.calcite.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:144)
 [calcite-avatica-1.4.0-drill-r23.jar:1.4.0-drill-r23]
at org.apache.drill.jdbc.Driver.connect(Driver.java:72) 
[drill-jdbc-1.12.0.jar:1.12.0]
at sqlline.DatabaseConnection.connect(DatabaseConnection.java:167) 
[sqlline-1.1.9-drill-r7.jar:na]
at sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:213) 
[sqlline-1.1.9-drill-r7.jar:na]
at sqlline.Commands.connect(Commands.java:1083) [sqlline-1.1.9-drill-r7.jar:na]
at sqlline.Commands.connect(Commands.java:1015) [sqlline-1.1.9-drill-r7.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_151]
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
~[na:1.8.0_151]
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 ~[na:1.8.0_151]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151]
at sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:36) 
[sqlline-1.1.9-drill-r7.jar:na]
at sqlline.SqlLine.dispatch(SqlLine.java:742) [sqlline-1.1.9-drill-r7.jar:na]
at sqlline.SqlLine.initArgs(SqlLine.java:528) [sqlline-1.1.9-drill-r7.jar:na]
at sqlline.SqlLine.begin(SqlLine.java:596) [sqlline-1.1.9-drill-r7.jar:na]
at sqlline.SqlLine.start(SqlLine.java:375) [sqlline-1.1.9-drill-r7.jar:na]
at sqlline.SqlLine.main(SqlLine.java:268) [sqlline-1.1.9-drill-r7.jar:na]
Caused by: java.lang.LinkageError: loader (instance of 
sun/misc/Launcher$AppClassLoader): attempted duplicate class definition for 
name: "com/google/common/base/Stopwatch"
at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_151]
at java.lang.ClassLoader.defineClass(ClassLoader.java:763) ~[na:1.8.0_151]
at java.lang.ClassLoader.defineClass(ClassLoader.java:642) ~[na:1.8.0_151]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_151]
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
~[na:1.8.0_151]
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 ~[na:1.8.0_151]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151]
at javassist.ClassPool.toClass2(ClassPool.java:1112) 
~[javassist-3.16.1-GA.jar:na]
at javassist.ClassPool.toClass(ClassPool.java:1093) 
~[javassist-3.16.1-GA.jar:na]
... 25 common frames omitted
{noformat}
 

So it seems that the patching is failing, which I assume is because the 
Stopwatch class has already been loaded prior to the patching, which causes the 
duplicate class definition error 
([https://stackoverflow.com/questions/40105981/changing-a-class-with-javassist-java-reflexion]).

 

Moving forward, I think to fix this issue, we should update the HBase client 
version (currently at 1.1.3), since HBase client no longer uses Stopwatch 
(https://issues.apache.org/jira/browse/HBASE-14963). Is there any reason why 
we're still using 1.1.3?


was (Author: hasyimibhar):
Still a problem in Drill 1.12.

Looking at log/sqlline.log, I can see the following error:
{noformat}
2018-02-23 17:24:17,502 [main] WARN o.a.drill.exec.util.GuavaPatcher - Unable 
to patch Guava classes.
javassist.CannotCompileException: by java.lang.LinkageError: loader (instance 
of sun/misc/Launcher$AppClassLoader): attempted duplicate class definition for 
name: "com/google/common/base/Stopwatch"
at javassist.ClassPool.toClass(ClassPool.java:1099) 
~[javassist-3.16.1-GA.jar:na]
at javassist.ClassPool.toClass(ClassPool.java:1042) 
~[javassist-3.16.1-GA.jar:na]
at javassist.ClassPool.toClass(ClassPool.java:1000) 
~[javassist-3.16.1-GA.jar:na]
at javassist.CtClass.toClass(CtClass.java:1140) ~[javassist-3.16.1-GA.jar:na]
at org.apache.drill.exec.util.GuavaPatcher.patchStopwatch(GuavaPatcher.java:66) 
~[drill-java-exec-1.12.0.jar:1.12.0]
at org.apache.drill.exec.util.GuavaPatcher.patch(GuavaPatcher.java:36) 
~[drill-java-exec-1.12.0.jar:1.12.0]
at org.apache.drill.exec.server.Drillbit.<clinit>(Drillbit.java:69) 
[drill-java-exec-1.12.0.jar:1.12.0]
at 
org.apache.drill.jdbc.impl.DrillConnectionImpl.<init>(DrillConnectionImpl.java:132)
 [drill-jdbc-1.12.0.jar:1.12.0]
at 
org.apache.drill.jdbc.impl.DrillJdbc41Factory.newDrillConnection(DrillJdbc41Factory.java:72)
 [drill-jdbc-1.12.0.jar:1.12.0]
at org.apache.drill.jdbc.impl.DrillFactory.newConnection(DrillFactory.java:69) 
[drill-jdbc-1.12.0.jar:1.12.0]
at 
org.apache.calcite.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:144)
 [calcite-avatica-1.4.0-drill-r23.jar:1.4.0-drill-r23]
at org.apache.drill.jdbc.Driver.connect(Driver.java:72) 
[drill-jdbc-1.12.0.jar:1.12.0]
at sqlline.DatabaseConnection.connect(DatabaseConnection.java:167) 
[sqlline-1.1.9-drill-r7.jar:na]
at sqlline.DatabaseConnection.getConnection(DatabaseConnection.java:213) 
[sqlline-1.1.9-drill-r7.jar:na]
at sqlline.Commands.connect(Commands.java:1083) [sqlline-1.1.9-drill-r7.jar:na]
at sqlline.Commands.connect(Commands.java:1015) [sqlline-1.1.9-drill-r7.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_151]
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
~[na:1.8.0_151]
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 ~[na:1.8.0_151]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151]
at sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:36) 
[sqlline-1.1.9-drill-r7.jar:na]
at sqlline.SqlLine.dispatch(SqlLine.java:742) [sqlline-1.1.9-drill-r7.jar:na]
at sqlline.SqlLine.initArgs(SqlLine.java:528) [sqlline-1.1.9-drill-r7.jar:na]
at sqlline.SqlLine.begin(SqlLine.java:596) [sqlline-1.1.9-drill-r7.jar:na]
at sqlline.SqlLine.start(SqlLine.java:375) [sqlline-1.1.9-drill-r7.jar:na]
at sqlline.SqlLine.main(SqlLine.java:268) [sqlline-1.1.9-drill-r7.jar:na]
Caused by: java.lang.LinkageError: loader (instance of 
sun/misc/Launcher$AppClassLoader): attempted duplicate class definition for 
name: "com/google/common/base/Stopwatch"
at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_151]
at java.lang.ClassLoader.defineClass(ClassLoader.java:763) ~[na:1.8.0_151]
at java.lang.ClassLoader.defineClass(ClassLoader.java:642) ~[na:1.8.0_151]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_151]
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
~[na:1.8.0_151]
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 ~[na:1.8.0_151]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151]
at javassist.ClassPool.toClass2(ClassPool.java:1112) 
~[javassist-3.16.1-GA.jar:na]
at javassist.ClassPool.toClass(ClassPool.java:1093) 
~[javassist-3.16.1-GA.jar:na]
... 25 common frames omitted
{noformat}
 

So it seems that the patching is failing, which I assume is because the 
Stopwatch class has already been loaded prior to the patching, which causes the 
duplicate class definition error 
([https://stackoverflow.com/questions/40105981/changing-a-class-with-javassist-java-reflexion]).

 

Moving forward, I think to fix this issue, we should update the HBase client 
version (currently at 1.1.3), since HBase client no longer uses Stopwatch 
(https://issues.apache.org/jira/browse/HBASE-14963).

> Attempting to execute a SELECT against an HBase store results in an 
> IllegalAccessError accessing method 
> "com.google.common.base.Stopwatch.<init>()"
> ---------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DRILL-4931
>                 URL: https://issues.apache.org/jira/browse/DRILL-4931
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Storage - HBase
>    Affects Versions: 1.8.0
>            Reporter: T.C. Hydock
>            Priority: Major
>
> I was attempting to follow the "Querying HBase Data" tutorial 
> (https://drill.apache.org/docs/querying-hbase/) against one of our HBase 
> instances and ran into the following error when trying to issue the "SELECT * 
> FROM students;" statement cited in Step #2 of the "Query HBase Tables" 
> section:
> {noformat}
> Error: SYSTEM ERROR: IllegalAccessError: tried to access method 
> com.google.common.base.Stopwatch.<init>()V from class 
> org.apache.hadoop.hbase.zookeeper.MetaTableLocator
> {noformat}
> After doing some research it appears to be a conflict with instantiating the 
> Stopwatch class from the Guava JAR.  I was able to resolve this by swapping 
> out the packaged version of Guava (v18) with an older version (v16).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to