WAS 9启动问题,未为生成器定义任何ObjectCodec,杰克逊2.5.4

时间:2019-09-14 04:56:45

标签: jackson websphere

II用REST api创建了适用于tomact 7的应用程序,以下是使用的依赖冰块

<dependencies>
       <dependency>
    <groupId>org.glassfish.jersey.containers</groupId>
    <artifactId>jersey-container-servlet-core</artifactId>
    <version>2.23.2</version>
    <exclusions>
        <exclusion>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
        </exclusion>
    </exclusions>
       </dependency>
   <dependency>
    <groupId>org.glassfish.jersey.ext</groupId>
    <artifactId>jersey-spring3</artifactId>
    <version>2.23.2</version>
    <exclusions>
     <exclusion>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
     </exclusion>
     <exclusion>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
     </exclusion>
     <exclusion>
      <groupId>org.springframework</groupId>
      <artifactId>spring-web</artifactId>
     </exclusion>
     <exclusion>
         <groupId>javax.ws.rs</groupId>
         <artifactId>javax.ws.rs-api</artifactId>
     </exclusion>
     <exclusion>
         <groupId>javax.inject</groupId>
         <artifactId>javax.inject</artifactId>
     </exclusion>
    </exclusions>
   </dependency>
   <dependency>
    <groupId>org.glassfish.jersey.core</groupId>
    <artifactId>jersey-client</artifactId>
    <version>2.23.2</version>
    <exclusions>
        <exclusion>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
        </exclusion>
    </exclusions>
   </dependency>
    <dependency>
    <groupId>org.glassfish.jersey.core</groupId>
    <artifactId>jersey-server</artifactId>
    <version>2.23.2</version>
    <exclusions>
        <exclusion>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
        </exclusion>
    </exclusions>
    </dependency>
   <dependency>
    <groupId>org.glassfish.jersey.core</groupId>
    <artifactId>jersey-common</artifactId>
    <version>2.23.2</version>
    <exclusions>
        <exclusion>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
        </exclusion>
    </exclusions>
   </dependency>
     <dependency>
      <groupId>org.glassfish.jersey.media</groupId>
      <artifactId>jersey-media-json-jackson</artifactId>
      <version>2.23.2</version>
      <exclusions>
       <exclusion>
        <groupId>com.fasterxml.jackson.core</groupId>
         <artifactId>jackson-annotations</artifactId>
       </exclusion>
       <exclusion>
           <groupId>javax.ws.rs</groupId>
           <artifactId>javax.ws.rs-api</artifactId>
       </exclusion>

      </exclusions>
   </dependency>

当我在WAS 9.0.5中部署它时,它无法给出错误消息

java.lang.IllegalStateException: No ObjectCodec defined for the generator, can only serialize simple wrapper types (type passed java.util.HashMap)
        at com.fasterxml.jackson.core.JsonGenerator._writeSimpleObject(JsonGenerator.java:1650) ~[jackson-core-2.5.4.jar:2.5.4]
        at com.fasterxml.jackson.core.base.GeneratorBase.writeObject(GeneratorBase.java:317) ~[jackson-core-2.5.4.jar:2.5.4]
        at com.inetpsa.seed.core.internal.DefaultDiagnosticReporter.writeDiagnosticReport(DefaultDiagnosticReporter.java:41) ~[seed-core-support-core-1.4.0-M1.jar:na]

0 个答案:

没有答案