xvik / dropwizard-guicey

Dropwizard guice integration
http://xvik.github.io/dropwizard-guicey/
MIT License
233 stars 49 forks source link

Guice 4.1 mapbinders #14

Closed sheldon-sminq closed 8 years ago

sheldon-sminq commented 8 years ago

While i was using the 3.2 release i have mapbinders all over my code to map interfaces to the actual implementations

In addition to binding Map<K, V>, a mapbinder will also bind Map<K, Provider<V>> for lazy value provision

But with the latest 3.3 update, when ever i try to lazily fetch an instance using the Map<K, Provider<V>> its takes very long to fetch the instance. Is there any update in the way these providers are handled?

xvik commented 8 years ago

If I understand correctly, you are using multibindings directly so it should be guice 4.1 regression (not related to guicey directly).

Can you please try to run it with guice 4.0 (exclude guice deps for guicey and manually specify guice) to be sure?

If guice 4.0 will be faster we will need to report regression to guice. If I misunderstand you and you were talking about plugins installer then try to enable diagnostic to see better timings.

Please notify me about results.

sheldon-sminq commented 8 years ago

Sure will check the same.

xvik commented 8 years ago

Oh I missed that both issues are yours :)

sheldon-sminq commented 8 years ago

I will try and use your plugin mechanism and see if it makes a difference. Ho do i use your plugin map binding method without enums?

I define my mapbindings this way MapBinder<String, BillingService> billingBinder = MapBinder.newMapBinder(binder(), String.class, BillingService.class); billingBinder.addBinding("business1").to(BillingServiceImpl.class);

xvik commented 8 years ago

Have you tried with guice 4.0? Is it faster (as before)? I want to be sure who is guilty: me or gucie 4.1

You can use whatever you want for plugin key, it's your annotation:

@Plugin(PluginInterface.class)
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface MyPlugin {
    String value(); // for example String
}

@MyPlugin("StringKey")

But if there is a problem with multibindings, then plugins will not save you because from guice perspective it will be the same. Ofc there will be benefits of logging and including plugins class loading time in overall guicey time.

sheldon-sminq commented 8 years ago

I tried switching to Juice 4.0 but still facing the same issue, i got another app running with the old version and its fast.

I can attach the dependency tree for both apps will that help?

sheldon-sminq commented 8 years ago

Slow app dependency tree

+- io.dropwizard:dropwizard-core:jar:0.9.3:compile
[] |  +- io.dropwizard:dropwizard-util:jar:0.9.3:compile
[] |  |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.6.0:compile
[] |  |  \- com.google.code.findbugs:jsr305:jar:3.0.1:compile
[] |  +- io.dropwizard:dropwizard-jackson:jar:0.9.3:compile
[] |  |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.6.7:compile
[] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk7:jar:2.6.7:compile
[] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-guava:jar:2.6.7:compile
[] |  |  +- com.fasterxml.jackson.module:jackson-module-afterburner:jar:2.6.7:compile
[] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-joda:jar:2.6.7:compile
[] |  |  \- ch.qos.logback:logback-classic:jar:1.1.3:compile
[] |  +- io.dropwizard:dropwizard-validation:jar:0.9.3:compile
[] |  |  +- org.hibernate:hibernate-validator:jar:5.2.2.inal:compile
[] |  |  |  +- javax.validation:validation-api:jar:1.1.0.inal:compile
[] |  |  |  +- org.jboss.logging:jboss-logging:jar:3.2.1.inal:compile
[] |  |  |  \- com.fasterxml:classmate:jar:1.1.0:compile
[] |  |  \- org.glassfish:javax.el:jar:3.0.0:compile
[] |  +- io.dropwizard:dropwizard-configuration:jar:0.9.3:compile
[] |  |  \- org.apache.commons:commons-lang3:jar:3.4:compile
[] |  +- io.dropwizard:dropwizard-logging:jar:0.9.3:compile
[] |  |  +- io.dropwizard.metrics:metrics-logback:jar:3.1.2:compile
[] |  |  +- org.slf4j:jul-to-slf4j:jar:1.7.21:compile
[] |  |  +- ch.qos.logback:logback-core:jar:1.1.3:compile
[] |  |  +- org.slf4j:log4j-over-slf4j:jar:1.7.21:compile
[] |  |  +- org.slf4j:jcl-over-slf4j:jar:1.7.21:compile
[] |  |  \- org.eclipse.jetty:jetty-util:jar:9.2.17.v20160517:compile
[] |  +- io.dropwizard:dropwizard-metrics:jar:0.9.3:compile
[] |  +- io.dropwizard:dropwizard-jersey:jar:0.9.3:compile
[] |  |  +- org.glassfish.jersey.core:jersey-server:jar:2.22.1:compile
[] |  |  |  +- javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile
[] |  |  |  +- org.glassfish.jersey.media:jersey-media-jaxb:jar:2.22.1:compile
[] |  |  |  +- javax.annotation:javax.annotation-api:jar:1.2:compile
[] |  |  |  +- org.glassfish.hk2.external:javax.inject:jar:2.4.0-b31:compile
[] |  |  |  \- org.glassfish.hk2:hk2-locator:jar:2.4.0-b31:compile
[] |  |  |     \- org.javassist:javassist:jar:3.18.1-GA:compile
[] |  |  +- org.glassfish.jersey.ext:jersey-metainf-services:jar:2.22.1:compile
[] |  |  +- org.glassfish.jersey.ext:jersey-bean-validation:jar:2.22.1:compile
[] |  |  +- io.dropwizard.metrics:metrics-jersey2:jar:3.1.2:compile
[] |  |  +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.6.7:compile
[] |  |  |  +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.6.7:compile
[] |  |  |  \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.6.7:compile
[] |  |  +- org.glassfish.jersey.containers:jersey-container-servlet:jar:2.22.1:compile
[] |  |  |  \- org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.22.1:compile
[] |  |  +- org.eclipse.jetty:jetty-server:jar:9.2.17.v20160517:compile
[] |  |  |  +- javax.servlet:javax.servlet-api:jar:3.1.0:compile
[] |  |  |  \- org.eclipse.jetty:jetty-io:jar:9.2.17.v20160517:compile
[] |  |  +- org.eclipse.jetty:jetty-webapp:jar:9.2.17.v20160517:compile
[] |  |  |  \- org.eclipse.jetty:jetty-xml:jar:9.2.17.v20160517:compile
[] |  |  \- org.eclipse.jetty:jetty-continuation:jar:9.2.17.v20160517:compile
[] |  +- io.dropwizard:dropwizard-servlets:jar:0.9.3:compile
[] |  |  \- io.dropwizard.metrics:metrics-annotation:jar:3.1.2:compile
[] |  +- io.dropwizard:dropwizard-jetty:jar:0.9.3:compile
[] |  |  +- io.dropwizard.metrics:metrics-jetty9:jar:3.1.2:compile
[] |  |  +- org.eclipse.jetty:jetty-servlet:jar:9.2.17.v20160517:compile
[] |  |  |  \- org.eclipse.jetty:jetty-security:jar:9.2.17.v20160517:compile
[] |  |  +- org.eclipse.jetty:jetty-servlets:jar:9.2.17.v20160517:compile
[] |  |  \- org.eclipse.jetty:jetty-http:jar:9.2.17.v20160517:compile
[] |  +- io.dropwizard:dropwizard-lifecycle:jar:0.9.3:compile
[] |  +- io.dropwizard.metrics:metrics-core:jar:3.1.2:compile
[] |  +- io.dropwizard.metrics:metrics-jvm:jar:3.1.2:compile
[] |  +- io.dropwizard.metrics:metrics-servlets:jar:3.1.2:compile
[] |  |  \- io.dropwizard.metrics:metrics-json:jar:3.1.2:compile
[] |  +- io.dropwizard.metrics:metrics-healthchecks:jar:3.1.2:compile
[] |  +- net.sourceforge.argparse4j:argparse4j:jar:0.6.0:compile
[] |  \- org.eclipse.jetty.toolchain.setuid:jetty-setuid-java:jar:1.0.3:compile
[] +- io.dropwizard:dropwizard-auth:jar:0.9.3:compile
[] +- io.dropwizard:dropwizard-forms:jar:0.9.3:compile
[] |  \- org.glassfish.jersey.media:jersey-media-multipart:jar:2.22.1:compile
[] |     +- org.glassfish.jersey.core:jersey-common:jar:2.22.1:compile
[] |     |  +- org.glassfish.jersey.bundles.repackaged:jersey-guava:jar:2.22.1:compile
[] |     |  \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.1:compile
[] |     \- org.jvnet.mimepull:mimepull:jar:1.9.6:compile
[] +- javax.persistence:persistence-api:jar:1.0.2:compile
[] +- io.dropwizard:dropwizard-testing:jar:0.9.3:compile
[] |  +- junit:junit:jar:4.12:compile
[] |  |  \- org.hamcrest:hamcrest-core:jar:1.3:compile
[] |  +- org.mockito:mockito-core:jar:1.10.19:compile
[] |  +- org.objenesis:objenesis:jar:2.2:compile
[] |  +- org.assertj:assertj-core:jar:2.2.0:compile
[] |  \- org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-inmemory:jar:2.22.1:compile
[] |     +- org.glassfish.jersey.test-framework:jersey-test-framework-core:jar:2.22.1:compile
[] |     +- org.glassfish.jersey.core:jersey-client:jar:2.22.1:compile
[] |     \- org.ow2.asm:asm-debug-all:jar:5.0.4:compile
[] +- org.hamcrest:hamcrest-all:jar:1.3:compile
[] +- redis.clients:jedis:jar:2.8.1:compile
[] |  \- org.apache.commons:commons-pool2:jar:2.4.2:compile
[] +- org.mariadb.jdbc:mariadb-java-client:jar:1.3.4:compile
[] +- org.quartz-scheduler:quartz:jar:2.2.2:compile
[] |  +- c3p0:c3p0:jar:0.9.1.1:compile
[] |  \- org.slf4j:slf4j-api:jar:1.7.7:compile
[] +- org.quartz-scheduler:quartz-jobs:jar:2.2.2:compile
[] +- de.thomaskrille:dropwizard-template-config:jar:1.4.0:compile
[] +- io.dropwizard:dropwizard-metrics-graphite:jar:0.9.3:compile
[] |  \- io.dropwizard.metrics:metrics-graphite:jar:3.1.2:compile
[] +- com.jamierf.dropwizard:dropwizard-logging-loggly:jar:0.7:compile
[] |  +- ch.qos.logback.contrib:logback-json-classic:jar:0.1.2:compile
[] |  |  \- ch.qos.logback.contrib:logback-json-core:jar:0.1.2:compile
[] |  +- ch.qos.logback.contrib:logback-jackson:jar:0.1.2:compile
[] |  \- org.logback-extensions:logback-ext-loggly:jar:0.1.2:compile
[] +- com.amazonaws:aws-java-sdk-sqs:jar:1.11.13:compile
[] |  \- com.amazonaws:aws-java-sdk-core:jar:1.11.13:compile
[] |     \- commons-logging:commons-logging:jar:1.1.3:compile
[] +- com.amazonaws:aws-java-sdk-sns:jar:1.11.13:compile
[] +- joda-time:joda-time:jar:2.8.1:compile
[] +- com.fasterxml:jackson-xml-databind:jar:0.6.2:compile
[] |  +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.2:compile
[] |  |  \- org.codehaus.jackson:jackson-core-asl:jar:1.9.2:compile
[] |  +- org.codehaus.jackson:jackson-xc:jar:1.9.2:compile
[] |  \- org.codehaus.woodstox:stax2-api:jar:3.1.0:compile
[] |     \- javax.xml.stream:stax-api:jar:1.0-2:compile
[] +- org.jooq:jooq:jar:3.8.4:compile
[] +- com.amazonaws:aws-java-sdk-ses:jar:1.11.13:compile
[] +- com.amazonaws:aws-java-sdk-s3:jar:1.11.13:compile
[] |  \- com.amazonaws:aws-java-sdk-kms:jar:1.11.13:compile
[] +- com.pubnub:pubnub:jar:3.7.5:compile
[] |  +- org.json:json:jar:20090211:compile
[] |  \- org.bouncycastle:bcprov-jdk16:jar:1.46:compile
[] +- ru.vyarus:dropwizard-guicey:jar:3.3.0:compile
[] |  +- com.google.inject.extensions:guice-servlet:jar:4.1.0:compile
[] |  +- org.glassfish.hk2:guice-bridge:jar:2.4.0-b31:compile
[] |  |  +- javax.inject:javax.inject:jar:1:compile
[] |  |  \- org.glassfish.hk2:hk2-api:jar:2.4.0-b31:compile
[] |  |     +- org.glassfish.hk2:hk2-utils:jar:2.4.0-b31:compile
[] |  |     \- org.glassfish.hk2.external:aopalliance-repackaged:jar:2.4.0-b31:compile
[] |  \- ru.vyarus:generics-resolver:jar:2.0.1:compile
[] +- com.google.inject.extensions:guice-multibindings:jar:4.1.0:compile
[] |  \- com.google.inject:guice:jar:4.1.0:compile
[] |     \- aopalliance:aopalliance:jar:1.0:compile
[] +- io.searchbox:jest:jar:2.0.2:compile
[] |  +- io.searchbox:jest-common:jar:2.0.2:compile
[] |  |  \- com.google.code.gson:gson:jar:2.6.2:compile
[] |  +- org.apache.httpcomponents:httpcore-nio:jar:4.4.4:compile
[] |  |  \- org.apache.httpcomponents:httpcore:jar:4.4.4:compile
[] |  +- org.apache.httpcomponents:httpclient:jar:4.5.2:compile
[] |  |  \- commons-codec:commons-codec:jar:1.9:compile
[] |  \- org.apache.httpcomponents:httpasyncclient:jar:4.1.1:compile
[] +- org.elasticsearch:elasticsearch:jar:2.3.2:compile
[] |  +- org.apache.lucene:lucene-core:jar:5.5.0:compile
[] |  +- org.apache.lucene:lucene-backward-codecs:jar:5.5.0:compile
[] |  +- org.apache.lucene:lucene-analyzers-common:jar:5.5.0:compile
[] |  +- org.apache.lucene:lucene-queries:jar:5.5.0:compile
[] |  +- org.apache.lucene:lucene-memory:jar:5.5.0:compile
[] |  +- org.apache.lucene:lucene-highlighter:jar:5.5.0:compile
[] |  +- org.apache.lucene:lucene-queryparser:jar:5.5.0:compile
[] |  |  \- org.apache.lucene:lucene-sandbox:jar:5.5.0:compile
[] |  +- org.apache.lucene:lucene-suggest:jar:5.5.0:compile
[] |  |  \- org.apache.lucene:lucene-misc:jar:5.5.0:compile
[] |  +- org.apache.lucene:lucene-join:jar:5.5.0:compile
[] |  |  \- org.apache.lucene:lucene-grouping:jar:5.5.0:compile
[] |  +- org.apache.lucene:lucene-spatial:jar:5.5.0:compile
[] |  |  +- org.apache.lucene:lucene-spatial3d:jar:5.5.0:compile
[] |  |  \- com.spatial4j:spatial4j:jar:0.5:compile
[] |  +- com.google.guava:guava:jar:18.0:compile
[] |  +- org.elasticsearch:securesm:jar:1.0:compile
[] |  +- com.carrotsearch:hppc:jar:0.7.1:compile
[] |  +- org.joda:joda-convert:jar:1.2:compile
[] |  +- com.fasterxml.jackson.dataformat:jackson-dataformat-smile:jar:2.6.2:compile
[] |  +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.6.2:compile
[] |  |  \- org.yaml:snakeyaml:jar:1.15:compile
[] |  +- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar:2.6.2:compile
[] |  +- io.netty:netty:jar:3.10.5.inal:compile
[] |  +- com.ning:compress-lzf:jar:1.0.2:compile
[] |  +- com.tdunning:t-digest:jar:3.0:compile
[] |  +- org.hdrhistogram:HdrHistogram:jar:2.1.6:compile
[] |  +- commons-cli:commons-cli:jar:1.3.1:compile
[] |  \- com.twitter:jsr166e:jar:1.1.0:compile
[] +- com.fasterxml.jackson.core:jackson-core:jar:2.7.4:compile
[] +- javax.mail:mail:jar:1.4.7:compile
[] |  \- javax.activation:activation:jar:1.1:compile
[] +- io.dropwizard:dropwizard-views-freemarker:jar:0.9.3:compile
[] |  +- io.dropwizard:dropwizard-views:jar:0.9.3:compile
[] |  \- org.freemarker:freemarker:jar:2.3.23:compile
[] +- org.springframework:spring-context:jar:4.3.1.RELEASE:compile
[] |  +- org.springframework:spring-aop:jar:4.3.1.RELEASE:compile
[] |  +- org.springframework:spring-beans:jar:4.3.1.RELEASE:compile
[] |  +- org.springframework:spring-core:jar:4.3.1.RELEASE:compile
[] |  \- org.springframework:spring-expression:jar:4.3.1.RELEASE:compile
[] +- org.springframework:spring-jdbc:jar:4.3.1.RELEASE:compile
[] |  \- org.springframework:spring-tx:jar:4.3.1.RELEASE:compile
[] +- com.zaxxer:HikariCP:jar:2.4.7:compile
[] +- co.paralleluniverse:quasar-core:jar:jdk8:0.7.2:compile
[] |  +- org.latencyutils:LatencyUtils:jar:2.0.2:compile
[] |  +- com.lmax:disruptor:jar:3.3.2:compile
[] |  +- de.javakaffee:kryo-serializers:jar:0.30:compile
[] |  |  \- com.google.protobuf:protobuf-java:jar:2.6.1:compile
[] |  \- com.esotericsoftware.kryo:kryo:jar:2.24.0:compile
[] |     \- com.esotericsoftware.minlog:minlog:jar:1.2:compile
[] +- co.paralleluniverse:comsat-jooq:jar:0.7.0:compile
[] |  \- co.paralleluniverse:comsat-jdbc:jar:0.7.0:compile
[] \- com.vladmihalcea.flexy-pool:flexy-hikaricp:jar:1.2.4:compile
[]    +- com.vladmihalcea.flexy-pool:flexy-pool-core:jar:1.2.4:compile
[]    +- com.vladmihalcea.flexy-pool:flexy-codahale-metrics:jar:1.2.4:compile
[]    \- com.vladmihalcea.flexy-pool:flexy-dropwizard-metrics:jar:1.2.4:compile
sheldon-sminq commented 8 years ago

Fast app dependency tree using guicey 3.2.0

[] --- maven-dependency-plugin:2.8:tree (default-cli) @ sminq-backend ---
[WARG] The artifact org.apache.commons:commons-io:jar:1.3.2 has been relocated to commons-io:commons-io:jar:1.3.2
[] sminq:sminq-backend:jar:1.5.6
[] +- io.dropwizard:dropwizard-views-freemarker:jar:0.9.3:compile
[] |  +- io.dropwizard:dropwizard-views:jar:0.9.3:compile
[] |  \- org.freemarker:freemarker:jar:2.3.23:compile
[] +- io.dropwizard:dropwizard-assets:jar:0.9.3:compile
[] |  \- io.dropwizard:dropwizard-servlets:jar:0.9.3:compile
[] |     +- io.dropwizard.metrics:metrics-annotation:jar:3.1.2:compile
[] |     \- ch.qos.logback:logback-classic:jar:1.1.3:compile
[] +- io.dropwizard:dropwizard-core:jar:0.9.3:compile
[] |  +- io.dropwizard:dropwizard-util:jar:0.9.3:compile
[] |  |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.6.0:compile
[] |  |  \- com.google.code.findbugs:jsr305:jar:3.0.1:compile
[] |  +- io.dropwizard:dropwizard-jackson:jar:0.9.3:compile
[] |  |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.6.7:compile
[] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk7:jar:2.6.7:compile
[] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-guava:jar:2.6.7:compile
[] |  |  +- com.fasterxml.jackson.module:jackson-module-afterburner:jar:2.6.7:compile
[] |  |  \- com.fasterxml.jackson.datatype:jackson-datatype-joda:jar:2.6.7:compile
[] |  +- io.dropwizard:dropwizard-validation:jar:0.9.3:compile
[] |  |  +- org.hibernate:hibernate-validator:jar:5.2.2.inal:compile
[] |  |  |  +- javax.validation:validation-api:jar:1.1.0.inal:compile
[] |  |  |  +- org.jboss.logging:jboss-logging:jar:3.2.1.inal:compile
[] |  |  |  \- com.fasterxml:classmate:jar:1.1.0:compile
[] |  |  \- org.glassfish:javax.el:jar:3.0.0:compile
[] |  +- io.dropwizard:dropwizard-configuration:jar:0.9.3:compile
[] |  |  \- org.apache.commons:commons-lang3:jar:3.4:compile
[] |  +- io.dropwizard:dropwizard-logging:jar:0.9.3:compile
[] |  |  +- io.dropwizard.metrics:metrics-logback:jar:3.1.2:compile
[] |  |  +- org.slf4j:jul-to-slf4j:jar:1.7.21:compile
[] |  |  +- ch.qos.logback:logback-core:jar:1.1.3:compile
[] |  |  +- org.slf4j:log4j-over-slf4j:jar:1.7.21:compile
[] |  |  +- org.slf4j:jcl-over-slf4j:jar:1.7.21:compile
[] |  |  \- org.eclipse.jetty:jetty-util:jar:9.2.17.v20160517:compile
[] |  +- io.dropwizard:dropwizard-metrics:jar:0.9.3:compile
[] |  +- io.dropwizard:dropwizard-jersey:jar:0.9.3:compile
[] |  |  +- org.glassfish.jersey.core:jersey-server:jar:2.22.1:compile
[] |  |  |  +- javax.ws.rs:javax.ws.rs-api:jar:2.0.1:compile
[] |  |  |  +- org.glassfish.jersey.media:jersey-media-jaxb:jar:2.22.1:compile
[] |  |  |  +- javax.annotation:javax.annotation-api:jar:1.2:compile
[] |  |  |  +- org.glassfish.hk2.external:javax.inject:jar:2.4.0-b31:compile
[] |  |  |  \- org.glassfish.hk2:hk2-locator:jar:2.4.0-b31:compile
[] |  |  |     \- org.javassist:javassist:jar:3.18.1-GA:compile
[] |  |  +- org.glassfish.jersey.ext:jersey-metainf-services:jar:2.22.1:compile
[] |  |  +- org.glassfish.jersey.ext:jersey-bean-validation:jar:2.22.1:compile
[] |  |  +- io.dropwizard.metrics:metrics-jersey2:jar:3.1.2:compile
[] |  |  +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.6.7:compile
[] |  |  |  +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.6.7:compile
[] |  |  |  \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.6.7:compile
[] |  |  +- org.glassfish.jersey.containers:jersey-container-servlet:jar:2.22.1:compile
[] |  |  |  \- org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.22.1:compile
[] |  |  +- org.eclipse.jetty:jetty-server:jar:9.2.17.v20160517:compile
[] |  |  |  +- javax.servlet:javax.servlet-api:jar:3.1.0:compile
[] |  |  |  \- org.eclipse.jetty:jetty-io:jar:9.2.17.v20160517:compile
[] |  |  +- org.eclipse.jetty:jetty-webapp:jar:9.2.17.v20160517:compile
[] |  |  |  \- org.eclipse.jetty:jetty-xml:jar:9.2.17.v20160517:compile
[] |  |  \- org.eclipse.jetty:jetty-continuation:jar:9.2.17.v20160517:compile
[] |  +- io.dropwizard:dropwizard-jetty:jar:0.9.3:compile
[] |  |  +- io.dropwizard.metrics:metrics-jetty9:jar:3.1.2:compile
[] |  |  +- org.eclipse.jetty:jetty-servlet:jar:9.2.17.v20160517:compile
[] |  |  |  \- org.eclipse.jetty:jetty-security:jar:9.2.17.v20160517:compile
[] |  |  +- org.eclipse.jetty:jetty-servlets:jar:9.2.17.v20160517:compile
[] |  |  \- org.eclipse.jetty:jetty-http:jar:9.2.17.v20160517:compile
[] |  +- io.dropwizard:dropwizard-lifecycle:jar:0.9.3:compile
[] |  +- io.dropwizard.metrics:metrics-core:jar:3.1.2:compile
[] |  +- io.dropwizard.metrics:metrics-jvm:jar:3.1.2:compile
[] |  +- io.dropwizard.metrics:metrics-servlets:jar:3.1.2:compile
[] |  |  \- io.dropwizard.metrics:metrics-json:jar:3.1.2:compile
[] |  +- io.dropwizard.metrics:metrics-healthchecks:jar:3.1.2:compile
[] |  +- net.sourceforge.argparse4j:argparse4j:jar:0.6.0:compile
[] |  \- org.eclipse.jetty.toolchain.setuid:jetty-setuid-java:jar:1.0.3:compile
[] +- io.dropwizard:dropwizard-auth:jar:0.9.3:compile
[] +- io.progix.dropwizard:dropwizard-jooq:jar:0.1.2:compile
[] |  +- org.hsqldb:hsqldb:jar:2.3.2:runtime
[] |  +- io.dropwizard:dropwizard-db:jar:0.8.1:compile
[] |  |  \- org.apache.tomcat:tomcat-jdbc:jar:8.0.18:compile
[] |  |     \- org.apache.tomcat:tomcat-juli:jar:8.0.18:compile
[] |  +- org.jooq:jooq-codegen:jar:3.6.1:compile
[] |  \- org.jooq:jooq-meta:jar:3.6.1:compile
[] +- io.dropwizard:dropwizard-forms:jar:0.9.3:compile
[] |  \- org.glassfish.jersey.media:jersey-media-multipart:jar:2.22.1:compile
[] |     +- org.glassfish.jersey.core:jersey-common:jar:2.22.1:compile
[] |     |  +- org.glassfish.jersey.bundles.repackaged:jersey-guava:jar:2.22.1:compile
[] |     |  \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.1:compile
[] |     \- org.jvnet.mimepull:mimepull:jar:1.9.6:compile
[] +- javax.persistence:persistence-api:jar:1.0.2:compile
[] +- io.dropwizard:dropwizard-testing:jar:0.9.3:compile
[] |  +- junit:junit:jar:4.12:compile
[] |  |  \- org.hamcrest:hamcrest-core:jar:1.3:compile
[] |  +- org.mockito:mockito-core:jar:1.10.19:compile
[] |  +- org.objenesis:objenesis:jar:2.2:compile
[] |  +- org.assertj:assertj-core:jar:2.2.0:compile
[] |  \- org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-inmemory:jar:2.22.1:compile
[] |     +- org.glassfish.jersey.test-framework:jersey-test-framework-core:jar:2.22.1:compile
[] |     +- org.glassfish.jersey.core:jersey-client:jar:2.22.1:compile
[] |     \- org.ow2.asm:asm-debug-all:jar:5.0.4:compile
[] +- org.hamcrest:hamcrest-all:jar:1.3:compile
[] +- redis.clients:jedis:jar:2.8.1:compile
[] |  \- org.apache.commons:commons-pool2:jar:2.4.2:compile
[] +- com.google.api-client:google-api-client:jar:1.20.0:compile
[] |  +- com.google.oauth-client:google-oauth-client:jar:1.20.0:compile
[] |  |  \- com.google.http-client:google-http-client:jar:1.20.0:compile
[] |  +- com.google.http-client:google-http-client-jackson2:jar:1.20.0:compile
[] |  \- com.google.guava:guava-jdk5:jar:13.0:compile
[] +- org.mariadb.jdbc:mariadb-java-client:jar:1.3.4:compile
[] +- org.jooq:jooq:jar:3.8.2:compile
[] +- org.quartz-scheduler:quartz:jar:2.2.2:compile
[] |  +- c3p0:c3p0:jar:0.9.1.1:compile
[] |  \- org.slf4j:slf4j-api:jar:1.7.7:compile
[] +- org.quartz-scheduler:quartz-jobs:jar:2.2.2:compile
[] +- com.google.guava:guava:jar:18.0:compile
[] +- de.thomaskrille:dropwizard-template-config:jar:1.1.0:compile
[] +- io.dropwizard:dropwizard-metrics-graphite:jar:0.9.3:compile
[] |  \- io.dropwizard.metrics:metrics-graphite:jar:3.1.2:compile
[] +- com.jamierf.dropwizard:dropwizard-logging-loggly:jar:0.7:compile
[] |  +- ch.qos.logback.contrib:logback-json-classic:jar:0.1.2:compile
[] |  |  \- ch.qos.logback.contrib:logback-json-core:jar:0.1.2:compile
[] |  +- ch.qos.logback.contrib:logback-jackson:jar:0.1.2:compile
[] |  \- org.logback-extensions:logback-ext-loggly:jar:0.1.2:compile
[] +- joda-time:joda-time:jar:2.8.1:compile
[] +- org.apache.poi:poi:jar:3.10-AL:compile
[] |  \- commons-codec:commons-codec:jar:1.5:compile
[] +- org.apache.poi:poi-ooxml:jar:3.10-AL:compile
[] |  +- org.apache.poi:poi-ooxml-schemas:jar:3.10-AL:compile
[] |  |  \- org.apache.xmlbeans:xmlbeans:jar:2.3.0:compile
[] |  |     \- stax:stax-api:jar:1.0.1:compile
[] |  \- dom4j:dom4j:jar:1.6.1:compile
[] |     \- xml-apis:xml-apis:jar:1.0.b2:compile
[] +- com.amazonaws:aws-java-sdk-ses:jar:1.10.76:compile
[] |  \- com.amazonaws:aws-java-sdk-core:jar:1.10.76:compile
[] |     \- commons-logging:commons-logging:jar:1.1.3:compile
[] +- com.amazonaws:aws-java-sdk-s3:jar:1.10.76:compile
[] |  \- com.amazonaws:aws-java-sdk-kms:jar:1.10.76:compile
[] +- ru.vyarus:dropwizard-guicey:jar:3.2.0:compile
[] |  +- com.google.inject.extensions:guice-servlet:jar:4.0:compile
[] |  +- org.glassfish.hk2:guice-bridge:jar:2.4.0-b31:compile
[] |  |  +- javax.inject:javax.inject:jar:1:compile
[] |  |  \- org.glassfish.hk2:hk2-api:jar:2.4.0-b31:compile
[] |  |     +- org.glassfish.hk2:hk2-utils:jar:2.4.0-b31:compile
[] |  |     \- org.glassfish.hk2.external:aopalliance-repackaged:jar:2.4.0-b31:compile
[] |  \- ru.vyarus:generics-resolver:jar:2.0.1:compile
[] +- com.google.inject.extensions:guice-multibindings:jar:4.0:compile
[] |  \- com.google.inject:guice:jar:4.0:compile
[] |     \- aopalliance:aopalliance:jar:1.0:compile
[] +- com.amazonaws:aws-java-sdk-elasticsearch:jar:1.10.76:compile
[] +- commons-io:commons-io:jar:1.3.2:compile
[] +- io.searchbox:jest:jar:2.0.2:compile
[] |  +- io.searchbox:jest-common:jar:2.0.2:compile
[] |  |  \- com.google.code.gson:gson:jar:2.6.2:compile
[] |  +- org.apache.httpcomponents:httpcore-nio:jar:4.4.4:compile
[] |  |  \- org.apache.httpcomponents:httpcore:jar:4.4.4:compile
[] |  +- org.apache.httpcomponents:httpclient:jar:4.5.2:compile
[] |  \- org.apache.httpcomponents:httpasyncclient:jar:4.1.1:compile
[] +- org.elasticsearch:elasticsearch:jar:2.3.2:compile
[] |  +- org.apache.lucene:lucene-core:jar:5.5.0:compile
[] |  +- org.apache.lucene:lucene-backward-codecs:jar:5.5.0:compile
[] |  +- org.apache.lucene:lucene-analyzers-common:jar:5.5.0:compile
[] |  +- org.apache.lucene:lucene-queries:jar:5.5.0:compile
[] |  +- org.apache.lucene:lucene-memory:jar:5.5.0:compile
[] |  +- org.apache.lucene:lucene-highlighter:jar:5.5.0:compile
[] |  +- org.apache.lucene:lucene-queryparser:jar:5.5.0:compile
[] |  |  \- org.apache.lucene:lucene-sandbox:jar:5.5.0:compile
[] |  +- org.apache.lucene:lucene-suggest:jar:5.5.0:compile
[] |  |  \- org.apache.lucene:lucene-misc:jar:5.5.0:compile
[] |  +- org.apache.lucene:lucene-join:jar:5.5.0:compile
[] |  |  \- org.apache.lucene:lucene-grouping:jar:5.5.0:compile
[] |  +- org.apache.lucene:lucene-spatial:jar:5.5.0:compile
[] |  |  +- org.apache.lucene:lucene-spatial3d:jar:5.5.0:compile
[] |  |  \- com.spatial4j:spatial4j:jar:0.5:compile
[] |  +- org.elasticsearch:securesm:jar:1.0:compile
[] |  +- com.carrotsearch:hppc:jar:0.7.1:compile
[] |  +- org.joda:joda-convert:jar:1.2:compile
[] |  +- com.fasterxml.jackson.core:jackson-core:jar:2.6.2:compile
[] |  +- com.fasterxml.jackson.dataformat:jackson-dataformat-smile:jar:2.6.2:compile
[] |  +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.6.2:compile
[] |  |  \- org.yaml:snakeyaml:jar:1.15:compile
[] |  +- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar:2.6.2:compile
[] |  +- io.netty:netty:jar:3.10.5.inal:compile
[] |  +- com.ning:compress-lzf:jar:1.0.2:compile
[] |  +- com.tdunning:t-digest:jar:3.0:compile
[] |  +- org.hdrhistogram:HdrHistogram:jar:2.1.6:compile
[] |  +- commons-cli:commons-cli:jar:1.3.1:compile
[] |  \- com.twitter:jsr166e:jar:1.1.0:compile
[] +- org.springframework:spring-context:jar:4.2.6.RELEASE:compile
[] |  +- org.springframework:spring-aop:jar:4.2.6.RELEASE:compile
[] |  +- org.springframework:spring-beans:jar:4.2.6.RELEASE:compile
[] |  +- org.springframework:spring-core:jar:4.2.6.RELEASE:compile
[] |  \- org.springframework:spring-expression:jar:4.2.6.RELEASE:compile
[] +- org.springframework:spring-jdbc:jar:4.2.6.RELEASE:compile
[] |  \- org.springframework:spring-tx:jar:4.2.6.RELEASE:compile
[] +- com.zaxxer:HikariCP:jar:2.4.5:compile
[] +- co.paralleluniverse:quasar-core:jar:jdk8:0.7.2:compile
[] |  +- org.latencyutils:LatencyUtils:jar:2.0.2:compile
[] |  +- com.lmax:disruptor:jar:3.3.2:compile
[] |  +- de.javakaffee:kryo-serializers:jar:0.30:compile
[] |  |  \- com.google.protobuf:protobuf-java:jar:2.6.1:compile
[] |  \- com.esotericsoftware.kryo:kryo:jar:2.24.0:compile
[] |     \- com.esotericsoftware.minlog:minlog:jar:1.2:compile
[] \- co.paralleluniverse:comsat-jooq:jar:0.7.0:compile
[]    \- co.paralleluniverse:comsat-jdbc:jar:0.7.0:compile
xvik commented 8 years ago

Please try one more time with guice logs enabled:

logging:
  level: INFO

  loggers:
    com.google.inject.internal.util: DEBUG

You should see something like this:

DEBUG [2016-08-03 21:09:45,963] com.google.inject.internal.util.Stopwatch: Module execution: 272ms
DEBUG [2016-08-03 21:09:45,963] com.google.inject.internal.util.Stopwatch: Interceptors creation: 1ms
DEBUG [2016-08-03 21:09:45,965] com.google.inject.internal.util.Stopwatch: TypeListeners & ProvisionListener creation: 2ms
DEBUG [2016-08-03 21:09:45,966] com.google.inject.internal.util.Stopwatch: Scopes creation: 1ms
DEBUG [2016-08-03 21:09:45,966] com.google.inject.internal.util.Stopwatch: Converters creation: 0ms
DEBUG [2016-08-03 21:09:45,992] com.google.inject.internal.util.Stopwatch: Binding creation: 26ms
DEBUG [2016-08-03 21:09:45,992] com.google.inject.internal.util.Stopwatch: Module annotated method scanners creation: 0ms
DEBUG [2016-08-03 21:09:45,993] com.google.inject.internal.util.Stopwatch: Private environment creation: 1ms
DEBUG [2016-08-03 21:09:45,993] com.google.inject.internal.util.Stopwatch: Injector construction: 0ms
DEBUG [2016-08-03 21:09:46,170] com.google.inject.internal.util.Stopwatch: Binding initialization: 177ms
DEBUG [2016-08-03 21:09:46,171] com.google.inject.internal.util.Stopwatch: Binding indexing: 1ms
DEBUG [2016-08-03 21:09:46,172] com.google.inject.internal.util.Stopwatch: Collecting injection requests: 1ms
DEBUG [2016-08-03 21:09:46,179] com.google.inject.internal.util.Stopwatch: Binding validation: 7ms
DEBUG [2016-08-03 21:09:46,183] com.google.inject.internal.util.Stopwatch: Static validation: 4ms
DEBUG [2016-08-03 21:09:46,191] com.google.inject.internal.util.Stopwatch: Instance member validation: 8ms
DEBUG [2016-08-03 21:09:46,192] com.google.inject.internal.util.Stopwatch: Provider verification: 1ms
DEBUG [2016-08-03 21:09:46,201] com.google.inject.internal.util.Stopwatch: Static member injection: 9ms
DEBUG [2016-08-03 21:09:46,204] com.google.inject.internal.util.Stopwatch: Instance injection: 3ms
DEBUG [2016-08-03 21:09:46,427] com.google.inject.internal.util.Stopwatch: Preloading singletons: 223ms
sheldon-sminq commented 8 years ago
DEBUG [2016-08-03 23:09:40,176] com.google.inject.internal.util.Stopwatch: Module execution: 311ms
DEBUG [2016-08-03 23:09:40,177] com.google.inject.internal.util.Stopwatch: Interceptors creation: 2ms
DEBUG [2016-08-03 23:09:40,179] com.google.inject.internal.util.Stopwatch: TypeListeners & ProvisionListener creation: 2ms
DEBUG [2016-08-03 23:09:40,181] com.google.inject.internal.util.Stopwatch: Scopes creation: 2ms
DEBUG [2016-08-03 23:09:40,181] com.google.inject.internal.util.Stopwatch: Converters creation: 0ms
DEBUG [2016-08-03 23:09:40,214] com.google.inject.internal.util.Stopwatch: Binding creation: 33ms
DEBUG [2016-08-03 23:09:40,214] com.google.inject.internal.util.Stopwatch: Module annotated method scanners creation: 0ms
DEBUG [2016-08-03 23:09:40,215] com.google.inject.internal.util.Stopwatch: Private environment creation: 1ms
DEBUG [2016-08-03 23:09:40,215] com.google.inject.internal.util.Stopwatch: Injector construction: 0ms
DEBUG [2016-08-03 23:09:40,740] com.google.inject.internal.util.Stopwatch: Binding initialization: 524ms
DEBUG [2016-08-03 23:09:40,740] com.google.inject.internal.util.Stopwatch: Binding indexing: 1ms
DEBUG [2016-08-03 23:09:40,741] com.google.inject.internal.util.Stopwatch: Collecting injection requests: 1ms
DEBUG [2016-08-03 23:09:40,908] com.google.inject.internal.util.Stopwatch: Binding validation: 167ms
DEBUG [2016-08-03 23:09:40,912] com.google.inject.internal.util.Stopwatch: Static validation: 4ms
DEBUG [2016-08-03 23:09:40,918] com.google.inject.internal.util.Stopwatch: Instance member validation: 6ms
DEBUG [2016-08-03 23:09:40,920] com.google.inject.internal.util.Stopwatch: Provider verification: 2ms
DEBUG [2016-08-03 23:09:40,929] com.google.inject.internal.util.Stopwatch: Static member injection: 9ms
DEBUG [2016-08-03 23:09:40,949] com.google.inject.internal.util.Stopwatch: Instance injection: 20ms
xvik commented 8 years ago

Please look there is last line later in logs (below guicey reportings):

DEBUG [2016-08-03 21:09:46,427] com.google.inject.internal.util.Stopwatch: Preloading singletons: 223ms
sheldon-sminq commented 8 years ago

ooh this seems to be the issue!

com.google.inject.internal.util.Stopwatch: Preloading singletons: 137605ms

sheldon-sminq commented 8 years ago

Think i found the issue, its related to the quartz scheduler

INFO  [2016-08-03 23:37:58,234] org.quartz.core.QuartzScheduler: JobFactory set to: com.sminq.api.jobs.QuartzJobFactory@4733f6f5
INFO  [2016-08-03 23:37:58,237] org.quartz.core.QuartzScheduler: Scheduler SminqApiJobScheduler_$_Sheldons-MacBook-Pro.local1470247677732 started.
INFO  [2016-08-03 23:37:58,426] org.quartz.core.QuartzScheduler: JobFactory set to: com.sminq.api.jobs.QuartzJobFactory@7bdf61ad
INFO  [2016-08-03 23:37:58,430] org.quartz.core.QuartzScheduler: Scheduler SminqApiJobScheduler_$_Sheldons-MacBook-Pro.local1470247677732 started.
INFO  [2016-08-03 23:37:58,603] org.quartz.core.QuartzScheduler: JobFactory set to: com.sminq.api.jobs.QuartzJobFactory@63f6bed1
INFO  [2016-08-03 23:37:58,603] org.quartz.core.QuartzScheduler: Scheduler SminqApiJobScheduler_$_Sheldons-MacBook-Pro.local1470247677732 started.
INFO  [2016-08-03 23:37:59,779] org.quartz.core.QuartzScheduler: JobFactory set to: com.sminq.api.jobs.QuartzJobFactory@75aea2ba
INFO  [2016-08-03 23:37:59,779] org.quartz.core.QuartzScheduler: Scheduler SminqApiJobScheduler_$_Sheldons-MacBook-Pro.local1470247677732 started.
INFO  [2016-08-03 23:38:01,025] org.quartz.core.QuartzScheduler: JobFactory set to: com.sminq.api.jobs.QuartzJobFactory@3d53e6f7
INFO  [2016-08-03 23:38:01,025] org.quartz.core.QuartzScheduler: Scheduler SminqApiJobScheduler_$_Sheldons-MacBook-Pro.local1470247677732 started.
INFO  [2016-08-03 23:38:07,790] org.quartz.core.QuartzScheduler: JobFactory set to: com.sminq.api.jobs.QuartzJobFactory@d653e41
INFO  [2016-08-03 23:38:07,790] org.quartz.core.QuartzScheduler: Scheduler SminqApiJobScheduler_$_Sheldons-MacBook-Pro.local1470247677732 started.
INFO  [2016-08-03 23:38:11,112] org.quartz.core.QuartzScheduler: JobFactory set to: com.sminq.api.jobs.QuartzJobFactory@632383b9
INFO  [2016-08-03 23:38:11,113] org.quartz.core.QuartzScheduler: Scheduler SminqApiJobScheduler_$_Sheldons-MacBook-Pro.local1470247677732 started.
INFO  [2016-08-03 23:38:15,112] org.quartz.core.QuartzScheduler: JobFactory set to: com.sminq.api.jobs.QuartzJobFactory@66f5b8fe
INFO  [2016-08-03 23:38:15,112] org.quartz.core.QuartzScheduler: Scheduler SminqApiJobScheduler_$_Sheldons-MacBook-Pro.local1470247677732 started.
INFO  [2016-08-03 23:38:18,491] org.quartz.core.QuartzScheduler: JobFactory set to: com.sminq.api.jobs.QuartzJobFactory@6a567f7b
INFO  [2016-08-03 23:38:18,491] org.quartz.core.QuartzScheduler: Scheduler SminqApiJobScheduler_$_Sheldons-MacBook-Pro.local1470247677732 started.
INFO  [2016-08-03 23:38:27,102] org.quartz.core.QuartzScheduler: JobFactory set to: com.sminq.api.jobs.QuartzJobFactory@147cc940
INFO  [2016-08-03 23:38:27,102] org.quartz.core.QuartzScheduler: Scheduler SminqApiJobScheduler_$_Sheldons-MacBook-Pro.local1470247677732 started.
xvik commented 8 years ago

But why it wasn't started before?
(we can continue in chat if you want)

sheldon-sminq commented 8 years ago

I have attached the code for the Quartz scheduler for your reference.

@Singleton
public class QuartzSchedulerProvider implements Provider<Scheduler> {
    private Scheduler scheduler;

    @Inject
    public QuartzSchedulerProvider(QuartzJobFactory jobFactory, CustomJobListener customJobListener) throws SchedulerException {
        scheduler = new StdSchedulerFactory(loadConfiguration()).getScheduler();
        scheduler.setJobFactory(jobFactory);
        scheduler.getListenerManager().addTriggerListener(customJobListener);
        scheduler.start();
    }

    @Override
    public Scheduler get() {
        return scheduler;
    }
}

I load the same class in my module

 bind(JobFactory.class).to(QuartzJobFactory.class);
 bind(Scheduler.class).toProvider(QuartzSchedulerProvider.class);
xvik commented 8 years ago

I assume you've added @Singleton just now, because without it multiple providers will be instantiated and so logs (the same as above) would appear.

Now philosophy: this class is wrong from guice point of view

Dropwizard provides you wonderful Managed object - use it to start and stop all your services (especially such heavy services).

@Singleton
public class QuartzSchedulerProvider implements Provider<Scheduler>, Managed {
    private Scheduler scheduler;

    @Inject
    public QuartzSchedulerProvider(QuartzJobFactory jobFactory, CustomJobListener customJobListener) throws SchedulerException {
        // configure instance without starting it
        scheduler = new StdSchedulerFactory(loadConfiguration()).getScheduler();
        scheduler.setJobFactory(jobFactory);
        scheduler.getListenerManager().addTriggerListener(customJobListener);
    }

   public void start() {
       scheduler.start();
   }

   public void stop() {
       scheduler.stop();
   }

    @Override
    public Scheduler get() {
        return scheduler;
    }
}
xvik commented 8 years ago

Closing as not related to guicey (and probably answered)