IncompatibleClassChangeError:实现类

时间:2015-08-05 21:53:30

标签: java jetty cloudera dropwizard hibernate-validator

希望有人能够发现原因:

2015-08-05 22:41:41 INFO  Version:27 - HV000001: Hibernate Validator 5.1.3.Final
Exception in thread "main" java.lang.IncompatibleClassChangeError: Implementing class
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at io.dropwizard.Configuration.<init>(Configuration.java:63)
    at com.mycompany.myproject.services.dropwizard.MyProjectConfiguration.<init>(MyProjectConfiguration.java:5)
    at com.mycompany.myproject.services.dropwizard.MyProjectConfiguration$Creator4JacksonDeserializer.createUsingDefault(com.mycompany.myproject.services.dropwizard.MyProjectConfiguration$Creator4JacksonDeserializer.java)
    at com.fasterxml.jackson.module.afterburner.deser.SuperSonicBeanDeserializer.deserializeFromObject(SuperSonicBeanDeserializer.java:198)
    at com.fasterxml.jackson.module.afterburner.deser.SuperSonicBeanDeserializer.deserialize(SuperSonicBeanDeserializer.java:122)
    at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:3674)
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:1996)
    at io.dropwizard.configuration.ConfigurationFactory.build(ConfigurationFactory.java:148)
    at io.dropwizard.configuration.ConfigurationFactory.build(ConfigurationFactory.java:95)
    at io.dropwizard.cli.ConfiguredCommand.parseConfiguration(ConfiguredCommand.java:115)
    at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:64)
    at io.dropwizard.cli.Cli.run(Cli.java:70)
    at io.dropwizard.Application.run(Application.java:80)
    at com.mycompany.myproject.services.dropwizard.MyProjectApplication.main(MyProjectApplication.java:38)

io.dropwizard.Configuraton的第63行是@Valid注释。以下是依赖树,我认为我可能会在某些验证或dropwizard实现的版本中看到冲突,但我不能。

[INFO] com.mycompany.myproject:importer:jar:1.0-SNAPSHOT
[INFO] +- com.mycompany.myproject:data-model:jar:1.0-SNAPSHOT:compile
[INFO] |  +- org.apache.avro:avro:jar:1.7.7:compile
[INFO] |  |  +- com.thoughtworks.paranamer:paranamer:jar:2.3:compile
[INFO] |  |  \- org.xerial.snappy:snappy-java:jar:1.0.5:compile
[INFO] |  \- com.fasterxml.jackson.core:jackson-databind:jar:2.6.0:compile
[INFO] |     +- com.fasterxml.jackson.core:jackson-annotations:jar:2.6.0:compile
[INFO] |     \- com.fasterxml.jackson.core:jackson-core:jar:2.6.0:compile
[INFO] +- org.apache.james:apache-mime4j:pom:0.7.2:compile
[INFO] |  +- org.apache.james:apache-mime4j-core:jar:0.7.2:compile
[INFO] |  +- org.apache.james:apache-mime4j-examples:jar:0.7.2:compile
[INFO] |  |  +- org.apache.james:apache-mime4j-dom:jar:0.7.2:compile
[INFO] |  |  \- org.apache.james:apache-mime4j-storage:jar:0.7.2:compile
[INFO] |  +- org.apache.james:apache-mime4j-benchmark:jar:0.7.2:compile
[INFO] |  \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- org.apache.hadoop:hadoop-common:jar:2.7.1:compile
[INFO] |  +- org.apache.hadoop:hadoop-annotations:jar:2.7.1:compile
[INFO] |  |  \- jdk.tools:jdk.tools:jar:1.8:system
[INFO] |  +- com.google.guava:guava:jar:11.0.2:compile
[INFO] |  +- commons-cli:commons-cli:jar:1.2:compile
[INFO] |  +- org.apache.commons:commons-math3:jar:3.1.1:compile
[INFO] |  +- xmlenc:xmlenc:jar:0.52:compile
[INFO] |  +- commons-httpclient:commons-httpclient:jar:3.1:compile
[INFO] |  +- commons-codec:commons-codec:jar:1.4:compile
[INFO] |  +- commons-net:commons-net:jar:3.1:compile
[INFO] |  +- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] |  +- javax.servlet:servlet-api:jar:2.5:compile
[INFO] |  +- org.mortbay.jetty:jetty:jar:6.1.26:compile
[INFO] |  +- org.mortbay.jetty:jetty-util:jar:6.1.26:compile
[INFO] |  +- javax.servlet.jsp:jsp-api:jar:2.1:runtime
[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.1:compile
[INFO] |  |  +- com.sun.xml.bind:jaxb-impl:jar:2.2.3-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] |  +- com.sun.jersey:jersey-server:jar:1.9:compile
[INFO] |  |  \- asm:asm:jar:3.1:compile
[INFO] |  +- log4j:log4j:jar:1.2.17:compile
[INFO] |  +- net.java.dev.jets3t:jets3t:jar:0.9.0:compile
[INFO] |  |  +- org.apache.httpcomponents:httpclient:jar:4.1.2:compile
[INFO] |  |  +- org.apache.httpcomponents:httpcore:jar:4.1.2:compile
[INFO] |  |  \- com.jamesmurty.utils:java-xmlbuilder:jar:0.4:compile
[INFO] |  +- commons-lang:commons-lang:jar:2.6: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.slf4j:slf4j-api:jar:1.7.10:compile
[INFO] |  +- org.slf4j:slf4j-log4j12:jar:1.7.10: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.google.protobuf:protobuf-java:jar:2.5.0:compile
[INFO] |  +- com.google.code.gson:gson:jar:2.2.4:compile
[INFO] |  +- org.apache.hadoop:hadoop-auth:jar:2.7.1: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.curator:curator-framework:jar:2.7.1:compile
[INFO] |  +- com.jcraft:jsch:jar:0.1.42:compile
[INFO] |  +- org.apache.curator:curator-client:jar:2.7.1:compile
[INFO] |  +- org.apache.curator:curator-recipes:jar:2.7.1:compile
[INFO] |  +- com.google.code.findbugs:jsr305:jar:3.0.0:compile
[INFO] |  +- org.apache.htrace:htrace-core:jar:3.1.0-incubating:compile
[INFO] |  +- org.apache.zookeeper:zookeeper:jar:3.4.6:compile
[INFO] |  |  \- io.netty:netty:jar:3.7.0.Final: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-hdfs:jar:2.7.1:compile
[INFO] |  +- commons-daemon:commons-daemon:jar:1.0.13:compile
[INFO] |  +- io.netty:netty-all:jar:4.0.23.Final: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] +- edu.stanford.nlp:stanford-corenlp:jar:3.5.2:compile
[INFO] |  +- com.io7m.xom:xom:jar:1.2.10:compile
[INFO] |  |  \- xalan:xalan:jar:2.7.0:compile
[INFO] |  +- joda-time:joda-time:jar:2.1:compile
[INFO] |  +- de.jollyday:jollyday:jar:0.4.7:compile
[INFO] |  |  \- javax.xml.bind:jaxb-api:jar:2.2.7:compile
[INFO] |  +- com.googlecode.efficient-java-matrix-library:ejml:jar:0.23:compile
[INFO] |  \- javax.json:javax.json-api:jar:1.0:compile
[INFO] +- edu.stanford.nlp:stanford-corenlp:jar:models:3.5.2:compile
[INFO] \- commons-io:commons-io:jar:2.4:compile

编辑:这对我没有意义。只有当@Valid注释从接口更改为类而没有将dropwizard重新编译为具有类作为类的版本时,才会发生这种情况吗?那个注释不会发生吗?

编辑:

我的yaml文件:

logging:
  level: INFO

server:
  type: simple
  rootPath: /api/*
  applicationContextPath: /

配置类(基本上为空):

package com.mycompany.myproject.services.dropwizard;

import io.dropwizard.Configuration;

public class MyProjectConfiguration extends Configuration {

}

1 个答案:

答案 0 :(得分:1)

修正了它。

Cloudera的JDBC驱动程序也包括jetty-all和jersey依赖项。为什么他们认为包含在数据库驱动程序中是一件理智的事情超出了我的范围。

无论如何,一堆排除后来,我的代码再次运作,但是谁知道驱动程序什么时候会崩溃。