Could not resolve type id 'http'

2,159 views
Skip to first unread message

Chris Carter

unread,
Feb 4, 2014, 12:51:56 PM2/4/14
to dropwiz...@googlegroups.com
I've just created a new 0.7 project (working on upgrading our other services, but wanted to test flight the new version), and I'm getting a really strange error:

* Failed to parse configuration at: server.connector; Could not resolve type id 'http' into a subtype of [simple type, class io.dropwizard.jetty.ConnectorFactory]
 at [Source: N/A; line: -1, column: -1] (through reference chain: com.oe.dbsvc.DbSvcConfiguration["server"]->io.dropwizard.server.SimpleServerFactory["connector"])

The content of our config yaml looks like this:

server:
  type: simple
  connector:
    type: http
    port: 8001
database:
  driverClass: org.postgresql.Driver
  user: blah
  password: blah
  url: jdbc:postgresql://localhost/blah
  properties:
    charSet: UTF-8
    validationQuery: "/* MyService Health Check */ SELECT 1"
    minSize: 8
    maxSize: 32
    # whether or not idle connections should be validated
    checkConnectionWhileIdle: false
    # how long a connection must be held before it can be validated
    checkConnectionHealthWhenIdleFor: 10s
    # the maximum lifetime of an idle connection
    closeConnectionIfIdleFor: 1 minute


I've also tried it with the more specific "applicationConnectors" approach (which we'll need for our actual applications):

server:
  applicationConnectors:
    - type: http
      port: 8001
  adminConnectors:
    - type: http
      port: 8002

Same error message.  Do I need to register something else somewhere to get this working?

Thanks to anyone who can give us a pointer!

Chris


Matt Veitas

unread,
Feb 4, 2014, 1:05:13 PM2/4/14
to dropwizard-user
Chris,

I was just able to run using the configuration you provided without any issues against 0.7.0-rc1. Can you provide any other information?

-Matt


--
You received this message because you are subscribed to the Google Groups "dropwizard-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dropwizard-us...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Chris Carter

unread,
Feb 4, 2014, 2:48:24 PM2/4/14
to dropwiz...@googlegroups.com, mve...@gmail.com
The oddity appears to be in the build process, which I should have mentioned in my previous post - we're using Gradle and the Gradle shadow plugin to build the fat jar (which is working for us on 0.6.2 of Dropwizard). There's literally just an Application class and a Configuration class in the project, but for whatever reason the fat jar doesn't work.  However, it DOES run fine under IntelliJ, so signs point to Gradle or Gradle shadow.  I'm debugging it now and will report what I find out.

Corum, Michael

unread,
Feb 4, 2014, 2:49:57 PM2/4/14
to dropwiz...@googlegroups.com, mve...@gmail.com

What version of Gradle?  Also, are you using Groovy and Java 7?  All these versions interact for 0.6.2 and I suspect will just as much for 0.7.

 

Mike

 

From: dropwiz...@googlegroups.com [mailto:dropwiz...@googlegroups.com] On Behalf Of Chris Carter
Sent: Tuesday, February 04, 2014 1:48 PM
To: dropwiz...@googlegroups.com
Cc: mve...@gmail.com
Subject: Re: Could not resolve type id 'http'

 

The oddity appears to be in the build process, which I should have mentioned in my previous post - we're using Gradle and the Gradle shadow plugin to build the fat jar (which is working for us on 0.6.2 of Dropwizard). There's literally just an Application class and a Configuration class in the project, but for whatever reason the fat jar doesn't work.  However, it DOES run fine under IntelliJ, so signs point to Gradle or Gradle shadow.  I'm debugging it now and will report what I find out.

On Tuesday, February 4, 2014 10:05:13 AM UTC-8, Matt Veitas wrote:

Chris,

 

I was just able to run using the configuration you provided without any issues against 0.7.0-rc1. Can you provide any other information?

 

-Matt

 

On Tue, Feb 4, 2014 at 12:51 PM, Chris Carter <ch...@carterventures.com> wrote:

Chris Carter

unread,
Feb 4, 2014, 3:04:38 PM2/4/14
to dropwiz...@googlegroups.com, mve...@gmail.com
We're using Gradle 1.10, Java 7u45 (on Mac OSX), but no Groovy in the app. Below is the list of compilation dependencies according to Gradle:

+--- io.dropwizard:dropwizard-core:0.7.0-rc1
|    +--- io.dropwizard:dropwizard-util:0.7.0-rc1
|    |    +--- com.fasterxml.jackson.core:jackson-annotations:2.3.0
|    |    +--- com.google.guava:guava:15.0
|    |    +--- com.google.code.findbugs:jsr305:2.0.2
|    |    \--- joda-time:joda-time:2.3
|    +--- io.dropwizard:dropwizard-jackson:0.7.0-rc1
|    |    +--- com.google.guava:guava:15.0
|    |    +--- io.dropwizard:dropwizard-util:0.7.0-rc1 (*)
|    |    +--- com.fasterxml.jackson.core:jackson-core:2.3.0
|    |    +--- com.fasterxml.jackson.core:jackson-databind:2.3.0
|    |    |    +--- com.fasterxml.jackson.core:jackson-annotations:2.3.0
|    |    |    \--- com.fasterxml.jackson.core:jackson-core:2.3.0
|    |    +--- com.fasterxml.jackson.datatype:jackson-datatype-guava:2.3.0
|    |    +--- com.fasterxml.jackson.module:jackson-module-afterburner:2.3.0
|    |    +--- com.fasterxml.jackson.datatype:jackson-datatype-joda:2.3.0
|    |    \--- ch.qos.logback:logback-classic:1.0.13
|    |         +--- ch.qos.logback:logback-core:1.0.13
|    |         \--- org.slf4j:slf4j-api:1.7.5
|    +--- io.dropwizard:dropwizard-validation:0.7.0-rc1
|    |    +--- io.dropwizard:dropwizard-util:0.7.0-rc1 (*)
|    |    +--- org.hibernate:hibernate-validator:5.0.2.Final
|    |    |    +--- javax.validation:validation-api:1.1.0.Final
|    |    |    +--- org.jboss.logging:jboss-logging:3.1.1.GA
|    |    |    \--- com.fasterxml:classmate:1.0.0
|    |    \--- org.glassfish.web:javax.el:2.2.6
|    |         \--- javax.el:javax.el-api:2.2.5
|    +--- io.dropwizard:dropwizard-configuration:0.7.0-rc1
|    |    +--- io.dropwizard:dropwizard-jackson:0.7.0-rc1 (*)
|    |    +--- io.dropwizard:dropwizard-validation:0.7.0-rc1 (*)
|    |    +--- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.3.0
|    |    |    \--- com.fasterxml.jackson.core:jackson-core:2.3.0
|    |    \--- commons-lang:commons-lang:2.6
|    +--- io.dropwizard:dropwizard-logging:0.7.0-rc1
|    |    +--- io.dropwizard:dropwizard-jackson:0.7.0-rc1 (*)
|    |    +--- io.dropwizard:dropwizard-validation:0.7.0-rc1 (*)
|    |    +--- com.codahale.metrics:metrics-logback:3.0.1
|    |    |    +--- com.codahale.metrics:metrics-core:3.0.1
|    |    |    |    \--- org.slf4j:slf4j-api:1.7.5
|    |    |    +--- ch.qos.logback:logback-classic:1.0.13 (*)
|    |    |    \--- org.slf4j:slf4j-api:1.7.5
|    |    +--- org.slf4j:slf4j-api:1.7.5
|    |    +--- org.slf4j:jul-to-slf4j:1.7.5
|    |    |    \--- org.slf4j:slf4j-api:1.7.5
|    |    +--- ch.qos.logback:logback-core:1.0.13
|    |    +--- ch.qos.logback:logback-classic:1.0.13 (*)
|    |    +--- org.slf4j:log4j-over-slf4j:1.7.5
|    |    |    \--- org.slf4j:slf4j-api:1.7.5
|    |    \--- org.eclipse.jetty:jetty-util:9.0.7.v20131107
|    +--- io.dropwizard:dropwizard-metrics:0.7.0-rc1
|    |    +--- io.dropwizard:dropwizard-lifecycle:0.7.0-rc1
|    |    |    +--- org.slf4j:slf4j-api:1.7.5
|    |    |    +--- com.google.guava:guava:15.0
|    |    |    +--- org.eclipse.jetty:jetty-server:9.0.7.v20131107
|    |    |    |    +--- org.eclipse.jetty.orbit:javax.servlet:3.0.0.v201112011016
|    |    |    |    +--- org.eclipse.jetty:jetty-http:9.0.7.v20131107
|    |    |    |    |    \--- org.eclipse.jetty:jetty-util:9.0.7.v20131107
|    |    |    |    \--- org.eclipse.jetty:jetty-io:9.0.7.v20131107
|    |    |    |         \--- org.eclipse.jetty:jetty-util:9.0.7.v20131107
|    |    |    \--- io.dropwizard:dropwizard-util:0.7.0-rc1 (*)
|    |    +--- io.dropwizard:dropwizard-jackson:0.7.0-rc1 (*)
|    |    +--- io.dropwizard:dropwizard-validation:0.7.0-rc1 (*)
|    |    +--- com.codahale.metrics:metrics-core:3.0.1 (*)
|    |    \--- org.slf4j:slf4j-api:1.7.5
|    +--- io.dropwizard:dropwizard-jersey:0.7.0-rc1
|    |    +--- io.dropwizard:dropwizard-jackson:0.7.0-rc1 (*)
|    |    +--- io.dropwizard:dropwizard-validation:0.7.0-rc1 (*)
|    |    +--- io.dropwizard:dropwizard-logging:0.7.0-rc1 (*)
|    |    +--- org.eclipse.jetty.orbit:javax.servlet:3.0.0.v201112011016
|    |    +--- com.sun.jersey:jersey-core:1.18
|    |    +--- com.sun.jersey:jersey-server:1.18
|    |    |    \--- asm:asm:3.1
|    |    +--- com.sun.jersey:jersey-servlet:1.18
|    |    +--- com.codahale.metrics:metrics-jersey:3.0.1
|    |    |    +--- com.codahale.metrics:metrics-core:3.0.1 (*)
|    |    |    +--- com.codahale.metrics:metrics-annotation:3.0.1
|    |    |    |    \--- org.slf4j:slf4j-api:1.7.5
|    |    |    \--- org.slf4j:slf4j-api:1.7.5
|    |    \--- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.3.0
|    |         +--- com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:2.3.0
|    |         \--- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.3.0
|    +--- io.dropwizard:dropwizard-servlets:0.7.0-rc1
|    |    +--- org.slf4j:slf4j-api:1.7.5
|    |    +--- io.dropwizard:dropwizard-util:0.7.0-rc1 (*)
|    |    \--- org.eclipse.jetty.orbit:javax.servlet:3.0.0.v201112011016
|    +--- io.dropwizard:dropwizard-jetty:0.7.0-rc1
|    |    +--- io.dropwizard:dropwizard-logging:0.7.0-rc1 (*)
|    |    +--- com.codahale.metrics:metrics-jetty9:3.0.1
|    |    |    +--- com.codahale.metrics:metrics-core:3.0.1 (*)
|    |    |    \--- org.slf4j:slf4j-api:1.7.5
|    |    +--- org.eclipse.jetty:jetty-server:9.0.7.v20131107 (*)
|    |    +--- org.eclipse.jetty:jetty-servlet:9.0.7.v20131107
|    |    |    \--- org.eclipse.jetty:jetty-security:9.0.7.v20131107
|    |    |         \--- org.eclipse.jetty:jetty-server:9.0.7.v20131107 (*)
|    |    +--- org.eclipse.jetty:jetty-servlets:9.0.7.v20131107
|    |    |    +--- org.eclipse.jetty:jetty-continuation:9.0.7.v20131107
|    |    |    +--- org.eclipse.jetty:jetty-http:9.0.7.v20131107 (*)
|    |    |    +--- org.eclipse.jetty:jetty-util:9.0.7.v20131107
|    |    |    \--- org.eclipse.jetty:jetty-io:9.0.7.v20131107 (*)
|    |    \--- org.eclipse.jetty:jetty-http:9.0.7.v20131107 (*)
|    +--- io.dropwizard:dropwizard-lifecycle:0.7.0-rc1 (*)
|    +--- com.codahale.metrics:metrics-core:3.0.1 (*)
|    +--- com.codahale.metrics:metrics-jvm:3.0.1
|    |    +--- com.codahale.metrics:metrics-core:3.0.1 (*)
|    |    \--- org.slf4j:slf4j-api:1.7.5
|    +--- com.codahale.metrics:metrics-servlets:3.0.1
|    |    +--- com.codahale.metrics:metrics-core:3.0.1 (*)
|    |    +--- com.codahale.metrics:metrics-healthchecks:3.0.1
|    |    |    \--- org.slf4j:slf4j-api:1.7.5
|    |    +--- com.codahale.metrics:metrics-json:3.0.1
|    |    |    +--- com.codahale.metrics:metrics-core:3.0.1 (*)
|    |    |    \--- org.slf4j:slf4j-api:1.7.5
|    |    +--- com.codahale.metrics:metrics-jvm:3.0.1 (*)
|    |    \--- org.slf4j:slf4j-api:1.7.5
|    +--- com.codahale.metrics:metrics-healthchecks:3.0.1 (*)
|    +--- net.sourceforge.argparse4j:argparse4j:0.4.2
|    +--- org.eclipse.jetty.orbit:javax.servlet:3.0.0.v201112011016
|    \--- org.eclipse.jetty.toolchain.setuid:jetty-setuid-java:1.0.2
+--- io.dropwizard:dropwizard-jdbi:0.7.0-rc1
|    +--- io.dropwizard:dropwizard-db:0.7.0-rc1
|    |    +--- io.dropwizard:dropwizard-core:0.7.0-rc1 (*)
|    |    \--- org.apache.tomcat:tomcat-jdbc:7.0.47
|    |         \--- org.apache.tomcat:tomcat-juli:7.0.47
|    +--- org.jdbi:jdbi:2.53
|    |    \--- com.google.code.findbugs:annotations:2.0.2
|    \--- com.codahale.metrics:metrics-jdbi:3.0.1
|         +--- com.codahale.metrics:metrics-core:3.0.1 (*)
|         \--- org.slf4j:slf4j-api:1.7.5
+--- io.dropwizard:dropwizard-migrations:0.7.0-rc1
|    +--- io.dropwizard:dropwizard-db:0.7.0-rc1 (*)
|    +--- org.liquibase:liquibase-core:3.0.8
|    |    \--- org.yaml:snakeyaml:1.13
|    \--- com.mattbertolini:liquibase-slf4j:1.2.1
\--- io.dropwizard:dropwizard-metrics-graphite:0.7.0-rc1
     +--- io.dropwizard:dropwizard-metrics:0.7.0-rc1 (*)
     \--- com.codahale.metrics:metrics-graphite:3.0.1
          +--- com.codahale.metrics:metrics-core:3.0.1 (*)
          \--- org.slf4j:slf4j-api:1.7.5

Chris Carter

unread,
Feb 4, 2014, 3:53:36 PM2/4/14
to dropwiz...@googlegroups.com, mve...@gmail.com
With some help from Matt Veitas, I was able to get it working.  It was indeed the Gradle Shadow process, our build script was missing the ServiceFileTransformer - not sure why we didn't need this before with 0.6.2, but it's definitely needed now.  After that went in there, everything ran as expected.

Thanks for the help, guys!

Chris

gwpo...@gmail.com

unread,
Feb 4, 2014, 7:09:56 PM2/4/14
to dropwiz...@googlegroups.com, mve...@gmail.com
That sounds very familiar. Can you elaborate on the solution? I'm having similar errors parsing the .yml file as well.

gwpo...@gmail.com

unread,
Feb 4, 2014, 7:14:42 PM2/4/14
to dropwiz...@googlegroups.com, mve...@gmail.com
I'm using Maven to build a fat jar. ( but I'm having issues with the parsing of the default .yml file, where it appears to look for http )

Matt Veitas

unread,
Feb 4, 2014, 7:35:02 PM2/4/14
to gwpo...@gmail.com, dropwizard-user
Can you include the snippet from your Maven that builds the fat jar?

This is the snippet I have included in my Gradle file. This is based upon the Gradle Shadow plugin: https://github.com/johnrengelman/shadow

import com.github.jengelman.gradle.plugins.shadow.transformers.AppendingTransformer
import com.github.jengelman.gradle.plugins.shadow.transformers.AppendingTransformer
import com.github.jengelman.gradle.plugins.shadow.transformers.ManifestResourceTransformer
import com.github.jengelman.gradle.plugins.shadow.transformers.ServiceFileTransformer
shadow {
    baseName 'myapp-bundle'
    artifactAttached false
    destinationDir "${project.buildDir}/distributions"

    transformer(ServiceFileTransformer)
    transformer(ManifestResourceTransformer) {
        attributes 'Main-Class': 'com.mycompany.MyAppServer'
        attributes 'Test-Entry': 'PASSED'
    }
    transformer(AppendingTransformer) {
        resource = 'META-INF/spring.handlers'
    }
    transformer(AppendingTransformer) {
        resource = 'META-INF/spring.schemas'
    }
    exclude 'META-INF/*.DSA'
    exclude 'META-INF/*.RSA'
}

gwpo...@gmail.com

unread,
Feb 4, 2014, 7:50:37 PM2/4/14
to dropwiz...@googlegroups.com, gwpo...@gmail.com, mve...@gmail.com
           <plugin>$
               <groupId>org.apache.maven.plugins</groupId>$
               <artifactId>maven-shade-plugin</artifactId>$
               <version>2.2</version>$
               <configuration>$
                   <createDependencyReducedPom>true</createDependencyReducedPom>$
                   <filters>$
                       <filter>$
                           <artifact>*:*</artifact>$
                           <excludes>$
                               <exclude>META-INF/*.SF</exclude>$
                               <exclude>META-INF/*.DSA</exclude>$
                               <exclude>META-INF/*.RSA</exclude>$
                           </excludes>$
                       </filter>$
                   </filters>$
               </configuration>$
               <executions>$
                   <execution>$
                       <phase>package</phase>$
                       <goals>$
                           <goal>shade</goal>$
                       </goals>$
                       <configuration>$
                           <transformers>$
                               <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>$
                               <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">$
                                   <mainClass>com.archeo.MyService.service.MyService</mainClass>$
                               </transformer>$
                           </transformers>$
                       </configuration>$
                   </execution>$
               </executions>$
           </plugin>$

Nick Telford

unread,
Feb 5, 2014, 4:45:27 AM2/5/14
to dropwiz...@googlegroups.com, gwpo...@gmail.com, mve...@gmail.com
Aside from the $ signs (which I assume are EOL markers?) that looks right.

The reason the ServiceResourceTransformer (or equivalent) wasn't necessary before was that 0.6 didn't use them. 0.7 uses services for discovering polymorphic configuration blocks. This allows you to add your own sub-types that the configuration parser will detect, without having to change any of configuration classes.
Reply all
Reply to author
Forward
0 new messages