尝试在Websphere 8.5.5.13上部署Ear时存在AnnotationException? [英] There is AnnotationException when try to deploy ear on websphere 8.5.5.13?

查看:936
本文介绍了尝试在Websphere 8.5.5.13上部署Ear时存在AnnotationException?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在4.13弹簧上有应用 因此,当尝试在Websphere 8.5.5.13上部署ear-file时-出现错误消息

There is application on spring 4.13 So, when try to deploy ear-file on websphere 8.5.5.13 - there is error message

[12/18/18 14:56:41:946 MSK] 00000086 AnnotationCon E CWMDF0002E: 批注处理失败,出现以下错误: com.ibm.ws.metadata.annotations.AnnotationException:注释 类的处理失败: META-INF/versions/9/javax/xml/bind/ModuleUtil.class

[12/18/18 14:56:41:946 MSK] 00000086 AnnotationCon E CWMDF0002E: Annotation processing failed with the following error: com.ibm.ws.metadata.annotations.AnnotationException: Annotation processing failed for class: META-INF/versions/9/javax/xml/bind/ModuleUtil.class

这是什么问题? 这可能是安装错误还是应用程序和服务器库的不兼容性?

What kind of issue is it? This is may be installation error or error incompalebility of application and server libs?

应用具有访问点

@Configuration
@EnableWebMvc
@ComponentScan(basePackages = {"spring"})
public class WebAppInitalizer implements WebApplicationInitializer {
    private static final String CONFIG_LOCATION = "spring.config";
    private static final String MAPPING_URL = "/*";

    @Override
    public void onStartup(ServletContext servletContext) throws ServletException {
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>> ONSTARTUP <<<<<<<<<<<<<<<<<<<<<<<<");
        WebApplicationContext context = getContext();
        servletContext.addListener(new ContextLoaderListener(context));
        ServletRegistration.Dynamic dispatcher = servletContext.addServlet("DispatcherServlet", new DispatcherServlet(context));
        dispatcher.setLoadOnStartup(1);
        dispatcher.addMapping(MAPPING_URL);
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>> ONSTARTUP END <<<<<<<<<<<<<<<<<<<<<<<<");
    }

    private AnnotationConfigWebApplicationContext getContext() {
        AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
        context.setConfigLocation(CONFIG_LOCATION);
        return context;
    }
}

和配置是

package spring.config;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan(basePackages = "spring")
public class AppConfig {
}


   package spring.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
@EnableWebMvc
public class WebConfig extends WebMvcConfigurerAdapter {
}

并且测试控制器是:

package spring.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    @RequestMapping(value = "/greeting")
    public String healthCheck() {
        return "greeting";
    }

}

推荐答案

错误消息抱怨META-INF/versions/9目录下的类.该位置表明您具有带有Java V9类的多发行版JAR. WAS不支持Java V9类,但已添加了允许在多版本JAR中使用的代码.

The error message is complaining about a class under META-INF/versions/9 directory. That location indicates that you have a multi-release JAR with java V9 classes. WAS does not support Java V9 classes, but code has been added to tolerate them in multi-release JARs.

直到发布WAS 8.5.5和WAS 9.0之后,才存在多发行版JAR.为WAS 8.5.5创建了五个APAR,以解决随着多版本JAR开始被添加到应用程序中而发现的问题. APAR的列表如下.请注意,8.5.5.14中包含3个APAR,而其他8.2.5.15中则包含2个.您可能不需要全部.它取决于您的应用程序,在一种情况下,取决于应用程序类的扫描顺序.

Multi-release JARs did not exist until after WAS 8.5.5 and WAS 9.0 were released. Five APARs were created for WAS 8.5.5 to address the problems that were discovered as multi-release JARs began to be added to applications. The list of APARs is below. Note that 3 APARs were included in 8.5.5.14 and the other 2 are in 8.5.5.15. You may not need all of them. It depends on your application, and in one case, the order in which the application classes are scanned.

WAS V9有一个第六个APAR,仅用于性能.它不适用于WAS 8.5.5.

There is a 6th APAR for WAS V9, which is only for performance. It is not applicable to WAS 8.5.5.

底线:要完全容忍多发行版JAR,您需要上移至8.5.5.15或9.0.0.10或应用下面的所有APAR.

Bottom line: For full tolerance of multi-release JARs you need to move up to 8.5.5.15 or 9.0.0.10 or apply all of the APARs below.

  1. PI89708 – 8.5.5.14,9.0.0.7
  2. PI93744 – 8.5.5.14,9.0.0.8
  3. PI96826 – 8.5.5.14,9.0.0.8
  4. PH02014 – 8.5.5.15,9.0.0.10
  5. PH03710 – 8.5.5.15,9.0.0.10
  6. PI98450 -不适用,9.0.0.9
  1. PI89708 – 8.5.5.14, 9.0.0.7
  2. PI93744 – 8.5.5.14, 9.0.0.8
  3. PI96826 – 8.5.5.14, 9.0.0.8
  4. PH02014 – 8.5.5.15, 9.0.0.10
  5. PH03710 – 8.5.5.15, 9.0.0.10
  6. PI98450 - N/A , 9.0.0.9

这篇关于尝试在Websphere 8.5.5.13上部署Ear时存在AnnotationException?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆