2017-03-24 1 views
1

Wir verwenden CXF 3.0.1 mit Spring 4.1.0.RELEASE und tomcat 8.0.36. Unten ist die POM-Definition. Wir erhalten diesen Fehler "java.lang.NoSuchMethodError: javax.ws.rs.core.HttpHeaders.getHeaderString" immer dann, wenn ein HTTP-GET-Aufruf aufgerufen wird. Bitte lassen Sie uns wissen, was hier falsch ist.CXF 3.0.1 java.lang.NoSuchMethodError: javax.ws.rs.core.HttpHeaders.getHeaderString

<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> 
<groupId>com.aha.sdp.product</groupId> 
<artifactId>aha-sdp-ws-product</artifactId> 
<packaging>war</packaging> 
<version>0.0.1-SNAPSHOT</version> 
<name>aha-sdp-ws-product Maven Webapp</name> 
<url>http://maven.apache.org</url> 
<properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <spring.version>4.1.0.RELEASE</spring.version> 

    <spring.data.version>1.8.0.RELEASE</spring.data.version> 

    <!-- For Spring's JDBCTemplate --> 
    <spring.jdbc.version>4.1.8.RELEASE</spring.jdbc.version> 
    <slf4j.version>1.7.7</slf4j.version> 
    <cxf.version>3.0.1</cxf.version> 
    <swagger.version>1.5.12</swagger.version> 
    <jackson.version>1.9.0</jackson.version> 

    <buildNumber>DEFAULT_BUILD_NUMBER</buildNumber> 
</properties> 

<dependencies> 
    <dependency> 
     <groupId>org.springframework.data</groupId> 
     <artifactId>spring-data-jpa</artifactId> 
     <version>${spring.data.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-jdbc</artifactId> 
     <version>${spring.jdbc.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>org.codehaus.jackson</groupId> 
     <artifactId>jackson-xc</artifactId> 
     <version>1.9.13</version> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.cxf</groupId> 
     <artifactId>cxf-rt-frontend-jaxrs</artifactId> 
     <version>${cxf.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.cxf</groupId> 
     <artifactId>cxf-rt-frontend-jaxws</artifactId> 
     <version>${cxf.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.cxf</groupId> 
     <artifactId>cxf-rt-transports-http</artifactId> 
     <version>${cxf.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>org.apache.cxf</groupId> 
     <artifactId>cxf-rt-rs-service-description</artifactId> 
     <version>${cxf.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>io.swagger</groupId> 
     <artifactId>swagger-jaxrs</artifactId> 
     <version>${swagger.version}</version> 
    </dependency> 


    <dependency> 
     <groupId>io.swagger</groupId> 
     <artifactId>swagger-core</artifactId> 
     <version>${swagger.version}</version> 
    </dependency> 


    <dependency> 
     <groupId>io.swagger</groupId> 
     <artifactId>swagger-annotations</artifactId> 
     <version>${swagger.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>javax.validation</groupId> 
     <artifactId>validation-api</artifactId> 
     <version>1.1.0.Final</version> 
     <scope>compile</scope> 
    </dependency> 


    <dependency> 
     <groupId>org.codehaus.jackson</groupId> 
     <artifactId>jackson-jaxrs</artifactId> 
     <version>${jackson.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-web</artifactId> 
     <version>${spring.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>commons-lang</groupId> 
     <artifactId>commons-lang</artifactId> 
     <version>2.6</version> 
    </dependency> 

    <dependency> 
     <groupId>commons-beanutils</groupId> 
     <artifactId>commons-beanutils</artifactId> 
     <version>1.9.2</version> 
    </dependency> 

    <dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>slf4j-log4j12</artifactId> 
     <version>1.7.7</version> 
    </dependency> 

    <dependency> 
     <groupId>javax.servlet</groupId> 
     <artifactId>javax.servlet-api</artifactId> 
     <version>3.0.1</version> 
     <scope>provided</scope> 
    </dependency> 

    <!-- Database --> 
    <dependency> 
     <groupId>org.hibernate</groupId> 
     <artifactId>hibernate-core</artifactId> 
     <version>4.0.1.Final</version> 
    </dependency> 
    <dependency> 
     <groupId>org.hibernate</groupId> 
     <artifactId>hibernate-validator</artifactId> 
     <version>4.2.0.Final</version> 
    </dependency> 
    <dependency> 
     <groupId>org.hibernate.common</groupId> 
     <artifactId>hibernate-commons-annotations</artifactId> 
     <version>4.0.1.Final</version> 
     <classifier>tests</classifier> 
    </dependency> 
    <dependency> 
     <groupId>org.hibernate.javax.persistence</groupId> 
     <artifactId>hibernate-jpa-2.0-api</artifactId> 
     <version>1.0.1.Final</version> 
    </dependency> 
    <dependency> 
     <groupId>org.hibernate</groupId> 
     <artifactId>hibernate-entitymanager</artifactId> 
     <version>4.0.1.Final</version> 
    </dependency> 

    <dependency> 
     <groupId>org.hibernate</groupId> 
     <artifactId>hibernate-c3p0</artifactId> 
     <version>4.0.1.Final</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-orm</artifactId> 
     <version>4.1.0.RELEASE</version> 
    </dependency> 


    <dependency> 
     <groupId>org.postgresql</groupId> 
     <artifactId>postgresql</artifactId> 
     <version>9.4-1200-jdbc41</version> 
     <exclusions> 
      <exclusion> 
       <artifactId>slf4j-simple</artifactId> 
       <groupId>org.slf4j</groupId> 
      </exclusion> 
     </exclusions> 
    </dependency> 

    <dependency> 
     <groupId>com.aha.sdp</groupId> 
     <artifactId>aha-sdp-ws-common</artifactId> 
     <type>jar</type> 
     <version>1.0</version> 
    </dependency> 

    <dependency> 
     <groupId>com.google.code.gson</groupId> 
     <artifactId>gson</artifactId> 
     <version>2.5</version> 
    </dependency> 
    <dependency> 
     <groupId>org.jmockit</groupId> 
     <artifactId>jmockit</artifactId> 
     <version>1.13</version> 
    </dependency> 

    <dependency> 
     <groupId>org.springframework</groupId> 
     <artifactId>spring-test</artifactId> 
     <version>4.0.5.RELEASE</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.googlecode.jmockit</groupId> 
     <artifactId>jmockit-coverage</artifactId> 
     <version>0.999.22</version> 
     <scope>runtime</scope> 
    </dependency> 

    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>4.11</version> 
    </dependency> 
    <dependency> 
     <groupId>org.jmock</groupId> 
     <artifactId>jmock</artifactId> 
     <version>2.6.0-RC2</version> 
     <scope>test</scope> 
    </dependency> 


    <dependency> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-surefire-plugin</artifactId> 
     <version>2.19.1</version> 
     <exclusions> 
      <exclusion> 
       <artifactId>slf4j-jdk14</artifactId> 
       <groupId>org.slf4j</groupId> 
      </exclusion> 
      <exclusion> 
       <artifactId>slf4j-nop</artifactId> 
       <groupId>org.slf4j</groupId> 
      </exclusion> 
     </exclusions> 
    </dependency> 

</dependencies> 
<build> 
    <finalName>aha-sdp-ws-product</finalName> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>3.0</version> 
      <configuration> 
       <source>1.7</source> 
       <target>1.7</target> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-war-plugin</artifactId> 
      <version>2.0.2</version> 
      <configuration> 
       <archive> 
        <manifest> 
         <addDefaultImplementationEntries>true</addDefaultImplementationEntries> 
        </manifest> 
        <manifestEntries> 
         <Implementation-Version>${buildNumber}</Implementation-Version> 
        </manifestEntries> 
       </archive> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-surefire-plugin</artifactId> 
      <version>2.19.1</version> 
      <configuration> 
       <systemProperties> 
        <property> 
         <name>jmockit-coverage-excludes</name> 
         <value>com.aha.entity.*</value> 
        </property> 
       </systemProperties> 
      </configuration> 
     </plugin> 
    </plugins> 
    <resources> 
     <resource> 
      <directory>src/main/resources</directory> 
     </resource> 
    </resources> 
</build> 
<reporting> 
    <plugins> 

     <plugin> 
      <groupId>org.codehaus.mojo</groupId> 
      <artifactId>findbugs-maven-plugin</artifactId> 
      <version>3.0.3</version> 
      <configuration> 
       <threshold>Low</threshold><!-- High|Normal|Low|Exp|Ignore --> 
       <effort>Default</effort><!-- Min|Default|Max --> 
      </configuration> 
     </plugin> 

     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-jxr-plugin</artifactId> 
      <version>2.5</version> 
     </plugin> 

     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-javadoc-plugin</artifactId> 
      <version>2.10.3</version> 
     </plugin> 

     <!-- Normally, we take off the dependency report, saves time. --> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-surefire-plugin</artifactId> 
      <version>2.19.1</version> 
     </plugin> 

     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-surefire-report-plugin</artifactId> 
      <version>2.19.1</version> 
     </plugin> 

     <plugin> 
      <groupId>org.codehaus.mojo</groupId> 
      <artifactId>sonar-maven-plugin</artifactId> 
      <version>2.3</version> 
     </plugin> 



    </plugins> 
</reporting> 

Antwort

0

ich dieses Problem heute mit Feder 4.3.3-RELEASE konfrontiert, die Aktualisierung CXF auf Version 3.1.0 oder höher wird das Problem sortieren.

<dependency> 
    <groupId>org.apache.cxf</groupId> 
    <artifactId>cxf-rt-frontend-jaxrs</artifactId> 
    <version>3.1.0</version> 
</dependency> 

Verfahren getHeaderString ist innen HttpHeadersImpl

Verwandte Themen