当前位置: 首页 > 知识库问答 >
问题:

java.lang.错误:com.fasterxml.jackson.databind.JavaType.is参考类型()Z

沈子昂
2023-03-14

我正在我的项目中使用elasticsearch和spring。升级到最新的弹性搜索后,我得到以下错误。添加这些依赖项后,项目就可以正常启动了。当我尝试使用这些方法时,它开始给我错误信息:

java.lang.NoSuchmethod odError:com.fasterxml.jackson.databind.JavaType.isReourceType()Z.

组织。springframework。网状物util。NestedServletException:处理程序处理失败;嵌套的异常是java。lang.NoSuchMethodError:com。fasterxml。杰克逊。数据绑定。JavaType。isReferenceType()Z org。springframework。网状物servlet。调度员服务。doDispatch(DispatcherServlet.java:986)org。springframework。网状物servlet。调度员服务。doService(DispatcherServlet.java:897)org。springframework。网状物servlet。FrameworkServlet。processRequest(FrameworkServlet.java:970)org。springframework。网状物servlet。FrameworkServlet。doGet(FrameworkServlet.java:861)javax。servlet。http。HttpServlet。服务(HttpServlet.java:622)组织。springframework。网状物servlet。FrameworkServlet。服务(FrameworkServlet.java:846)javax。servlet。http。HttpServlet。服务(HttpServlet.java:729)组织。阿帕奇。公猫websocket。服务器WsFilter。doFilter(WsFilter.java:52)org。springframework。安全网状物过滤链氧气。doFilterInternal(FilterChainProxy.java:207)org。springframework。安全网状物过滤链氧气。doFilter(FilterChainProxy.java:176)org。springframework。网状物滤器删除过滤程序。invokeDelegate(DelegatingFilterProxy.java:346)org。springframework。网状物滤器删除过滤程序。doFilter(DelegatingFilterProxy.java:262)com。阿普塞利昂。站台安全滤器名称空间过滤器。doFilterInternal(NamespaceFilter.java:29)org。springframework。网状物滤器OncePerRequestFilter。doFilter(OncePerRequestFilter.java:107)org。springframework。网状物滤器删除过滤程序。invokeDelegate(DelegatingFilterProxy.java:346)org。springframework。网状物滤器删除过滤程序。doFilter(DelegatingFilterProxy.java:262)com。阿普塞利昂。站台安全滤器科尔斯菲尔特。doFilterInternal(CorsFilter.java:28)org。springframework。网状物滤器OncePerRequestFilter。doFilter(OncePerRequestFilter.java:107)org。springframework。网状物滤器删除过滤程序。invokeDelegate(DelegatingFilterProxy.java:346)org。springframework。网状物滤器删除过滤程序。doFilter(DelegatingFilterProxy.java:262)org。jboss。放松点。插件。服务器servlet。FilterDispatcher。doFilter(FilterDispatcher.java:63)

这是我的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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>console</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>

<profiles>
    <profile>
        <id>dev</id>
        <properties>
            <cam.db.url>jdbc:mysql:///areeba</cam.db.url>
        </properties>
    </profile>
</profiles>

<repositories>
  <!-- elasticsearch repo -->
  <repository>
     <id>elasticsearch-releases</id>
     <url>https://maven.elasticsearch.org/releases</url>
     <releases>
        <enabled>true</enabled>
     </releases>
     <snapshots>
        <enabled>false</enabled>
     </snapshots>
  </repository></repositories>

<properties>
    <jdk.version>1.8</jdk.version>
    <gwt.version>2.7.0</gwt.version>
    <camunda.version>7.4.0</camunda.version>
    <es.version>2.3.0</es.version>
    <camunda.spin.version>1.1.0</camunda.spin.version>
    <spring.version>4.3.1.RELEASE</spring.version>
    <spring.security.version>3.2.3.RELEASE</spring.security.version>
    <jstl.version>1.2</jstl.version>
    <jackson.version>2.7.5</jackson.version>
    <junit.version>4.11</junit.version>
    <logback.version>1.0.13</logback.version>
    <hibernate.version>5.1.3.Final</hibernate.version>
    <jcl-over-slf4j.version>1.7.5</jcl-over-slf4j.version>
    <project.http.version>1.19.0</project.http.version>
    <project.oauth.version>1.19.0</project.oauth.version>
    <project.java6.version>1.19.0</project.java6.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <webapp.directory>${project.build.directory}/${project.build.finalName}</webapp.directory>
</properties>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.3.3.RELEASE</version>
</parent>

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.google.gwt</groupId>
            <artifactId>gwt</artifactId>
            <version>${gwt.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
    <!-- Unit Test -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
    </dependency>

    <!-- jackson -->
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-annotations</artifactId>
        <version>${jackson.version}</version>
    </dependency>

    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>${jackson.version}</version>
    </dependency>

    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>${jackson.version}</version>
    </dependency>

    <!-- Spring social -->
    <dependency>
        <groupId>org.springframework.social</groupId>
        <artifactId>spring-social-config</artifactId>
        <version>1.1.0.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.social</groupId>
        <artifactId>spring-social-core</artifactId>
        <version>1.1.0.RELEASE</version>
    </dependency>
    <!-- Spring Social Facebook -->
    <dependency>
        <groupId>org.springframework.social</groupId>
        <artifactId>spring-social-facebook</artifactId>
        <version>1.1.0.RELEASE</version>
    </dependency>

    <!-- Spring Social Twitter -->
    <dependency>
        <groupId>org.springframework.social</groupId>
        <artifactId>spring-social-twitter</artifactId>
        <version>1.1.0.RELEASE</version>
    </dependency>

    <!-- spring web socket -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-websocket</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-messaging</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        <version>1.3.3.RELEASE</version>
        <exclusions>
            <exclusion>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-tomcat</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
        <version>1.3.3.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-mongodb</artifactId>
        <version>1.3.3.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-remote-shell</artifactId>
        <version>1.3.3.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-mail</artifactId>
        <version>1.3.3.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-velocity</artifactId>
        <version>1.3.3.RELEASE</version>
    </dependency>
    <!-- logging -->
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>${jcl-over-slf4j.version}</version>
    </dependency>
    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>${logback.version}</version>
    </dependency>

    <!-- spring data -->
    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-jpa</artifactId>
        <version>1.8.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-mongodb</artifactId>
        <version>1.7.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-commons</artifactId>
        <version>1.10.0.RELEASE</version>
    </dependency>

    <!-- spring memcached -->
    <dependency>
        <groupId>com.google.code.simple-spring-memcached</groupId>
        <artifactId>spring-cache</artifactId>
        <version>3.5.0</version>
    </dependency>
    <dependency>
        <groupId>com.google.code.simple-spring-memcached</groupId>
        <artifactId>xmemcached-provider</artifactId>
        <version>3.5.0</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aspects</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <!-- mysql -->
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.22</version>
    </dependency>

    <!-- mongodb java driver -->
    <dependency>
        <groupId>org.mongodb</groupId>
        <artifactId>mongo-java-driver</artifactId>
        <version>3.0.2</version>
    </dependency>

    <!-- apache commons -->
    <dependency>
        <groupId>org.apache.velocity</groupId>
        <artifactId>velocity</artifactId>
        <version>1.7</version>
    </dependency>
    <dependency>
        <groupId>commons-net</groupId>
        <artifactId>commons-net</artifactId>
        <version>3.0.1</version>
    </dependency>
    <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.2</version>
    </dependency>
    <dependency>
        <groupId>commons-validator</groupId>
        <artifactId>commons-validator</artifactId>
        <version>1.3.1</version>
    </dependency>
    <dependency>
        <groupId>com.google.code.maven-play-plugin.org.apache.commons</groupId>
        <artifactId>commons-javaflow</artifactId>
        <version>1590792-patched-play-1.3.0 </version>
    </dependency>
    <dependency>
        <groupId>commons-fileupload</groupId>
        <artifactId>commons-fileupload</artifactId>
        <version>1.2.2</version>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-email</artifactId>
        <version>1.4</version>
    </dependency>
    <dependency>
        <groupId>commons-digester</groupId>
        <artifactId>commons-digester</artifactId>
        <version>1.7</version>
    </dependency>
    <dependency>
        <groupId>commons-beanutils</groupId>
        <artifactId>commons-beanutils</artifactId>
        <version>1.8.3</version>
    </dependency>
    <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <version>3.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.3.2</version>
    </dependency>
    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.4</version>
    </dependency>

    <!-- Azure -->
    <dependency>
        <groupId>com.microsoft.azure</groupId>
        <artifactId>azure-storage</artifactId>
        <version>4.0.0</version>
    </dependency>

    <!-- camunda repo -->
    <dependency>
        <groupId>org.camunda.bpm</groupId>
        <artifactId>camunda-engine</artifactId>
        <version>${camunda.version}</version>
    </dependency>
    <dependency>
        <groupId>org.camunda.bpm</groupId>
        <artifactId>camunda-engine-spring</artifactId>
        <version>${camunda.version}</version>
    </dependency>
    <dependency>
        <groupId>org.camunda.bpm</groupId>
        <artifactId>camunda-engine-rest</artifactId>
        <classifier>classes</classifier>
        <version>${camunda.version}</version>
        <exclusions>
            <exclusion>
                <groupId>com.google.guava</groupId>
                <artifactId>guava-jdk5</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.camunda.spin</groupId>
        <artifactId>camunda-spin-core</artifactId>
        <version>${camunda.spin.version}</version>
    </dependency>
    <dependency>
        <groupId>org.camunda.spin</groupId>
        <artifactId>camunda-spin-dataformat-all</artifactId>
        <version>${camunda.spin.version}</version>
    </dependency>

    <!-- google cloud sql api 
    <dependency>
        <groupId>com.google.apis</groupId>
        <artifactId>google-api-services-sqladmin</artifactId>
        <version>v1beta4-rev10-1.20.0</version>
        <exclusions>
            <exclusion>
                <groupId>com.google.guava</groupId>
                <artifactId>guava-jdk5</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    -->
    <!-- google cloud storage
    <dependency>
        <groupId>com.google.apis</groupId>
        <artifactId>google-api-services-storage</artifactId>
        <version>v1-rev18-1.19.0</version>
    </dependency>
    <dependency>
        <groupId>com.google.http-client</groupId>
        <artifactId>google-http-client-jackson2</artifactId>
        <version>${project.http.version}</version>
    </dependency>
    <dependency>
        <groupId>com.google.oauth-client</groupId>
        <artifactId>google-oauth-client-jetty</artifactId>
        <version>${project.oauth.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>servlet-api</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>com.google.api-client</groupId>
        <artifactId>google-api-client-java6</artifactId>
        <version>${project.java6.version}</version>
    </dependency>
    -->
    <!-- elastic search -->
    <dependency>
        <groupId>org.elasticsearch</groupId>
        <artifactId>elasticsearch</artifactId>
        <version>${es.version}</version>
    </dependency>

    <dependency>
        <groupId>org.elasticsearch.plugin</groupId>
        <artifactId>shield</artifactId>
        <version>2.2.0</version>
    </dependency>

    <!-- others -->
    <dependency>
        <!-- jsoup HTML parser library @ http://jsoup.org/ -->
        <groupId>org.jsoup</groupId>
        <artifactId>jsoup</artifactId>
        <version>1.8.3</version>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.17</version>
    </dependency>
    <dependency>
        <groupId>javax.ws.rs</groupId>
        <artifactId>jsr311-api</artifactId>
        <version>1.1.1</version>
    </dependency>
    <dependency>
        <groupId>maven</groupId>
        <artifactId>dom4j</artifactId>
        <version>1.7-20060614</version>
        <exclusions>
            <exclusion>
                <groupId>xerces</groupId>
                <artifactId>xercesImpl</artifactId>
            </exclusion>
            <exclusion>
                <groupId>com.ibm.icu</groupId>
                <artifactId>icu4j</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>18.0</version>
    </dependency>
    <dependency>
        <groupId>com.googlecode.gwt-crypto</groupId>
        <artifactId>gwt-crypto</artifactId>
        <version>2.3.0</version>
    </dependency>
    <dependency>
        <groupId>javax.ws.rs</groupId>
        <artifactId>javax.ws.rs-api</artifactId>
        <version>2.0.1</version>
    </dependency>
    <dependency>
        <groupId>org.fusesource.restygwt</groupId>
        <artifactId>restygwt</artifactId>
        <version>2.0.3</version>
    </dependency>
    <dependency>
        <groupId>javax.mail</groupId>
        <artifactId>mail</artifactId>
        <version>1.4.7</version>
    </dependency>
    <dependency>
        <groupId>org.jboss.resteasy</groupId>
        <artifactId>resteasy-jaxrs</artifactId>
        <version>2.3.6.Final</version>
        <exclusions>
            <exclusion>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpclient</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>cglib</groupId>
        <artifactId>cglib</artifactId>
        <version>2.2.2</version>
    </dependency>
    <dependency>
        <groupId>javax.persistence</groupId>
        <artifactId>persistence-api</artifactId>
        <version>1.0.2</version>
    </dependency>
    <dependency>
        <groupId>com.twilio.sdk</groupId>
        <artifactId>twilio-java-sdk</artifactId>
        <version>4.4.0</version>
        <scope>compile</scope>
        <exclusions>
            <exclusion>
                <groupId>org.codehaus.jackson</groupId>
                <artifactId>jackson-core-asl</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.codehaus.jackson</groupId>
                <artifactId>jackson-mapper-asl</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <!-- validation api -->
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator</artifactId>
        <version>${hibernate.version}</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator-annotation-processor</artifactId>
        <version>${hibernate.version}</version>
    </dependency>
    <dependency>
        <groupId>javax.validation</groupId>
        <artifactId>validation-api</artifactId>
        <version>1.1.0.Final</version>
    </dependency>

    <!-- opensmpp -->
    <dependency>
        <groupId>org.opensmpp</groupId>
        <artifactId>opensmpp-core</artifactId>
        <version>3.0.0</version>
    </dependency>

    <!-- apache tomcat -->
    <dependency>
        <groupId>commons-digester</groupId>
        <artifactId>commons-digester</artifactId>
        <version>2.1</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.1.0</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

<build>
    <finalName>console</finalName>
    <!-- Output classes directly into the webapp, so that IDEs and "mvn process-classes" 
        update them in DevMode -->
    <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>
    <resources>
        <resource>
            <directory>src/main/resources</directory>
            <filtering>true</filtering>
        </resource>
    </resources>
    <plugins>
        <!-- Eclipse project -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-eclipse-plugin</artifactId>
            <version>2.9</version>
            <configuration>
                <!-- Always download and attach dependencies source code -->
                <downloadSources>false</downloadSources>
                <downloadJavadocs>false</downloadJavadocs>
                <!-- Avoid type mvn eclipse:eclipse -Dwtpversion=2.0 -->
                <wtpversion>2.0</wtpversion>
            </configuration>
        </plugin>
        <!-- Set JDK Compiler Level -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
                <source>${jdk.version}</source>
                <target>${jdk.version}</target>
            </configuration>
        </plugin>
        <!-- For Maven Tomcat Plugin -->
        <plugin>
            <groupId>org.apache.tomcat.maven</groupId>
            <artifactId>tomcat7-maven-plugin</artifactId>
            <version>2.2</version>
            <configuration>
                <path>/console</path>
                <outputDirectory>/home/cutout33/maven/deploy/</outputDirectory>
                <systemProperties>
                    <JAVA_OPTS>-XstartOnFirstThread -d64 -Xss1024m -Xmx2024m
                        -XX:MaxPermSize=2024m</JAVA_OPTS>
                </systemProperties>
            </configuration>
        </plugin>
    </plugins>
</build>

共有1个答案

高皓
2023-03-14

终于解决了,问题来自另一个嵌入了数据绑定版本的jar。我能够通过搜索类JavaVersion从eclipse中找到它...谢谢你的帮助

 类似资料:
  • 2周来,我一直在努力寻找此错误的解决方案。你能帮我发生了什么事吗? 以下是错误堆栈跟踪:

  • 问题内容: 我想将jackson json库用于通用方法,如下所示: … 现在的问题是,当我调用位于请求对象内的getMyObject()时,杰克逊将嵌套的自定义对象作为LinkedHashMap返回。有什么方法可以指定需要返回T对象吗?例如:如果我发送了类型为Customer的对象,则应该从该List?中返回Customer。 问题答案: 这是Java类型擦除的一个众所周知的问题:T只是一个类型

  • 我正在尝试从Firebase Fi还原中列出项目列表(已经完成),并从Firebase云存储中为每个项目获取不同的图像URL。 我使用一个名为getPhotoUrl的函数来更改变量photoUrl的值。问题是返回是在getPhotoUrl之前执行的。如果我在函数getPhotoUrl和async前面加上_docs.map((文档),我得到一个错误,说参数类型列表 我的代码:

  • http状态码 状态码解释 错误码 错误码解释 400 Bad Request - - - - 400001 Invalid parameters - - 400002 Missing parameters 401 Unauthorized - - - - 401001 Unauthorized user 403 Forbidden - - - - 403001 Not allowed to ac

  • Note This list is auto-generated from the source code. The AUX channels are only available on Pixhawk Boards (labeled with AUX OUT). This page lists all supported airframes and types including the mot

  • 我试图理解为什么当我在MyModel中为T使用更高类型的参数时,以下代码无法编译 但是如果我把它改成< code > new Bar[my model[Any]]它就会编译。这是为什么呢?