发音问题 = 组装发音应用程序。 com.sun.tools.apt.mirror.type.ClassTypeImpl 无法转换为 com.sun.mirror.type.AnnotationType
Enunciate Issue = Assembling the enunciate app. com.sun.tools.apt.mirror.type.ClassTypeImpl cannot be cast to com.sun.mirror.type.AnnotationType
我希望我的 Enunciate 报告包含所有模型 class 的 Json 示例,为了测试它,我修改了 enunciate 配置以包含 json 示例并更改了我的模型 class 来自
@XmlRootElement(name = "member-response")
public class MemberResponse
至
@JsonRootType
@JsonName("MemberResponse")
@XmlRootElement
public class MemberResponse
然后构建maven项目和运行
mvn -o clean pre-site site:site site:stage -Prest-reports -PskipQuality -DskipTests=true -U
得到下面的class强制转换异常
(com.sun.tools.apt.mirror.type.ClassTypeImpl cannot be cast to com.sun.mirror.type.AnnotationType) -
为什么 @JsonRootType 没有被 enunicate 识别。?请推荐
[ERROR] Failed to execute goal org.codehaus.enunciate:maven-enunciate-plugin:1.27:docs (default) on project endeavour-application-resource: Problem assembling the enunciate app. com.sun.tools.apt.mirror.type.ClassTypeImpl cannot be cast to com.sun.mirror.type.AnnotationType -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.enunciate:maven-enunciate-plugin:1.27:docs (default) on project XXXXXXX-application-resource: Problem assembling the enunciate app.
Caused by: java.lang.ClassCastException: com.sun.tools.apt.mirror.type.ClassTypeImpl cannot be cast to com.sun.mirror.type.AnnotationType
at com.sun.tools.apt.mirror.declaration.AnnotationMirrorImpl.getAnnotationType(AnnotationMirrorImpl.java:100)
at net.sf.jelly.apt.decorations.declaration.DecoratedAnnotationMirror.<init>(DecoratedAnnotationMirror.java:49)
at net.sf.jelly.apt.decorations.DeclarationDecorator.decorate(DeclarationDecorator.java:362)
at net.sf.jelly.apt.decorations.DeclarationDecorator.decorateAnnotationMirrors(DeclarationDecorator.java:113)
at net.sf.jelly.apt.decorations.declaration.DecoratedDeclaration.getAnnotationMirrors(DecoratedDeclaration.java:213)
一旦我从明确依赖的排除列表中删除了 Jackson 罐子,上述错误就停止了。
<dependency>
<groupId>org.codehaus.enunciate</groupId>
<artifactId>enunciate-rt</artifactId>
<exclusions>
<!--For Enunciate Reporting to Include Json Examples - Commenting this
<exclusion>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-xc</artifactId>
</exclusion>-->
我希望我的 Enunciate 报告包含所有模型 class 的 Json 示例,为了测试它,我修改了 enunciate 配置以包含 json 示例并更改了我的模型 class 来自
@XmlRootElement(name = "member-response")
public class MemberResponse
至
@JsonRootType
@JsonName("MemberResponse")
@XmlRootElement
public class MemberResponse
然后构建maven项目和运行
mvn -o clean pre-site site:site site:stage -Prest-reports -PskipQuality -DskipTests=true -U
得到下面的class强制转换异常
(com.sun.tools.apt.mirror.type.ClassTypeImpl cannot be cast to com.sun.mirror.type.AnnotationType) -
为什么 @JsonRootType 没有被 enunicate 识别。?请推荐
[ERROR] Failed to execute goal org.codehaus.enunciate:maven-enunciate-plugin:1.27:docs (default) on project endeavour-application-resource: Problem assembling the enunciate app. com.sun.tools.apt.mirror.type.ClassTypeImpl cannot be cast to com.sun.mirror.type.AnnotationType -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.enunciate:maven-enunciate-plugin:1.27:docs (default) on project XXXXXXX-application-resource: Problem assembling the enunciate app.
Caused by: java.lang.ClassCastException: com.sun.tools.apt.mirror.type.ClassTypeImpl cannot be cast to com.sun.mirror.type.AnnotationType
at com.sun.tools.apt.mirror.declaration.AnnotationMirrorImpl.getAnnotationType(AnnotationMirrorImpl.java:100)
at net.sf.jelly.apt.decorations.declaration.DecoratedAnnotationMirror.<init>(DecoratedAnnotationMirror.java:49)
at net.sf.jelly.apt.decorations.DeclarationDecorator.decorate(DeclarationDecorator.java:362)
at net.sf.jelly.apt.decorations.DeclarationDecorator.decorateAnnotationMirrors(DeclarationDecorator.java:113)
at net.sf.jelly.apt.decorations.declaration.DecoratedDeclaration.getAnnotationMirrors(DecoratedDeclaration.java:213)
一旦我从明确依赖的排除列表中删除了 Jackson 罐子,上述错误就停止了。
<dependency>
<groupId>org.codehaus.enunciate</groupId>
<artifactId>enunciate-rt</artifactId>
<exclusions>
<!--For Enunciate Reporting to Include Json Examples - Commenting this
<exclusion>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-xc</artifactId>
</exclusion>-->