phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Batyrshin <0x62...@gmail.com>
Subject Re: phoenix-4.15.0: Could not load/instantiate class org.apache.phoenix.query.DefaultGuidePostsCacheFactory
Date Wed, 22 Jan 2020 10:19:38 GMT
Solved by changing pack type from fat (uber) jar to thin jar via Scala sbt-pack plugin.

> On 22 Jan 2020, at 00:29, Alexander Batyrshin <0x62ash@gmail.com> wrote:
> 
> Thank you for response. I will take a look at information about ServiceLoader
> 
>> 21 янв. 2020 г., в 23:32, Daniel Wong <daniel.wong@salesforce.com.invalid>
написал(а):
>> 
>> Hi this uses the java Services framework in order to load a defined class
>> at runtime based on the users configuration.  I'm not too familiar with
>> Scala but the java documentation for ServiceLoader is here:
>> https://docs.oracle.com/javase/9/docs/api/java/util/ServiceLoader.html.
>> Depending on your security or other settings there is a possibility for
>> issues finding the class. For example in Presto Phoenix Connector I believe
>> the following change had to be made in order to get the presto connector
>> run.
>> https://github.com/prestosql/presto/commit/30539e200ad0c4809afd2a9b178998829b548e2e
>> 
>>> On Tue, Jan 21, 2020 at 12:08 PM Alexander Batyrshin <0x62ash@gmail.com>
>>> wrote:
>>> 
>>> Looks like I hit issue https://issues.apache.org/jira/browse/PHOENIX-5231
>>> <https://issues.apache.org/jira/browse/PHOENIX-5231>
>>> My scala application builds without any problem agains phoenix 4.13.x and
>>> 4.14.x.
>>> But got run-time problem with 4.15.0:
>>> 
>>> Caused by:
>>> org.apache.phoenix.exception.PhoenixNonRetryableRuntimeException: Could not
>>> load/instantiate class
>>> org.apache.phoenix.query.DefaultGuidePostsCacheFactory
>>>       at
>>> org.apache.phoenix.query.GuidePostsCacheProvider.loadAndGetGuidePostsCacheFactory(GuidePostsCacheProvider.java:57)
>>>       at
>>> org.apache.phoenix.query.GuidePostsCacheProvider.getGuidePostsCache(GuidePostsCacheProvider.java:73)
>>>       at
>>> org.apache.phoenix.query.ConnectionQueryServicesImpl.<init>(ConnectionQueryServicesImpl.java:433)
>>>       at
>>> org.apache.phoenix.jdbc.PhoenixDriver$3.call(PhoenixDriver.java:248)
>>>       at
>>> org.apache.phoenix.jdbc.PhoenixDriver$3.call(PhoenixDriver.java:241)
>>>       at
>>> com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4796)
>>>       at
>>> com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3589)
>>>       at
>>> com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2374)
>>>       at
>>> com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2337)
>>>       at
>>> com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2252)
>>>       at com.google.common.cache.LocalCache.get(LocalCache.java:3990)
>>>       at
>>> com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4793)
>>>       at
>>> org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:241)
>>>       at
>>> org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.createConnection(PhoenixEmbeddedDriver.java:142)
>>>       at
>>> org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:221)
>>>       at java.sql.DriverManager.getConnection(DriverManager.java:664)
>>>       at java.sql.DriverManager.getConnection(DriverManager.java:208)
>>>       at PhoenixWriter.<init>(PhoenixWriter.scala:29)
>>> 
>>> Any ideas how to build scala application with phoenix-4.15.0?
>>> 
>>> My build dependency for Scala application is:
>>> 
>>> libraryDependencies ++= Seq(
>>> "org.apache.logging.log4j"    %% "log4j-api-scala"        % "11.0",
>>> "org.apache.logging.log4j"    % "log4j-api"               % "2.8.2",
>>> "org.apache.logging.log4j"    % "log4j-core"              % "2.8.2" %
>>> Runtime,
>>> "org.apache.hadoop"           % "hadoop-common"           % "2.9.0",
>>> "org.apache.hadoop"           % "hadoop-client"           % "2.9.0",
>>> "org.apache.hbase"            % "hbase"                   % "1.4.12",
>>> "org.apache.hbase"            % "hbase-client"            % "1.4.12",
>>> "org.apache.hbase"            % "hbase-common"            % "1.4.12",
>>> "org.apache.hbase"            % "hbase-server"            % "1.4.12",
>>> 
>>> "org.apache.phoenix"          % "phoenix"                 %
>>> "4.15.0-HBase-1.4",
>>> "org.apache.phoenix"          % "phoenix-core"            %
>>> "4.15.0-HBase-1.4",
>>> )
>>> 
>>> assemblyMergeStrategy in assembly := {
>>> case PathList("META-INF", xs @ _*) => MergeStrategy.discard
>>> case x => MergeStrategy.first
>>> }
>> 
>> 
>> 
>> -- 
>> Daniel Wong
>> Salesforce
>> Mobile: 628.217.1808


Mime
View raw message