Websphere 8.5 with Spring-5


Is Websphere 8.5.5 compatible with Spring 5? The Validation API referenced in spring5 (validation-api 5) is resulting in MethodNotFound exception.. Any pointers/patch available to get this solved - short of upgrading to Websphere 9?

Caused by: java.lang.NoSuchMethodError: javax/validation/Configuration.getDefaultParameterNameProvider()Ljavax/validation/ParameterNameProvider; (loaded from file:/opt/IBM/WebSphere/AppServer/plugins/javax.j2ee.validation.jar by [email protected]e) called from class org.springframework.validation.beanvalidation.LocalValidatorFactoryBean (loaded from file:../spring-context-5.0.2.RELEASE.jar by [email protected]

- - Source

Answers

answered 11 mon ago Alex Motley #1

The method javax/validation/Configuration.getDefaultParameterNameProvider was added in Bean Validation 1.1, so that indicates the Spring Validator you are using is attempting to use the Bean Validation 1.1 API. According to https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/validation/beanvalidation/LocalValidatorFactoryBean.html:

As of Spring 5.0, this class requires Bean Validation 1.1+

WebSphere 8.5.5 provides Bean Validation 1.0 and did not add support for Bean Validation 1.1 until version 9.0. So, you'll either need to use Spring 4.x or WebSphere 9.x.

answered 5 day ago Rob Breidecker #2

The above answer is not correct. You can run Spring 5 in WebSphere 8.5. this may not be the prefect solution for your situation, but this will get you on the correct path.

1.) Provide your Bean Validation 1.1 JAR

Here is a sample of the Maven dependency.

<dependency>
    <groupId>javax.validation</groupId>
    <artifactId>validation-api</artifactId>
    <version>1.1.0.Final</version>
</dependency>

2.) Add the following a deployment.xml file to the following location in your EAR file.

/myAppEAR/META-INF/ibmconfig/cells/defaultCell/applications/defaultApp/deployments/defaultApp/deployment.xml

3.) In the contents of your deployment.xml file, you must set the classloaderMode to PARENT_LAST. You must also modify this code to use the correct WAR file name.

Here is a sample...

<appdeployment:Deployment xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:appdeployment="http://www.ibm.com/websphere/appserver/schemas/5.0/appdeployment.xmi" xmi:id="Deployment_1422578178899">
  <deployedObject xmi:type="appdeployment:ApplicationDeployment" xmi:id="ApplicationDeployment_1422578178899" startingWeight="10" warClassLoaderPolicy="SINGLE">
    <modules xmi:type="appdeployment:WebModuleDeployment" xmi:id="WebModuleDeployment_1422578178899" startingWeight="10000" **uri="myApp.war"** **classloaderMode="PARENT_LAST"**/>
    <classloader xmi:id="Classloader_1422578178899" **mode="PARENT_LAST"**/>
 </classloader>
  </deployedObject>
</appdeployment:Deployment>

comments powered by Disqus