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: 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?
application has intrance point
@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;
}
}
and configs are
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 {
}
and test controller is:
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";
}
}
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.
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.
There is a 6th APAR for WAS V9, which is only for performance. It is not applicable to WAS 8.5.5.
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.
You need PI96826 in the very next fixpack
https://www-01.ibm.com/support/docview.wss?uid=swg1PI96826
Java V9 multi-release JARs contain Java V9 classes under the META-INF directory tree. The existence of Java V9 classes causes application start to fail with an exception similar to the following:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With