I'm new using ElasticSearch Java API, and i want to create the connection with my instance.
I followed the instructions here :
getting started
So i get the following code (as simple as on the exemple ! ) :
TransportClient mClient = new PreBuiltTransportClient(Settings.EMPTY)
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("host1"),
9300));
But I'm facing an issue about importing classes : TransportClient and Settings, that Eclipse cannot find...
Here is the maven import :
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>5.3.0</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
<version>5.3.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.7</version>
</dependency>
I tried to search bout this issue but didn't find the solution...
Eclipse found without any problem the PreBuiltTransportClient.
Here is the result of mvn dependency:tee
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) # poc ---
[INFO] fr.consortnt:poc:war:0.0.1-SNAPSHOT
[INFO] +- junit:junit:jar:3.8.1:test
[INFO] +- javax:javaee-web-api:jar:6.0:provided
[INFO] +- org.elasticsearch.client:transport:jar:5.3.0:compile
[INFO] | +- org.elasticsearch:elasticsearch:jar:5.3.0:compile
[INFO] | | +- org.apache.lucene:lucene-core:jar:6.4.1:compile
[INFO] | | +- org.apache.lucene:lucene-analyzers-common:jar:6.4.1:compile
[INFO] | | +- org.apache.lucene:lucene-backward-codecs:jar:6.4.1:compile
[INFO] | | +- org.apache.lucene:lucene-grouping:jar:6.4.1:compile
[INFO] | | +- org.apache.lucene:lucene-highlighter:jar:6.4.1:compile
[INFO] | | +- org.apache.lucene:lucene-join:jar:6.4.1:compile
[INFO] | | +- org.apache.lucene:lucene-memory:jar:6.4.1:compile
[INFO] | | +- org.apache.lucene:lucene-misc:jar:6.4.1:compile
[INFO] | | +- org.apache.lucene:lucene-queries:jar:6.4.1:compile
[INFO] | | +- org.apache.lucene:lucene-queryparser:jar:6.4.1:compile
[INFO] | | +- org.apache.lucene:lucene-sandbox:jar:6.4.1:compile
[INFO] | | +- org.apache.lucene:lucene-spatial:jar:6.4.1:compile
[INFO] | | +- org.apache.lucene:lucene-spatial-extras:jar:6.4.1:compile
[INFO] | | +- org.apache.lucene:lucene-spatial3d:jar:6.4.1:compile
[INFO] | | +- org.apache.lucene:lucene-suggest:jar:6.4.1:compile
[INFO] | | +- org.elasticsearch:securesm:jar:1.1:compile
[INFO] | | +- net.sf.jopt-simple:jopt-simple:jar:5.0.2:compile
[INFO] | | +- com.carrotsearch:hppc:jar:0.7.1:compile
[INFO] | | +- joda-time:joda-time:jar:2.9.5:compile
[INFO] | | +- org.yaml:snakeyaml:jar:1.15:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-core:jar:2.8.6:compile
[INFO] | | +- com.fasterxml.jackson.dataformat:jackson-dataformat-smile:jar:2.8.6:compile
[INFO] | | +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.8.6:compile
[INFO] | | +- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar:2.8.6:compile
[INFO] | | +- com.tdunning:t-digest:jar:3.0:compile
[INFO] | | +- org.hdrhistogram:HdrHistogram:jar:2.1.6:compile
[INFO] | | \- net.java.dev.jna:jna:jar:4.2.2:compile
[INFO] | +- org.elasticsearch.plugin:transport-netty3-client:jar:5.3.0:compile
[INFO] | | \- io.netty:netty:jar:3.10.6.Final:compile
[INFO] | +- org.elasticsearch.plugin:transport-netty4-client:jar:5.3.0:compile
[INFO] | | +- io.netty:netty-buffer:jar:4.1.7.Final:compile
[INFO] | | +- io.netty:netty-codec:jar:4.1.7.Final:compile
[INFO] | | +- io.netty:netty-codec-http:jar:4.1.7.Final:compile
[INFO] | | +- io.netty:netty-common:jar:4.1.7.Final:compile
[INFO] | | +- io.netty:netty-handler:jar:4.1.7.Final:compile
[INFO] | | +- io.netty:netty-resolver:jar:4.1.7.Final:compile
[INFO] | | \- io.netty:netty-transport:jar:4.1.7.Final:compile
[INFO] | +- org.elasticsearch.plugin:reindex-client:jar:5.3.0:compile
[INFO] | | \- org.elasticsearch.client:rest:jar:5.3.0:compile
[INFO] | | +- org.apache.httpcomponents:httpclient:jar:4.5.2:compile
[INFO] | | +- org.apache.httpcomponents:httpcore:jar:4.4.5:compile
[INFO] | | +- org.apache.httpcomponents:httpasyncclient:jar:4.1.2:compile
[INFO] | | +- org.apache.httpcomponents:httpcore-nio:jar:4.4.5:compile
[INFO] | | +- commons-codec:commons-codec:jar:1.10:compile
[INFO] | | \- commons-logging:commons-logging:jar:1.1.3:compile
[INFO] | +- org.elasticsearch.plugin:lang-mustache-client:jar:5.3.0:compile
[INFO] | | \- com.github.spullara.mustache.java:compiler:jar:0.9.3:compile
[INFO] | \- org.elasticsearch.plugin:percolator-client:jar:5.3.0:compile
[INFO] +- org.apache.logging.log4j:log4j-api:jar:2.7:compile
[INFO] +- org.apache.logging.log4j:log4j-core:jar:2.7:compile
[INFO] +- taglibs:standard:jar:1.1.2:compile
[INFO] +- jstl:jstl:jar:1.2:runtime
[INFO] +- org.postgresql:postgresql:jar:9.4.1212:compile
[INFO] \- org.hibernate:hibernate-entitymanager:jar:4.2.15.Final:compile
[INFO] +- org.jboss.logging:jboss-logging:jar:3.1.0.GA:compile
[INFO] +- dom4j:dom4j:jar:1.6.1:compile
[INFO] +- org.javassist:javassist:jar:3.18.1-GA:compile
[INFO] +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:jar:1.0.1.Final:compile
[INFO] +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:compile
[INFO] +- org.hibernate.common:hibernate-commons-annotations:jar:4.0.2.Final:compile
[INFO] \- org.hibernate:hibernate-core:jar:4.2.15.Final:compile
[INFO] \- antlr:antlr:jar:2.7.7:compile
Any idea about what happens ?
I'm pretty sure that it's not a problem from maven configuration because I can import from elasticsearch some of classes needed...
Thanks in advance !
I am not an eclipse user for a few years now but this looks like an eclipse / maven configuration issue so I recommend you to review your eclipse configuration with maven.
I say this is a configuration issue because I have an application working with the following maven dependency configuration:
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
<version>${elasticsearch.version}</version>
</dependency>
<!-- Log Dependencies required by elasticsearch 5 -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
</dependency>
Notice that you don't need to add the org.elasticsearch (first one in your list) dependency as this was used when running elasticsearch embedded which is not supported anymore, but it's possible, if this is your case then leave it there, if you're just building a client you don't need that first dependency.
P.S - If your eclipse/maven configuration is correct then just maybe you forgot to mvn clean install before running your app?
Related
I recently upgraded to Spring Boot 2.7.0, and my the request body validations stopped working. From my research so far, I've learnt that the
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
is required after Spring Boot 2.3.0.
I've added the dependency and verified that it is the only validation jar on the classpath is jakarta.validation (not javax.validation).
Here's the Controller class:
#RestController
#RequestMapping("v1/services")
#Validated
public class ServiceController {
#PutMapping(
path = "/{id}",
consumes = APPLICATION_JSON_VALUE,
produces = APPLICATION_JSON_VALUE
)
#Validated(OnUpdate.class)
public ResponseEntity<Service> updateService(#PathVariable("id") int serviceId,
#Valid #RequestBody Service service) {
// Implementation omitted for brevity
}
}
Here is the domain class:
#Component
public class Service {
private int id;
NotNull(message = "Current status is required", groups = {OnCreate.class, OnUpdate.class})
private ServiceStatus currentStatus; // The field I want to validate
}
My partial pom.xml:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.0</version>
<relativePath/> <!-- lookup parent from repository --
</parent>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>7.0.4.Final</version>
</dependency>
My dependency tree:
[INFO] +- org.springframework.boot:spring-boot-starter:jar:2.7.0:compile
[INFO] | +- org.springframework.boot:spring-boot:jar:2.7.0:compile
[INFO] | | \- org.springframework:spring-context:jar:5.3.20:compile
[INFO] | +- org.springframework.boot:spring-boot-autoconfigure:jar:2.7.0:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-logging:jar:2.7.0:compile
[INFO] | | +- ch.qos.logback:logback-classic:jar:1.2.11:compile
[INFO] | | | \- ch.qos.logback:logback-core:jar:1.2.11:compile
[INFO] | | +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.17.2:compile
[INFO] | | | \- org.apache.logging.log4j:log4j-api:jar:2.17.2:compile
[INFO] | | \- org.slf4j:jul-to-slf4j:jar:1.7.36:compile
[INFO] | +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] | +- org.springframework:spring-core:jar:5.3.20:compile
[INFO] | | \- org.springframework:spring-jcl:jar:5.3.20:compile
[INFO] | \- org.yaml:snakeyaml:jar:1.30:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.7.0:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-json:jar:2.7.0:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-databind:jar:2.13.3:compile
[INFO] | | | \- com.fasterxml.jackson.core:jackson-annotations:jar:2.13.3:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.13.3:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.13.3:compile
[INFO] | | \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.13.3:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.7.0:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.63:compile
[INFO] | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.63:compile
[INFO] | +- org.springframework:spring-web:jar:5.3.20:compile
[INFO] | | \- org.springframework:spring-beans:jar:5.3.20:compile
[INFO] | \- org.springframework:spring-webmvc:jar:5.3.20:compile
[INFO] | +- org.springframework:spring-aop:jar:5.3.20:compile
[INFO] | \- org.springframework:spring-expression:jar:5.3.20:compile
[INFO] +- org.springframework.boot:spring-boot-starter-jdbc:jar:2.7.0:compile
[INFO] | +- com.zaxxer:HikariCP:jar:4.0.3:compile
[INFO] | | \- org.slf4j:slf4j-api:jar:1.7.36:compile
[INFO] | \- org.springframework:spring-jdbc:jar:5.3.20:compile
[INFO] | \- org.springframework:spring-tx:jar:5.3.20:compile
[INFO] +- org.springframework.boot:spring-boot-starter-validation:jar:2.7.0:compile
[INFO] | \- org.apache.tomcat.embed:tomcat-embed-el:jar:9.0.63:compile
[INFO] +- org.springframework.boot:spring-boot-devtools:jar:2.7.0:compile
[INFO] +- org.springdoc:springdoc-openapi-ui:jar:1.6.9:compile
[INFO] | +- org.springdoc:springdoc-openapi-webmvc-core:jar:1.6.9:compile
[INFO] | | \- org.springdoc:springdoc-openapi-common:jar:1.6.9:compile
[INFO] | | \- io.swagger.core.v3:swagger-core:jar:2.2.0:compile
[INFO] | | +- org.apache.commons:commons-lang3:jar:3.12.0:compile
[INFO] | | +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.13.3:compile
[INFO] | | +- io.swagger.core.v3:swagger-annotations:jar:2.2.0:compile
[INFO] | | \- io.swagger.core.v3:swagger-models:jar:2.2.0:compile
[INFO] | +- org.webjars:swagger-ui:jar:4.11.1:compile
[INFO] | \- org.webjars:webjars-locator-core:jar:0.50:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-core:jar:2.13.3:compile
[INFO] +- io.github.classgraph:classgraph:jar:4.8.147:compile
[INFO] +- jakarta.validation:jakarta.validation-api:jar:3.0.2:compile
[INFO] +- org.hibernate.validator:hibernate-validator:jar:7.0.4.Final:compile
[INFO] | +- org.jboss.logging:jboss-logging:jar:3.4.3.Final:compile
[INFO] | \- com.fasterxml:classmate:jar:1.5.1:compile
[INFO] +- com.h2database:h2:jar:2.1.212:runtime
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:2.7.0:test
[INFO] | +- org.springframework.boot:spring-boot-test:jar:2.7.0:test
[INFO] | +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.7.0:test
[INFO] | +- com.jayway.jsonpath:json-path:jar:2.7.0:test
[INFO] | | \- net.minidev:json-smart:jar:2.4.8:test
[INFO] | | \- net.minidev:accessors-smart:jar:2.4.8:test
[INFO] | | \- org.ow2.asm:asm:jar:9.1:test
[INFO] | +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:compile
[INFO] | | \- jakarta.activation:jakarta.activation-api:jar:1.2.2:compile
[INFO] | +- org.assertj:assertj-core:jar:3.22.0:test
[INFO] | +- org.hamcrest:hamcrest:jar:2.2:test
[INFO] | +- org.junit.jupiter:junit-jupiter:jar:5.8.2:test
[INFO] | | +- org.junit.jupiter:junit-jupiter-api:jar:5.8.2:test
[INFO] | | +- org.junit.jupiter:junit-jupiter-params:jar:5.8.2:test
[INFO] | | \- org.junit.jupiter:junit-jupiter-engine:jar:5.8.2:test
[INFO] | +- org.mockito:mockito-core:jar:4.5.1:test
[INFO] | | +- net.bytebuddy:byte-buddy:jar:1.12.10:test
[INFO] | | +- net.bytebuddy:byte-buddy-agent:jar:1.12.10:test
[INFO] | | \- org.objenesis:objenesis:jar:3.2:test
[INFO] | +- org.mockito:mockito-junit-jupiter:jar:4.5.1:test
[INFO] | +- org.skyscreamer:jsonassert:jar:1.5.0:test
[INFO] | | \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] | +- org.springframework:spring-test:jar:5.3.20:test
[INFO] | \- org.xmlunit:xmlunit-core:jar:2.9.0:test
[INFO] +- org.spockframework:spock-core:jar:2.1-groovy-3.0:test
[INFO] | +- org.codehaus.groovy:groovy:jar:3.0.10:test
[INFO] | \- org.junit.platform:junit-platform-engine:jar:1.8.2:test
[INFO] | +- org.opentest4j:opentest4j:jar:1.2.0:test
[INFO] | +- org.junit.platform:junit-platform-commons:jar:1.8.2:test
[INFO] | \- org.apiguardian:apiguardian-api:jar:1.1.2:test
[INFO] +- org.spockframework:spock-spring:jar:2.1-groovy-3.0:test
[INFO] +- org.codehaus.groovy:groovy-json:jar:3.0.10:test
[INFO] \- junit:junit:jar:4.13.2:test
[INFO] \- org.hamcrest:hamcrest-core:jar:2.2:test
Lastly, I'm confident it's not the jakarta package because the following unit test passed:
import jakarta.validation.ConstraintViolation
import jakarta.validation.Validation
import jakarta.validation.Validator
def 'Null status on update should trigger violation'() {
given: 'I have an invalid service'
final LocalDate may4th2021 = LocalDate.of(2021, 5, 4)
Service serviceWithoutStatus = new Service(
id: 1,
contractId: 2,
dueDate: may4th2021,
currentStatus: null, // N.B. the violation
history: []
)
when: 'I validate the client'
Validator validator = Validation.byDefaultProvider()
.configure()
.messageInterpolator(new ParameterMessageInterpolator())
.buildValidatorFactory()
.getValidator()
Set<ConstraintViolation<Service>> violations = validator.validate(serviceWithoutStatus, OnUpdate.class)
then: 'There should be violations'
!violations.isEmpty()
violations.size() == 1
}
Edit: I am using Java 11
openjdk version "11.0.9.1" 2020-11-04 LTS
OpenJDK Runtime Environment Zulu11.43+1015-CA (build 11.0.9.1+1-LTS)
OpenJDK 64-Bit Server VM Zulu11.43+1015-CA (build 11.0.9.1+1-LTS, mixed mode)
Any help would greatly be appreciated. Thank you.
This issue was that the jakarta.validation-api does not work with #Validated. I had to use javax.validation
The code worked as expected after I removed the below dependencies:
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>7.0.4.Final</version>
</dependency>
A Maven Java project using geotools 15.2 generates an error : NoSuchFieldError: METER
pom.xml
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-data</artifactId>
<version>15.2</version>
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-shapefile</artifactId>
<version>15.2</version>
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-swing</artifactId>
<version>15.2</version>
</dependency>
When running the code, the error is generated when calling source.getFeatures(Filter.INCLUDE).
Stacktrace
java.lang.NoSuchFieldError: METER
at org.geotools.referencing.wkt.Parser.parseSpheroid(Parser.java:560)
at org.geotools.referencing.wkt.Parser.parseDatum(Parser.java:656)
at org.geotools.referencing.wkt.Parser.parseGeoGCS(Parser.java:867)
at org.geotools.referencing.wkt.Parser.parseProjCS(Parser.java:913)
at org.geotools.referencing.wkt.Parser.parseCoordinateReferenceSystem(Parser.java:225)
at org.geotools.referencing.wkt.Parser.parseCoordinateReferenceSystem(Parser.java:204)
I found out that SI.METER is linked to javax.measure but even if I add it to the project, the error is still present.
The result of mvn dependency:tree is
[INFO] +- com.vividsolutions:jts:jar:1.13:compile
[INFO] +- org.opengis:geoapi:jar:3.0.0:compile
[INFO] | \- javax.measure:jsr-275:jar:0.9.3:compile
[INFO] +- org.geotools:gt-data:jar:15.2:compile
[INFO] | +- org.geotools:gt-main:jar:15.2:compile
[INFO] | | \- org.geotools:gt-api:jar:15.2:compile
[INFO] | \- javax.media:jai_core:jar:1.1.3:compile
[INFO] +- org.geotools:gt-shapefile:jar:15.2:compile
[INFO] | \- org.jdom:jdom:jar:1.1.3:compile
[INFO] \- org.geotools:gt-swing:jar:15.2:compile
[INFO] +- org.geotools:gt-referencing:jar:15.2:compile
[INFO] | +- com.googlecode.efficient-java-matrix-library:core:jar:0.26:compile
[INFO] | +- commons-pool:commons-pool:jar:1.5.4:compile
[INFO] | +- org.geotools:gt-metadata:jar:15.2:compile
[INFO] | | \- org.geotools:gt-opengis:jar:15.2:compile
[INFO] | | \- net.java.dev.jsr-275:jsr-275:jar:1.0-beta-2:compile
[INFO] | +- jgridshift:jgridshift:jar:1.0:compile
[INFO] | \- net.sf.geographiclib:GeographicLib-Java:jar:1.44:compile
[INFO] +- org.geotools:gt-render:jar:15.2:compile
[INFO] | +- org.geotools:gt-coverage:jar:15.2:compile
[INFO] | | +- javax.media:jai_imageio:jar:1.1:compile
[INFO] | | +- it.geosolutions.imageio-ext:imageio-ext-tiff:jar:1.1.15:compile
[INFO] | | | +- it.geosolutions.imageio-ext:imageio-ext-utilities:jar:1.1.15:compile
[INFO] | | | +- it.geosolutions.imageio-ext:imageio-ext-geocore:jar:1.1.15:compile
[INFO] | | | | \- it.geosolutions.imageio-ext:imageio-ext-streams:jar:1.1.15:compile
[INFO] | | | \- javax.media:jai_codec:jar:1.1.3:compile
[INFO] | | +- org.jaitools:jt-zonalstats:jar:1.4.0:compile
[INFO] | | +- org.jaitools:jt-utils:jar:1.4.0:compile
[INFO] | | +- it.geosolutions.jaiext.affine:jt-affine:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.algebra:jt-algebra:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.bandmerge:jt-bandmerge:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.bandselect:jt-bandselect:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.bandcombine:jt-bandcombine:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.border:jt-border:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.buffer:jt-buffer:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.crop:jt-crop:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.iterators:jt-iterators:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.lookup:jt-lookup:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.mosaic:jt-mosaic:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.nullop:jt-nullop:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.rescale:jt-rescale:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.scale:jt-scale:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.stats:jt-stats:jar:1.0.11:compile
[INFO] | | | \- com.google.guava:guava:jar:17.0:compile
[INFO] | | +- it.geosolutions.jaiext.translate:jt-translate:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.utilities:jt-utilities:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.warp:jt-warp:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.zonal:jt-zonal:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.binarize:jt-binarize:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.format:jt-format:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.colorconvert:jt-colorconvert:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.errordiffusion:jt-errordiffusion:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.orderdither:jt-orderdither:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.colorindexer:jt-colorindexer:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.imagefunction:jt-imagefunction:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.piecewise:jt-piecewise:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.classifier:jt-classifier:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.rlookup:jt-rlookup:jar:1.0.11:compile
[INFO] | | +- it.geosolutions.jaiext.vectorbin:jt-vectorbin:jar:1.0.11:compile
[INFO] | | \- commons-io:commons-io:jar:2.1:compile
[INFO] | \- org.geotools:gt-cql:jar:15.2:compile
[INFO] \- com.miglayout:miglayout:jar:swing:3.7:compile
Am I missing a dependency ?
The answer was found with the help of #IanTurton
I upgraded the geotools version from 15.2 to 20.5. I also added the gt-epsg-hsql jar. The pom.xml is now like this :
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-api</artifactId>
<version>20.5</version>
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-shapefile</artifactId>
<version>20.5</version>
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-swing</artifactId>
<version>20.5</version>
</dependency>
<dependency>
<groupId>org.geotools</groupId>
<artifactId>gt-epsg-hsql</artifactId>
<version>20.5</version>
</dependency>
I also updated my code to use org.locationtech.jts.geom.Geometry instead of com.vividsolutions
i am trying to write to hdfs, i am sure i have same version hdfs clients in my pom.xml, some other dependencies are causing the issue. following are the details. i am using CDH 5.5.1 hadoop 2.6.0
if i just specify
conf.set("fs.defaultFS",
"localhost:8020");
it throws
Exception in thread "main" java.lang.IllegalArgumentException: Wrong FS: hdfs://localhost:8020/user/hdfs, expected: file:///
if i specify
conf.set("fs.default.name",
"localhost:8020");
it throws
org.apache.hadoop.ipc.RemoteException: Server IPC version 9 cannot communicate with client version 4
at org.apache.hadoop.ipc.Client.call(Client.java:1066)
at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:225)
at com.sun.proxy.$Proxy3.getProtocolVersion(Unknown Source)
at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:396)
at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:379)
at org.apache.hadoop.hdfs.DFSClient.createRPCNamenode(DFSClient.java:118)
at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:222)
at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:187)
at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:89)
at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:1328)
at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:65)
at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:1346)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:244)
at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:122)
maven dependency tree
+- junit:junit:jar:4.12:compile
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO] +- com.googlecode.protobuf-java-format:protobuf-java-format:jar:1.4:compile
[INFO] +- org.apache.logging.log4j:log4j-core:jar:2.3:compile
[INFO] | \- org.apache.logging.log4j:log4j-api:jar:2.3:compile
[INFO] +- org.apache.avro:avro-tools:jar:1.7.7:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.6.4:compile
[INFO] +- org.apache.spark:spark-core_2.11:jar:1.5.0:compile
[INFO] | +- org.apache.avro:avro-mapred:jar:hadoop2:1.7.7:compile
[INFO] | | +- org.apache.avro:avro-ipc:jar:1.7.7:compile
[INFO] | | +- org.apache.avro:avro-ipc:jar:tests:1.7.7:compile
[INFO] | | +- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
[INFO] | | \- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
[INFO] | +- com.twitter:chill_2.11:jar:0.5.0:compile
[INFO] | | \- com.esotericsoftware.kryo:kryo:jar:2.21:compile
[INFO] | | +- com.esotericsoftware.reflectasm:reflectasm:jar:shaded:1.07:compile
[INFO] | | +- com.esotericsoftware.minlog:minlog:jar:1.2:compile
[INFO] | | \- org.objenesis:objenesis:jar:1.2:compile
[INFO] | +- com.twitter:chill-java:jar:0.5.0:compile
[INFO] | +- org.apache.spark:spark-launcher_2.11:jar:1.5.0:compile
[INFO] | +- org.apache.spark:spark-network-common_2.11:jar:1.5.0:compile
[INFO] | +- org.apache.spark:spark-network-shuffle_2.11:jar:1.5.0:compile
[INFO] | +- org.apache.spark:spark-unsafe_2.11:jar:1.5.0:compile
[INFO] | +- net.java.dev.jets3t:jets3t:jar:0.7.1:compile
[INFO] | | +- commons-codec:commons-codec:jar:1.3:compile
[INFO] | | \- commons-httpclient:commons-httpclient:jar:3.1:compile
[INFO] | +- org.apache.curator:curator-recipes:jar:2.4.0:compile
[INFO] | | +- org.apache.curator:curator-framework:jar:2.4.0:compile
[INFO] | | \- com.google.guava:guava:jar:14.0.1:compile
[INFO] | +- org.eclipse.jetty.orbit:javax.servlet:jar:3.0.0.v201112011016:compile
[INFO] | +- org.apache.commons:commons-lang3:jar:3.3.2:compile
[INFO] | +- org.apache.commons:commons-math3:jar:3.4.1:compile
[INFO] | +- com.google.code.findbugs:jsr305:jar:1.3.9:compile
[INFO] | +- org.slf4j:jul-to-slf4j:jar:1.7.10:compile
[INFO] | +- org.slf4j:jcl-over-slf4j:jar:1.7.10:compile
[INFO] | +- log4j:log4j:jar:1.2.17:compile
[INFO] | +- org.slf4j:slf4j-log4j12:jar:1.7.10:compile
[INFO] | +- com.ning:compress-lzf:jar:1.0.3:compile
[INFO] | +- org.xerial.snappy:snappy-java:jar:1.1.1.7:compile
[INFO] | +- net.jpountz.lz4:lz4:jar:1.3.0:compile
[INFO] | +- org.roaringbitmap:RoaringBitmap:jar:0.4.5:compile
[INFO] | +- com.typesafe.akka:akka-remote_2.11:jar:2.3.11:compile
[INFO] | | +- com.typesafe.akka:akka-actor_2.11:jar:2.3.11:compile
[INFO] | | | \- com.typesafe:config:jar:1.2.1:compile
[INFO] | | +- io.netty:netty:jar:3.8.0.Final:compile
[INFO] | | \- org.uncommons.maths:uncommons-maths:jar:1.2.2a:compile
[INFO] | +- com.typesafe.akka:akka-slf4j_2.11:jar:2.3.11:compile
[INFO] | +- org.scala-lang:scala-library:jar:2.11.7:compile
[INFO] | +- org.json4s:json4s-jackson_2.11:jar:3.2.10:compile
[INFO] | | \- org.json4s:json4s-core_2.11:jar:3.2.10:compile
[INFO] | | +- org.json4s:json4s-ast_2.11:jar:3.2.10:compile
[INFO] | | \- org.scala-lang:scalap:jar:2.11.0:compile
[INFO] | | \- org.scala-lang:scala-compiler:jar:2.11.0:compile
[INFO] | | \- org.scala-lang.modules:scala-xml_2.11:jar:1.0.1:compile
[INFO] | +- com.sun.jersey:jersey-server:jar:1.9:compile
[INFO] | | \- asm:asm:jar:3.1:compile
[INFO] | +- com.sun.jersey:jersey-core:jar:1.9:compile
[INFO] | +- org.apache.mesos:mesos:jar:shaded-protobuf:0.21.1:compile
[INFO] | +- io.netty:netty-all:jar:4.0.29.Final:compile
[INFO] | +- com.clearspring.analytics:stream:jar:2.7.0:compile
[INFO] | +- io.dropwizard.metrics:metrics-core:jar:3.1.2:compile
[INFO] | +- io.dropwizard.metrics:metrics-jvm:jar:3.1.2:compile
[INFO] | +- io.dropwizard.metrics:metrics-json:jar:3.1.2:compile
[INFO] | +- io.dropwizard.metrics:metrics-graphite:jar:3.1.2:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.4.4:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.4.0:compile
[INFO] | | \- com.fasterxml.jackson.core:jackson-core:jar:2.4.4:compile
[INFO] | +- com.fasterxml.jackson.module:jackson-module-scala_2.11:jar:2.4.4:compile
[INFO] | | +- org.scala-lang:scala-reflect:jar:2.11.2:compile
[INFO] | | \- com.thoughtworks.paranamer:paranamer:jar:2.6:compile
[INFO] | +- org.apache.ivy:ivy:jar:2.4.0:compile
[INFO] | +- oro:oro:jar:2.0.8:compile
[INFO] | +- org.tachyonproject:tachyon-client:jar:0.7.1:compile
[INFO] | | +- commons-lang:commons-lang:jar:2.4:compile
[INFO] | | +- org.apache.curator:curator-client:jar:2.1.0-incubating:compile
[INFO] | | +- org.tachyonproject:tachyon-underfs-hdfs:jar:0.7.1:compile
[INFO] | | \- org.tachyonproject:tachyon-underfs-local:jar:0.7.1:compile
[INFO] | +- net.razorvine:pyrolite:jar:4.4:compile
[INFO] | +- net.sf.py4j:py4j:jar:0.8.2.1:compile
[INFO] | \- org.spark-project.spark:unused:jar:1.0.0:compile
[INFO] +- org.apache.spark:spark-sql_2.11:jar:1.5.0:provided
[INFO] | +- org.apache.spark:spark-catalyst_2.11:jar:1.5.0:provided
[INFO] | | \- org.codehaus.janino:janino:jar:2.7.8:provided
[INFO] | | \- org.codehaus.janino:commons-compiler:jar:2.7.8:provided
[INFO] | +- org.apache.parquet:parquet-column:jar:1.7.0:provided
[INFO] | | +- org.apache.parquet:parquet-common:jar:1.7.0:provided
[INFO] | | \- org.apache.parquet:parquet-encoding:jar:1.7.0:provided
[INFO] | | \- org.apache.parquet:parquet-generator:jar:1.7.0:provided
[INFO] | \- org.apache.parquet:parquet-hadoop:jar:1.7.0:provided
[INFO] | +- org.apache.parquet:parquet-format:jar:2.3.0-incubating:provided
[INFO] | \- org.apache.parquet:parquet-jackson:jar:1.7.0:provided
[INFO] +- org.bouncycastle:bcprov-jdk15on:jar:1.52:compile
[INFO] +- com.google.protobuf:protobuf-java:jar:3.0.0-beta-2:compile
[INFO] +- com.databricks:spark-avro_2.11:jar:2.0.1:compile
[INFO] | \- org.apache.avro:avro:jar:1.7.6:compile
[INFO] | \- org.apache.commons:commons-compress:jar:1.4.1:compile
[INFO] | \- org.tukaani:xz:jar:1.0:compile
[INFO] +- org.apache.hadoop:hadoop-client:jar:2.6.0-cdh5.5.1:compile
[INFO] | +- org.apache.hadoop:hadoop-common:jar:2.6.0-cdh5.5.1:compile
[INFO] | | +- xmlenc:xmlenc:jar:0.52:compile
[INFO] | | +- commons-net:commons-net:jar:3.1:compile
[INFO] | | +- commons-collections:commons-collections:jar:3.2.2:compile
[INFO] | | +- commons-logging:commons-logging:jar:1.1.3:compile
[INFO] | | +- commons-configuration:commons-configuration:jar:1.6:compile
[INFO] | | | +- commons-digester:commons-digester:jar:1.8:compile
[INFO] | | | | \- commons-beanutils:commons-beanutils:jar:1.7.0:compile
[INFO] | | | \- commons-beanutils:commons-beanutils-core:jar:1.8.0:compile
[INFO] | | +- org.apache.hadoop:hadoop-auth:jar:2.6.0-cdh5.5.1:compile
[INFO] | | | +- org.apache.httpcomponents:httpclient:jar:4.2.5:compile
[INFO] | | | | \- org.apache.httpcomponents:httpcore:jar:4.2.4:compile
[INFO] | | | \- org.apache.directory.server:apacheds-kerberos-codec:jar:2.0.0-M15:compile
[INFO] | | | +- org.apache.directory.server:apacheds-i18n:jar:2.0.0-M15:compile
[INFO] | | | +- org.apache.directory.api:api-asn1-api:jar:1.0.0-M20:compile
[INFO] | | | \- org.apache.directory.api:api-util:jar:1.0.0-M20:compile
[INFO] | | \- org.apache.htrace:htrace-core4:jar:4.0.1-incubating:compile
[INFO] | +- org.apache.hadoop:hadoop-hdfs:jar:2.6.0-cdh5.5.1:compile
[INFO] | | +- org.mortbay.jetty:jetty-util:jar:6.1.26.cloudera.4:compile
[INFO] | | +- xerces:xercesImpl:jar:2.9.1:compile
[INFO] | | | \- xml-apis:xml-apis:jar:1.3.04:compile
[INFO] | | \- org.fusesource.leveldbjni:leveldbjni-all:jar:1.8:compile
[INFO] | +- org.apache.hadoop:hadoop-mapreduce-client-app:jar:2.6.0-cdh5.5.1:compile
[INFO] | | +- org.apache.hadoop:hadoop-mapreduce-client-common:jar:2.6.0-cdh5.5.1:compile
[INFO] | | | +- org.apache.hadoop:hadoop-yarn-client:jar:2.6.0-cdh5.5.1:compile
[INFO] | | | \- org.apache.hadoop:hadoop-yarn-server-common:jar:2.6.0-cdh5.5.1:compile
[INFO] | | \- org.apache.hadoop:hadoop-mapreduce-client-shuffle:jar:2.6.0-cdh5.5.1:compile
[INFO] | +- org.apache.hadoop:hadoop-yarn-api:jar:2.6.0-cdh5.5.1:compile
[INFO] | +- org.apache.hadoop:hadoop-mapreduce-client-core:jar:2.6.0-cdh5.5.1:compile
[INFO] | | \- org.apache.hadoop:hadoop-yarn-common:jar:2.6.0-cdh5.5.1:compile
[INFO] | | +- javax.servlet:servlet-api:jar:2.5:compile
[INFO] | | +- com.sun.jersey:jersey-client:jar:1.9:compile
[INFO] | | +- org.codehaus.jackson:jackson-jaxrs:jar:1.8.8:compile
[INFO] | | \- org.codehaus.jackson:jackson-xc:jar:1.8.8:compile
[INFO] | +- org.apache.hadoop:hadoop-mapreduce-client-jobclient:jar:2.6.0-cdh5.5.1:compile
[INFO] | +- org.apache.hadoop:hadoop-aws:jar:2.6.0-cdh5.5.1:compile
[INFO] | | \- com.amazonaws:aws-java-sdk:jar:1.7.4:compile
[INFO] | \- org.apache.hadoop:hadoop-annotations:jar:2.6.0-cdh5.5.1:compile
[INFO] +- org.apache.kafka:kafka_2.11:jar:0.9.0-kafka-2.0.0:compile
[INFO] | +- com.101tec:zkclient:jar:0.7:compile
[INFO] | +- com.yammer.metrics:metrics-core:jar:2.2.0:compile
[INFO] | +- net.sf.jopt-simple:jopt-simple:jar:4.9:compile
[INFO] | +- org.scala-lang.modules:scala-parser-combinators_2.11:jar:1.0.4:compile
[INFO] | \- org.apache.zookeeper:zookeeper:jar:3.4.6:compile
[INFO] | \- jline:jline:jar:0.9.94:compile
[INFO] +- org.apache.kafka:kafka-clients:jar:0.9.0-kafka-2.0.0:compile
[INFO] +- commons-io:commons-io:jar:2.4:compile
[INFO] +- javax.xml.bind:jaxb-api:jar:2.2.11:compile
[INFO] +- org.jsoup:jsoup:jar:1.8.3:compile
[INFO] +- jdk.tools:jdk.tools:jar:1.7:compile
[INFO] +- commons-cli:commons-cli:jar:1.3.1:compile
[INFO] \- com.google.code.gson:gson:jar:2.5:compile
how do i resolve this issue.
Yes because of old hadoop-core.jar inside some dependency hierarchy cause this issue. After spending some time and research I found something useful:
Please use following dependencies in your pom.xml.
<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>WordCount</groupId>
<artifactId>WordCount</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-common</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-common</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-core</artifactId>
<version>3.2.0</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Sample java code which works well: AccessHDFS.java
package com.gpl.hadoop;
import java.io.InputStream;
import java.net.URI;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IOUtils;
public class AccessHDFS {
public static void main(String args[]) {
String url = "hdfs://localhost:9000/user/hduser/input/test.txt";
FileSystem fs = null;
InputStream in = null;
try {
Configuration conf = new Configuration();
fs = FileSystem.get(URI.create(url), conf);
in = fs.open(new Path(url));
IOUtils.copyBytes(in, System.out, 4096, false);
} catch (Exception e) {
e.printStackTrace();
} finally {
IOUtils.closeStream(fs);
}
}
}
Alternatively you can add following repository with given dependency.
<repositories>
<repository> <id>mapr-releases</id>
<url>http://repository.mapr.com/maven/</url>
<snapshots><enabled>false</enabled></snapshots>
<releases><enabled>true</enabled></releases>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-core</artifactId>
<version>2.4.1-mapr-1408</version>
</dependency>
</dependencies>
Make sure you do select Force Update of Snapshots/Releases option to update maven project from:
Project --> Maven --> Update Project --> Select Force Update of Snapshots/Releases --> ok
Check that you have the correct dependency and version in your case: 2.6.0
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs</artifactId>
<version>2.6.0</version>
</dependency>
This should resolve your error. You could also exclude, hadoop-core in the dependency. See this blog for more on the above solution.
I have my Spring Boot 1.2.5.RELEASE service and I want to use the HikariCP datasource instead of the default tomcat-jdbc. So, according to this Spring Boot Reference I understand I just have to exclude tomcat-jdbc from the classpath and add HikariCP.
So this is my pom.xml:
...
<dependencyManagement>
...
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>${spring-boot.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
...
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
</dependency>
</dependencies>
...
maven dependency tree:
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) # myproject-user-manage-webservice ---
[INFO] com.mybusiness.myproject:myproject-user-manage-webservice:jar:0.0.1-SNAPSHOT
[INFO] +- com.mybusiness.myproject:myproject-commons:jar:0.0.1-SNAPSHOT:compile
[INFO] | \- com.mybusiness.myproject:myproject-core:jar:0.0.1-SNAPSHOT:compile
[INFO] | \- com.mybusiness.myproject:myproject-core-commons:jar:0.0.1-SNAPSHOT:compile
[INFO] +- com.mybusiness.myproject:myproject-api:jar:0.0.1-SNAPSHOT:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.4.4:compile (version managed from 2.4.6)
[INFO] | \- com.mybusiness.myproject:myproject-framework:jar:0.0.1-SNAPSHOT:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-security:jar:1.2.1.RELEASE:compile (version managed from 1.2.5.RELEASE)
[INFO] | +- mysql:mysql-connector-java:jar:5.1.34:compile (version managed from 5.1.35)
[INFO] | +- com.mybusiness.framework:despegar-fwk-logging:jar:1.4.148:compile
[INFO] | +- org.jenkins-ci.plugins:testInProgress-client:jar:1.4:compile
[INFO] | | \- org.json:json:jar:20140107:compile
[INFO] | +- commons-io:commons-io:jar:1.3.2:compile
[INFO] | \- org.apache.commons:commons-lang3:jar:3.4:compile
[INFO] +- com.mybusiness.myproject:myproject-user-manage-domain:jar:0.0.1-SNAPSHOT:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-aop:jar:1.2.1.RELEASE:compile
[INFO] | | +- org.aspectj:aspectjrt:jar:1.8.4:compile (version managed from 1.8.2)
[INFO] | | \- org.aspectj:aspectjweaver:jar:1.8.4:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-data-jpa:jar:1.2.1.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.2.1.RELEASE:compile
[INFO] | | | +- org.springframework:spring-jdbc:jar:4.1.4.RELEASE:compile
[INFO] | | | \- org.springframework:spring-tx:jar:4.1.4.RELEASE:compile
[INFO] | | +- org.hibernate:hibernate-entitymanager:jar:4.3.7.Final:compile
[INFO] | | | +- org.jboss.logging:jboss-logging-annotations:jar:1.2.0.Beta1:compile
[INFO] | | | +- org.hibernate:hibernate-core:jar:4.3.7.Final:compile
[INFO] | | | | +- antlr:antlr:jar:2.7.7:compile
[INFO] | | | | \- org.jboss:jandex:jar:1.1.0.Final:compile
[INFO] | | | +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | | | | \- xml-apis:xml-apis:jar:1.0.b2:compile
[INFO] | | | +- org.hibernate.common:hibernate-commons-annotations:jar:4.0.5.Final:compile
[INFO] | | | \- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
[INFO] | | +- javax.transaction:javax.transaction-api:jar:1.2:compile
[INFO] | | +- org.springframework:spring-orm:jar:4.1.4.RELEASE:compile (version managed from 4.0.7.RELEASE)
[INFO] | | +- org.springframework.data:spring-data-jpa:jar:1.7.1.RELEASE:compile
[INFO] | | | \- org.springframework.data:spring-data-commons:jar:1.9.1.RELEASE:compile
[INFO] | | \- org.springframework:spring-aspects:jar:4.1.4.RELEASE:compile
[INFO] | +- org.springframework.security:spring-security-jwt:jar:1.0.2.RELEASE:compile (version managed from 1.0.3.RELEASE)
[INFO] | | \- org.bouncycastle:bcpkix-jdk15on:jar:1.47:compile
[INFO] | | \- org.bouncycastle:bcprov-jdk15on:jar:1.47:compile
[INFO] | \- org.flywaydb:flyway-core:jar:3.0:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.2.1.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:1.2.1.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:1.2.1.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:1.2.1.RELEASE:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.14:runtime
[INFO] | +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.2.1.RELEASE:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.0.15:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.0.15:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-logging-juli:jar:8.0.15:compile
[INFO] | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.0.15:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.4.4:compile
[INFO] | | \- com.fasterxml.jackson.core:jackson-core:jar:2.4.4:compile
[INFO] | +- org.hibernate:hibernate-validator:jar:5.1.3.Final:compile
[INFO] | | +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] | | \- org.jboss.logging:jboss-logging:jar:3.1.3.GA:compile
[INFO] | +- org.springframework:spring-core:jar:4.1.4.RELEASE:compile
[INFO] | +- org.springframework:spring-web:jar:4.1.4.RELEASE:compile
[INFO] | \- org.springframework:spring-webmvc:jar:4.1.4.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:4.1.4.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:1.2.1.RELEASE:compile
[INFO] | \- org.springframework.boot:spring-boot-actuator:jar:1.2.1.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:1.2.1.RELEASE:test (scope not updated to compile)
[INFO] | +- junit:junit:jar:4.12:test
[INFO] | +- org.mockito:mockito-core:jar:1.10.8:test
[INFO] | +- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] | +- org.hamcrest:hamcrest-library:jar:1.3:test
[INFO] | \- org.springframework:spring-test:jar:4.1.4.RELEASE:test
[INFO] +- org.springframework.boot:spring-boot-starter-log4j:jar:1.2.1.RELEASE:compile
[INFO] | +- org.slf4j:jcl-over-slf4j:jar:1.7.8:compile (version managed from 1.7.7)
[INFO] | +- org.slf4j:jul-to-slf4j:jar:1.7.8:compile
[INFO] | +- org.slf4j:slf4j-log4j12:jar:1.7.8:compile
[INFO] | \- log4j:log4j:jar:1.2.17:compile
[INFO] +- org.springframework.security.oauth:spring-security-oauth2:jar:2.0.7.RELEASE:compile
[INFO] | +- org.springframework:spring-beans:jar:4.1.4.RELEASE:compile
[INFO] | +- org.springframework:spring-context:jar:4.1.4.RELEASE:compile
[INFO] | +- org.springframework.security:spring-security-core:jar:3.2.5.RELEASE:compile
[INFO] | | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] | +- org.springframework.security:spring-security-config:jar:3.2.5.RELEASE:compile
[INFO] | +- org.springframework.security:spring-security-web:jar:3.2.5.RELEASE:compile
[INFO] | +- commons-codec:commons-codec:jar:1.6:compile
[INFO] | \- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
[INFO] | \- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
[INFO] +- org.springframework.hateoas:spring-hateoas:jar:0.16.0.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:4.1.4.RELEASE:compile (version managed from 3.2.9.RELEASE)
[INFO] | +- org.objenesis:objenesis:jar:2.1:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.7.8:compile (version managed from 1.7.7)
[INFO] +- com.zaxxer:HikariCP:jar:2.2.5:compile
[INFO] | \- org.javassist:javassist:jar:3.18.1-GA:compile
[INFO] +- ma.glasnost.orika:orika-core:jar:1.4.5:compile
[INFO] | +- com.thoughtworks.paranamer:paranamer:jar:2.3:compile
[INFO] | +- com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:jar:1.2_jdk5:compile
[INFO] | \- com.carrotsearch:java-sizeof:jar:0.0.4:compile
[INFO] +- io.springfox:springfox-swagger2:jar:2.1.1:compile
[INFO] | +- org.mapstruct:mapstruct:jar:1.0.0.Beta4:compile
[INFO] | +- io.swagger:swagger-annotations:jar:1.5.0:compile
[INFO] | +- io.swagger:swagger-models:jar:1.5.0:compile
[INFO] | +- io.springfox:springfox-spi:jar:2.1.1:compile
[INFO] | | \- io.springfox:springfox-core:jar:2.1.1:compile
[INFO] | +- io.springfox:springfox-schema:jar:2.1.1:compile
[INFO] | +- io.springfox:springfox-swagger-common:jar:2.1.1:compile
[INFO] | +- io.springfox:springfox-spring-web:jar:2.1.1:compile
[INFO] | +- com.google.guava:guava:jar:18.0:compile
[INFO] | +- com.fasterxml:classmate:jar:1.2.0:compile
[INFO] | +- joda-time:joda-time:jar:2.5:compile
[INFO] | +- org.springframework.plugin:spring-plugin-core:jar:1.2.0.RELEASE:compile
[INFO] | \- org.springframework.plugin:spring-plugin-metadata:jar:1.2.0.RELEASE:compile
[INFO] \- io.springfox:springfox-swagger-ui:jar:2.1.1:compile
So, HikariCP is definitely in tha classpath and tomcat-jdbc is not. But when I launch the service, autoconfig is still creating org.apache.tomcat.jdbc.pool.DataSource instead of a HikariCP one.
What I am doing wrong?
EDIT
This is my application launcher:
#SpringBootApplication
#EnableHypermediaSupport(type = {HypermediaType.HAL})
public class ApplicationRunner {
public static void main(String[] args) {
SpringApplication.run(ApplicationRunner.class, args);
}
}
Include Hikari in your pom
Add the following property to your application.yml
spring:
datasource:
type: com.zaxxer.hikari.HikariDataSource
...
Edit: This answer gives the way to configure Hikari in standard Spring, also valid for Boot. However, as Boot has added greater integration for Hikari since I wrote it, answers like this could be valid and more suitable for Boot.
Just provide the datasource in a #Configuration class:
#Configuration
public class HikariCPConfig {
#Value("${hikari.driverclassname}")
private String driverClassName;
#Value("${hikari.jdbc.url}")
private String jdbcUrl;
#Value("${hikari.username}")
private String userName;
#Value("${hikari.password}")
private String password;
#Value("${hikari.pool.size}")
private int poolSize;
#Bean(destroyMethod = "close")
public DataSource dataSource() {
final HikariDataSource ds = new HikariDataSource();
ds.setMaximumPoolSize(poolSize);
ds.setDriverClassName(driverClassName);
ds.setJdbcUrl(jdbcUrl);
ds.setUsername(userName);
ds.setPassword(password);
return ds;
}
}
Then, in the application.properties file, declare your properties for the datasource, which can be provided by the maven build:
#Hikari
hikari.driverclassname = com.mysql.jdbc.Driver
hikari.jdbc.url = jdbc:mysql://localhost:3306/my_db
hikari.username = ${db.username}
hikari.password = ${db.password}
hikari.pool.size = 5
Then you'll need Spring to scan your HikariCPConfig class, but as you're using #SpringBootApplication which is equivalent to #Configuration #EnableAutoConfiguration and #ComponentScan it shouldn't be a problem.
See also:
Using the #SpringBootApplication annotation
Configuring a datasource in Spring Boot
spring.datasouce.type starts with spring boot 1.3.0, so it won't work on 1.2.5
My local environment: OSX 10.9.2, java1.6
I use java api to connect hbase and maven to manage my project, I added Hbase-0.94.17 and Hadoop-core-1.0.4 into pom.xml, when I ran my .java program to connect Hbase I got the following error:
SLF4J: slf4j-api 1.6.x (or later) is incompatible with this binding.
SLF4J: Your binding is version 1.5.5 or earlier.
SLF4J: Upgrade your binding to version 1.6.x.
Exception in thread "main" java.lang.NoSuchMethodError: org.slf4j.impl.StaticLoggerBinder.getSingleton()Lorg/slf4j/impl/StaticLoggerBinder;
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)
at org.apache.zookeeper.ZooKeeper.<clinit>(ZooKeeper.java:94)
at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.<init>(RecoverableZooKeeper.java:98)
at org.apache.hadoop.hbase.zookeeper.ZKUtil.connect(ZKUtil.java:127)
at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.<init>(ZooKeeperWatcher.java:153)
at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.<init>(ZooKeeperWatcher.java:127)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getZooKeeperWatcher(HConnectionManager.java:1505)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.ensureZookeeperTrackers(HConnectionManager.java:713)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:983)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:958)
at org.apache.hadoop.hbase.client.HTable.finishSetup(HTable.java:251)
at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:155)
at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:129)
at org.geogit.storage.hbase.MyLittleHBaseClient.main(MyLittleHBaseClient.java:29)
Here is what I got after ran mvm dependency:tree
INFO] --- maven-dependency-plugin:2.2:tree (default-cli) # geogit-hbase ---
[INFO] org.geogit:geogit-hbase:jar:0.8-SNAPSHOT
[INFO] +- org.geogit:geogit-core:jar:0.8-SNAPSHOT:compile
[INFO] | +- org.slf4j:slf4j-api:jar:1.7.5:compile
[INFO] | +- com.vividsolutions:jts:jar:1.13:compile
[INFO] | +- org.geotools:gt-opengis:jar:10.5:compile
[INFO] | | +- net.java.dev.jsr-275:jsr-275:jar:1.0-beta-2:compile
[INFO] | | +- java3d:vecmath:jar:1.3.2:compile
[INFO] | | +- commons-pool:commons-pool:jar:1.5.4:compile
[INFO] | | \- javax.media:jai_core:jar:1.1.3:compile
[INFO] | +- org.geotools:gt-referencing:jar:10.5:compile
[INFO] | | +- org.geotools:gt-metadata:jar:10.5:compile
[INFO] | | \- jgridshift:jgridshift:jar:1.0:compile
[INFO] | +- org.geotools:gt-epsg-hsql:jar:10.5:compile
[INFO] | | \- hsqldb:hsqldb:jar:1.8.0.7:compile
[INFO] | +- org.geotools:gt-main:jar:10.5:compile
[INFO] | | \- org.geotools:gt-api:jar:10.5:compile
[INFO] | +- org.geotools:gt-cql:jar:10.5:compile
[INFO] | +- net.sourceforge.findbugs:jsr305:jar:1.3.7:compile
[INFO] | +- com.google.inject:guice:jar:3.0:compile
[INFO] | | +- javax.inject:javax.inject:jar:1:compile
[INFO] | | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] | +- com.google.inject.extensions:guice-multibindings:jar:3.0:compile
[INFO] | +- com.google.code.gson:gson:jar:2.2.2:compile
[INFO] | \- com.ning:compress-lzf:jar:0.9.8:compile
[INFO] +- org.apache.hbase:hbase-client:jar:0.98.0-hadoop2:compile
[INFO] | +- org.apache.hbase:hbase-common:jar:0.98.0-hadoop2:compile
[INFO] | | +- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] | | \- log4j:log4j:jar:1.2.17:compile
[INFO] | +- org.apache.hbase:hbase-protocol:jar:0.98.0-hadoop2:compile
[INFO] | +- commons-codec:commons-codec:jar:1.7:compile
[INFO] | +- commons-io:commons-io:jar:2.4:compile
[INFO] | +- commons-lang:commons-lang:jar:2.6:compile
[INFO] | +- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] | +- com.google.protobuf:protobuf-java:jar:2.5.0:compile
[INFO] | +- io.netty:netty:jar:3.6.6.Final:compile
[INFO] | +- org.apache.zookeeper:zookeeper:jar:3.4.5:compile
[INFO] | | \- org.slf4j:slf4j-log4j12:jar:1.6.1:compile
[INFO] | +- org.cloudera.htrace:htrace-core:jar:2.04:compile
[INFO] | | \- org.mortbay.jetty:jetty-util:jar:6.1.26:compile
[INFO] | +- org.codehaus.jackson:jackson-mapper-asl:jar:1.8.8:compile
[INFO] | | \- org.codehaus.jackson:jackson-core-asl:jar:1.8.8:compile
[INFO] | +- org.apache.hadoop:hadoop-common:jar:2.2.0:compile
[INFO] | | +- commons-cli:commons-cli:jar:1.2:compile
[INFO] | | +- org.apache.commons:commons-math:jar:2.1:compile
[INFO] | | +- xmlenc:xmlenc:jar:0.52:compile
[INFO] | | +- commons-httpclient:commons-httpclient:jar:3.1:compile
[INFO] | | +- commons-net:commons-net:jar:3.1:compile
[INFO] | | +- org.mortbay.jetty:jetty:jar:6.1.26:compile
[INFO] | | +- com.sun.jersey:jersey-core:jar:1.9:compile
[INFO] | | +- com.sun.jersey:jersey-json:jar:1.9:compile
[INFO] | | | +- org.codehaus.jettison:jettison:jar:1.0.1:compile (version managed from 1.1)
[INFO] | | | | \- stax:stax-api:jar:1.0.1:compile
[INFO] | | | +- com.sun.xml.bind:jaxb-impl:jar:2.2.3-1:compile
[INFO] | | | | \- javax.xml.bind:jaxb-api:jar:2.2.2:compile
[INFO] | | | | \- javax.activation:activation:jar:1.1:compile
[INFO] | | | +- org.codehaus.jackson:jackson-jaxrs:jar:1.8.3:compile
[INFO] | | | \- org.codehaus.jackson:jackson-xc:jar:1.8.3:compile
[INFO] | | +- commons-el:commons-el:jar:1.0:runtime
[INFO] | | +- net.java.dev.jets3t:jets3t:jar:0.6.1:compile
[INFO] | | +- commons-configuration:commons-configuration:jar:1.6:compile
[INFO] | | | +- commons-digester:commons-digester:jar:1.8:compile
[INFO] | | | | \- commons-beanutils:commons-beanutils:jar:1.7.0:compile
[INFO] | | | \- commons-beanutils:commons-beanutils-core:jar:1.8.0:compile
[INFO] | | +- org.apache.avro:avro:jar:1.7.4:compile
[INFO] | | | +- com.thoughtworks.paranamer:paranamer:jar:2.3:compile
[INFO] | | | \- org.xerial.snappy:snappy-java:jar:1.0.4.1:compile
[INFO] | | +- com.jcraft:jsch:jar:0.1.42:compile
[INFO] | | \- org.apache.commons:commons-compress:jar:1.4.1:compile
[INFO] | | \- org.tukaani:xz:jar:1.0:compile
[INFO] | +- org.apache.hadoop:hadoop-auth:jar:2.2.0:compile
[INFO] | +- org.apache.hadoop:hadoop-mapreduce-client-core:jar:2.2.0:compile
[INFO] | | +- org.apache.hadoop:hadoop-yarn-common:jar:2.2.0:compile
[INFO] | | | +- org.apache.hadoop:hadoop-yarn-api:jar:2.2.0:compile
[INFO] | | | +- com.sun.jersey:jersey-server:jar:1.9:compile
[INFO] | | | | \- asm:asm:jar:3.1:compile
[INFO] | | | \- com.sun.jersey.contribs:jersey-guice:jar:1.9:compile
[INFO] | | \- com.google.inject.extensions:guice-servlet:jar:3.0:compile
[INFO] | +- org.apache.hadoop:hadoop-annotations:jar:2.2.0:compile
[INFO] | \- com.github.stephenc.findbugs:findbugs-annotations:jar:1.3.9-1:compile
[INFO] +- org.geogit:geogit-mongodb:jar:0.8-SNAPSHOT:compile
[INFO] | +- org.geogit:geogit-blueprints:jar:0.8-SNAPSHOT:compile
[INFO] | | +- com.tinkerpop.blueprints:blueprints-core:jar:2.4.0:compile
[INFO] | | | +- com.fasterxml.jackson.datatype:jackson-datatype-json-org:jar:2.1.2:compile
[INFO] | | | | +- com.fasterxml.jackson.core:jackson-core:jar:2.1.2:compile
[INFO] | | | | +- com.fasterxml.jackson.core:jackson-databind:jar:2.1.2:compile
[INFO] | | | | | \- com.fasterxml.jackson.core:jackson-annotations:jar:2.1.1:compile
[INFO] | | | | \- org.json:json:jar:20090211:compile
[INFO] | | | \- colt:colt:jar:1.2.0:compile
[INFO] | | | \- concurrent:concurrent:jar:1.3.4:compile
[INFO] | | \- com.tinkerpop.gremlin:gremlin-java:jar:2.4.0:compile
[INFO] | | \- com.tinkerpop:pipes:jar:2.4.0:compile
[INFO] | \- org.mongodb:mongo-java-driver:jar:2.11.3:compile
[INFO] +- com.google.guava:guava:jar:14.0.1:compile
[INFO] +- org.geogit:geogit-core:jar:tests:0.8-SNAPSHOT:test
[INFO] \- junit:junit:jar:4.10:test
[INFO] \- org.hamcrest:hamcrest-core:jar:1.1:test
And here I attach my pom.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.geogit</groupId>
<artifactId>storage</artifactId>
<version>0.8-SNAPSHOT</version>
</parent>
<groupId>org.geogit</groupId>
<artifactId>geogit-hbase</artifactId>
<packaging>jar</packaging>
<name>HBase Storage for GeoGit objects</name>
<dependencies>
<dependency>
<groupId>org.geogit</groupId>
<artifactId>geogit-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase</artifactId>
<version>0.94.17</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-core</artifactId>
<version>1.0.4</version>
</dependency>
<!-- is this necessary? -->
<!--
<dependency>
<groupId>com.boundlessgeo</groupId>
<artifactId>blongo</artifactId>
<version>0.1</version>
</dependency>
-->
<!-- is this necessary? -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<!-- Test scope dependencies -->
<dependency>
<groupId>org.geogit</groupId>
<artifactId>geogit-core</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<classifier>tests</classifier>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
</profiles>
</project>
Have slf4j-api and choose a SLF4J binding of corresponding version, and add them as dependencies in your own POM. It is quite possibly some of your dependencies transitively resolve an incompatible version of SLF4J binding which caused the problem. Find which library is bringing in the unwanted SLF4J binding (you can easily do so by mvn dependency:tree), and add corresponding exclusion in your dependency to that lib.
(Normally SLF4J binding shouldn't be declared in library. It is in fact something wrong that you may want to report to the library developer once you found the actual cause)
Update
That's exactly what I am talking about:
From your dependency tree:
[INFO] +- org.geogit:geogit-core:jar:0.8-SNAPSHOT:compile
[INFO] | +- org.slf4j:slf4j-api:jar:1.7.5:compile
.....
[INFO] +- org.apache.hbase:hbase-client:jar:0.98.0-hadoop2:compile
.....
[INFO] | +- org.apache.zookeeper:zookeeper:jar:3.4.5:compile
[INFO] | | \- org.slf4j:slf4j-log4j12:jar:1.6.1:compile
You got slf4j-log4j12 binding from hbase-client, and that's version 1.6.1
However, slf4j-api you have in your project is version 1.7.5. They are not compatible.
Proper way to solve is:
Exclude slf4j-log4j12 from your dependency of hbase-client
Declare a compatible SLF4J binding in your own project
You should also report this as a bug to zookeeper/hbase developer as it is not appropriate for a library to include SLF4J binding as compile scope dependency.