phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Flavio Pompermaier <pomperma...@okkam.it>
Subject Re: Phoenix client maven dependencies
Date Fri, 19 Sep 2014 07:32:44 GMT
This is the final version of what I had to put into my pom.xml to make the
driver work against hadoop-1.2.1...I think the jars on maven central are
built against hadoop2, so it would be REALLY nice to publish both flavours
in the next release..at first I tried compiling phoenix 5.0.0-SNAPSHOT
(against hadoop-1, the default version) and things were much easier (apart
from the fact that I had to change the property  hadoop-one.version to
1.2.1 in the main pom otherwise there were conflicts again..).

                 <dependency>
<groupId>org.apache.phoenix</groupId>
<artifactId>phoenix-core</artifactId>
<version>4.1.0</version>
<exclusions>
<exclusion>
<artifactId>hbase-testing-util</artifactId>
<groupId>org.apache.hbase</groupId>
</exclusion>
<exclusion>
<artifactId>hbase-hadoop2-compat</artifactId>
<groupId>org.apache.hbase</groupId>
</exclusion>
<exclusion>
<artifactId>hbase-hadoop-compat</artifactId>
<groupId>org.apache.hbase</groupId>
</exclusion>
<exclusion>
<artifactId>hbase-client</artifactId>
<groupId>org.apache.hbase</groupId>
</exclusion>
<exclusion>
<artifactId>hbase-server</artifactId>
<groupId>org.apache.hbase</groupId>
</exclusion>
<exclusion>
<artifactId>hbase-common</artifactId>
<groupId>org.apache.hbase</groupId>
</exclusion>
<exclusion>
<artifactId>hbase-protocol</artifactId>
<groupId>org.apache.hbase</groupId>
</exclusion>
<exclusion>
<artifactId>hadoop-common</artifactId>
<groupId>org.apache.hadoop</groupId>
</exclusion>
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.phoenix</groupId>
<artifactId>phoenix-hadoop2-compat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-client</artifactId>
<version>0.98.4-hadoop1</version>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-server</artifactId>
<version>0.98.4-hadoop1</version>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>

Thanks again for the support,
Flavio

On Fri, Sep 19, 2014 at 12:01 AM, James Taylor <jamestaylor@apache.org>
wrote:

> I see. That makes sense, but it's more of an HBase request than a
> Phoenix request. If HBase had a "client-only" pom, then Phoenix could
> have a "client-only" pom as well.
>
> Thanks,
> James
>
> On Thu, Sep 18, 2014 at 1:52 PM, Flavio Pompermaier
> <pompermaier@okkam.it> wrote:
> > Because it is not clear which are the exact dependencies to add to a
> pom.xml
> > that uses the Phoenix client.
> > For example, why do I need to transitively hold all depency of
> hbase-server
> > in the client side or both hadoop (1 and 2) compatibility jars?!
> Wouldn't be
> > more easy to create a client jar that select only those needed classes of
> > such jar?
> >
> > On Sep 18, 2014 9:12 PM, "Mujtaba Chohan" <mujtaba@apache.org> wrote:
> >>
> >> Falvio - Client jar is composed on multiple dependency jars extracted in
> >> one and is for convenience available in binary download only. This type
> of
> >> bundled jars are not supposed to go in maven repo. as maven
> automatically
> >> resolves required dependencies. To use maven repo., use the
> phoenix-core as
> >> artifact id and maven will pull in all the required dependencies for
> your
> >> project. Then if you want a single jar for your project, you can bundle
> your
> >> project jars in one.
> >>
> >>     <dependency>
> >>         <groupId>org.apache.phoenix</groupId>
> >>         <artifactId>phoenix-core</artifactId>
> >>         <version>4.1.0</version>
> >>     </dependency>
> >>
> >> //mujtaba
> >>
> >> On Thu, Sep 18, 2014 at 11:54 AM, Flavio Pompermaier
> >> <pompermaier@okkam.it> wrote:
> >>>
> >>> Is the client jar available on maven central?
> >>>
> >>> On Sep 18, 2014 8:46 PM, "anil gupta" <anilgupta84@gmail.com> wrote:
> >>>>
> >>>> Hi Flavio,
> >>>>
> >>>> Phoenix-core is for sever side. If this app is for client side then
> you
> >>>> can use client jars. Maybe you can try to use
> >>>> phoenix-client-without-hbase.jar. In this case, i think you will at
> least
> >>>> need hbase-client jar in your client app to be added in your pom.
> >>>>
> >>>> Thanks,
> >>>> Anil Gupta
> >>>>
> >>>> On Thu, Sep 18, 2014 at 6:13 AM, Flavio Pompermaier
> >>>> <pompermaier@okkam.it> wrote:
> >>>>>
> >>>>> Is it really necessary the dependency to hbase-server..? Then if
I
> try
> >>>>> to run my application from a webapp using resteasy I get this error:
> >>>>>
> >>>>> Caused by:
> >>>>> org.jboss.as.server.deployment.DeploymentUnitProcessingException:
> >>>>> JBAS011232: Only one JAX-RS Application Class allowed.
> >>>>> com.sun.jersey.api.core.ClasspathResourceConfig
> >>>>> com.sun.jersey.server.impl.application.DeferredResourceConfig
> >>>>> com.sun.jersey.api.core.ScanningResourceConfig
> >>>>> org.apache.hadoop.hbase.rest.ResourceConfig
> >>>>> com.sun.jersey.api.core.ClassNamesResourceConfig
> >>>>> com.sun.jersey.api.core.ApplicationAdapter
> >>>>> com.sun.jersey.api.core.WebAppResourceConfig
> >>>>> com.sun.jersey.api.core.PackagesResourceConfig
> >>>>> com.sun.jersey.api.core.DefaultResourceConfig
> >>>>> com.sun.jersey.api.core.ResourceConfig
> >>>>> at
> >>>>>
> org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.scan(JaxrsScanningProcessor.java:209)
> >>>>>
> >>>>> On Thu, Sep 18, 2014 at 11:40 AM, Flavio Pompermaier
> >>>>> <pompermaier@okkam.it> wrote:
> >>>>>>
> >>>>>> I was able to obtain a minimal set of dependencies *for hadoop1)
> >>>>>> using:
> >>>>>>                 <dependency>
> >>>>>> <groupId>org.apache.phoenix</groupId>
> >>>>>> <artifactId>phoenix</artifactId>
> >>>>>> <version>4.1.0</version>
> >>>>>> </dependency>
> >>>>>> <dependency>
> >>>>>> <groupId>org.apache.hbase</groupId>
> >>>>>> <artifactId>hbase-client</artifactId>
> >>>>>> <version>0.98.4-hadoop1</version>
> >>>>>> </dependency>
> >>>>>>                 <!-- Need hbase server just for
> >>>>>> ConstantSizeRegionSplitPolicy class.. -->
> >>>>>> <dependency>
> >>>>>> <groupId>org.apache.hbase</groupId>
> >>>>>> <artifactId>hbase-server</artifactId>
> >>>>>> <version>0.98.4-hadoop1</version>
> >>>>>> <exclusions>
> >>>>>> <exclusion>
> >>>>>> <artifactId>*</artifactId>
> >>>>>> <groupId>*</groupId>
> >>>>>> </exclusion>
> >>>>>> </exclusions>
> >>>>>> </dependency>
> >>>>>> <dependency>
> >>>>>> <groupId>org.apache.phoenix</groupId>
> >>>>>> <artifactId>phoenix-hadoop-compat</artifactId>
> >>>>>> <version>4.1.0</version>
> >>>>>> <exclusions>
> >>>>>>                                  <!-- conflict with
> >>>>>> hbase-client-0.98.4-hadoop1 version -->
> >>>>>> <exclusion>
> >>>>>> <artifactId>hbase-common</artifactId>
> >>>>>> <groupId>org.apache.hbase</groupId>
> >>>>>> </exclusion>
> >>>>>> </exclusions>
> >>>>>> </dependency>
> >>>>>>
> >>>>>> but I still get this exception (that however seems not causing
any
> >>>>>> issue):
> >>>>>> java.lang.RuntimeException: Could not create  interface
> >>>>>> org.apache.phoenix.trace.PhoenixSpanReceiver Is the hadoop
> compatibility jar
> >>>>>> on the classpath?
> >>>>>> at
> >>>>>>
> org.apache.hadoop.hbase.CompatibilityFactory.getInstance(CompatibilityFactory.java:60)
> >>>>>> at
> >>>>>>
> org.apache.phoenix.trace.TracingCompat.newTraceMetricSource(TracingCompat.java:40)
> >>>>>> at
> >>>>>>
> org.apache.phoenix.trace.util.Tracing.addTraceMetricsSource(Tracing.java:294)
> >>>>>> at
> >>>>>>
> org.apache.phoenix.jdbc.PhoenixConnection.<clinit>(PhoenixConnection.java:125)
> >>>>>> at
> >>>>>>
> org.apache.phoenix.query.ConnectionQueryServicesImpl$9.call(ConnectionQueryServicesImpl.java:1516)
> >>>>>> at
> >>>>>>
> org.apache.phoenix.query.ConnectionQueryServicesImpl$9.call(ConnectionQueryServicesImpl.java:1489)
> >>>>>> at
> >>>>>>
> org.apache.phoenix.util.PhoenixContextExecutor.call(PhoenixContextExecutor.java:77)
> >>>>>> at
> >>>>>>
> org.apache.phoenix.query.ConnectionQueryServicesImpl.init(ConnectionQueryServicesImpl.java:1489)
> >>>>>> at
> >>>>>>
> org.apache.phoenix.jdbc.PhoenixDriver.getConnectionQueryServices(PhoenixDriver.java:162)
> >>>>>> at
> >>>>>>
> org.apache.phoenix.jdbc.PhoenixEmbeddedDriver.connect(PhoenixEmbeddedDriver.java:129)
> >>>>>> at
> >>>>>>
> org.apache.phoenix.jdbc.PhoenixDriver.connect(PhoenixDriver.java:133)
> >>>>>> at java.sql.DriverManager.getConnection(DriverManager.java:571)
> >>>>>> at java.sql.DriverManager.getConnection(DriverManager.java:233)
> >>>>>> Caused by: java.util.NoSuchElementException
> >>>>>> at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:357)
> >>>>>> at java.util.ServiceLoader$1.next(ServiceLoader.java:445)
> >>>>>> at
> >>>>>>
> org.apache.hadoop.hbase.CompatibilityFactory.getInstance(CompatibilityFactory.java:46)
> >>>>>> ... 14 more
> >>>>>>
> >>>>>> How can I fix those problems?
> >>>>>>
> >>>>>> On Thu, Sep 18, 2014 at 10:34 AM, Flavio Pompermaier
> >>>>>> <pompermaier@okkam.it> wrote:
> >>>>>>>
> >>>>>>> Hi to all,
> >>>>>>>
> >>>>>>> I'm trying to write a J2EE application that uses the Phoenix
JDBC
> >>>>>>> driver for HBase 0.98 (not on yarn for tests but it will
be in
> production)
> >>>>>>> through maven.
> >>>>>>> Do I really need all the jars of the hbase-server side contained
in
> >>>>>>> the phoenix core jar..?
> >>>>>>> I can't see a phoenix-client jar on the central maven repository
> >>>>>>> while in the documentation there's to use that jar!
> >>>>>>>
> >>>>>>> Thanks in advance,
> >>>>>>> Flavio
> >>>>>>
> >>>>>>
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> Thanks & Regards,
> >>>> Anil Gupta
> >>
> >>
> >
>

Mime
View raw message