Swagger 2 + Spring MVC + WAS 8.5.5抛出java.lang.VerifyError:JVMVRFY013用于AOP类

时间:2017-11-17 10:06:35

标签: spring-mvc websphere-8 swagger-2.0

我是swagger的新手,并尝试将swagger2与我的Spring MVC(4.3.10发布)应用程序集成,该应用程序将部署到WAS 8.5.5中。在应用程序启动时,我收到以下错误,

Caused by: java.lang.VerifyError: JVMVRFY013 class loading constraint violated; class=org/springframework/aop/aspectj/MethodInvocationProceedingJoinPoint, method=getSourceLocation()Lorg/aspectj/lang/reflect/SourceLocation;, pc=0
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:85)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:162)
at org.springframework.aop.aspectj.AspectJAroundAdvice.lazyGetProceedingJoinPoint(AspectJAroundAdvice.java:81)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:68)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:168)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)

我的招摇配置如下,

  1. 在pom.xml中添加了swagger依赖项

    <!-- Swagger dependencies -->
    <dependency>
       <groupId>io.springfox</groupId>
       <artifactId>springfox-swagger2</artifactId>
       <version>2.2.2</version>
    </dependency>
    <dependency>
       <groupId>io.springfox</groupId>
       <artifactId>springfox-swagger-ui</artifactId>
       <version>2.2.2</version>
    </dependency>
    
  2. 在我的控制器类/操作

    中添加了以下注释
    @Api(value="someController", description="services API")
    @ApiOperation(value = "someOperation")`
    
  3. applicationContext.xml中的Swagger资源配置

    <mvc:resources mapping="/webjars/**" location="classpath:/META-INF/resources/webjars/"/> 
    <mvc:resources mapping="/swagger-ui.html" location="classpath:/META-INF/resources/swagger-ui.html"/>
    
    <mvc:default-servlet-handler/>    
    
    <bean id="swagger2Config" class="springfox.documentation.swagger2.configuration.Swagger2DocumentationConfiguration"/>
    
  4. SwaggerConfig类

    @Configuration
    @EnableSwagger2
    public class SwaggerConfig {
    
        @Bean
        public Docket api(){
            return new Docket(DocumentationType.SWAGGER_2)
                .select()
                .apis(RequestHandlerSelectors.any())
                .paths(PathSelectors.any())
                .build()
                .apiInfo(apiInfo());
        }
    
        private ApiInfo apiInfo() {
            return new ApiInfoBuilder()
                .title("TITLE")
                .description("Description")
                .version("1.0")
                .build();
        }
    }
    
  5. 对此的任何帮助将不胜感激。感谢

0 个答案:

没有答案