Loading multiple versions of same library through vertx.

137 views
Skip to first unread message

Srikanth Rajasekaran

unread,
Jan 13, 2017, 6:08:55 AM1/13/17
to vert.x
Greetings,

I am facing an issue with respect to the dependency conflict in my application developed using vertx. I have two dependencies Pheonix JDBC client and gRPC lib, which in turn has dependency on the library "protobuf-java" of version 2.5.0 and 3.0.2 respectively. For my application to work correctly I have to load both the version of "protobuf-java", otherwise it will not work. Is there a way in Vertx to load both the versions of same library?

Thanks

Jochen Mader

unread,
Jan 13, 2017, 6:20:24 AM1/13/17
to ve...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/d72fcd62-b506-4291-bebd-17f0e201ac93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Jochen Mader | Lead IT Consultant

codecentric AG | Elsenheimerstr. 55a | 80687 München | Deutschland
tel: +49 89 215486633 | fax: +49 89 215486699 | mobil: +49 152 51862390
www.codecentric.de | blog.codecentric.de | www.meettheexperts.de | www.more4fi.de

Sitz der Gesellschaft: Düsseldorf | HRB 63043 | Amtsgericht Düsseldorf
Vorstand: Michael Hochgürtel . Rainer Vehns
Aufsichtsrat: Patric Fedlmeier (Vorsitzender) . Klaus Jäger . Jürgen Schütz

Srikanth Rajasekaran

unread,
Jan 16, 2017, 3:32:24 AM1/16/17
to ve...@googlegroups.com
Hi Jochen Mader,

I am facing an issue with loading jars from the extra classpath set while deploying the verticles.


I have multiple verticles in my application. I am using isolation group to isolate a dependency (Phoenix lib) from other verticles. I am setting the extra classpath to include the phoenix jar as below. But it seems like the jars from extra classpath is not considered.


******************************************************************************************************

package com.test.init;

 

import java.util.Arrays;

 

import org.slf4j.Logger;

import org.slf4j.LoggerFactory;

 

import io.vertx.core.DeploymentOptions;

import io.vertx.rxjava.core.Vertx;

 

public class ApplicationLauncher {

 

                private static Logger logger = LoggerFactory.getLogger(ApplicationLauncher.class);

 

                public static void main(String[] args) {

 

                                System.getProperties().put("vertx.logger-delegate-factory-class-name",

                                                                "io.vertx.core.logging.SLF4JLogDelegateFactory");

 

                                logger.warn("Starting the service application");

 

                                Vertx vertx = Vertx.vertx();

 

                                DeploymentOptions opts = new DeploymentOptions().setIsolationGroup("Pheonix_Libs")

                                                .setExtraClasspath(Arrays.asList("C:\\tmp\\lib\\phoenix-client-4.5.2-1.clabs_phoenix1.2.0.p0.774.jar"));


                                vertx.deployVerticleObservable(DBVerticle.class.getName(), opts).subscribe(res -> {

 

                                                logger.warn("DB verticle is deployed");

                                }, ex -> {

                                                logger.error("Failed to deploy the db verticle", ex);

                                });

                }

}

 

 

******************************************************************************************************

package com.test.init;

 

import org.slf4j.Logger;

import org.slf4j.LoggerFactory;

 

import io.vertx.rxjava.core.AbstractVerticle;

 

public class DBVerticle extends AbstractVerticle {

 

                private Logger logger = LoggerFactory.getLogger(DBVerticle.class);

               

                @Override

                public void start() throws Exception {

                               

                                super.start();

                               

                                logger.warn("Starting the deplyment of DB verticle…………");

                               

        new org.apache.phoenix.jdbc.PhoenixDriver();

                               

                                logger.warn("DB verticle started successfully");

                }

}


******************************************************************************************************


Since, I have deployed “DBVerticle” with phoenix jar set in the extra classpath. It is expected to be available during the run time. But I get “ClassNotFoundException” for the class “org.apache.phoenix.jdbc.PhoenixDriver” which is available in the phoenix jar. Please advise.



Reagrds,
Srikanth

--
You received this message because you are subscribed to a topic in the Google Groups "vert.x" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vertx/NgROHSkSU-A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vertx+unsubscribe@googlegroups.com.

Srikanth Rajasekaran

unread,
Jan 16, 2017, 3:34:23 AM1/16/17
to vert.x
On Friday, January 13, 2017 at 4:50:24 PM UTC+5:30, Jochen Mader wrote:
2017-01-13 12:08 GMT+01:00 Srikanth Rajasekaran <sseka...@gmail.com>:
Greetings,

I am facing an issue with respect to the dependency conflict in my application developed using vertx. I have two dependencies Pheonix JDBC client and gRPC lib, which in turn has dependency on the library "protobuf-java" of version 2.5.0 and 3.0.2 respectively. For my application to work correctly I have to load both the version of "protobuf-java", otherwise it will not work. Is there a way in Vertx to load both the versions of same library?

Thanks

--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages