Data validation is a common task that occurs in all layers
of an application, including persistence. The Feature Pack for OSGi
Applications and JPA 2.0 does not include the Bean Validation API,
therefore you need to enable Bean Validation functions in the Java™ Persistence API (JPA) application.
About this task
Because the feature pack does not ship any Bean Validation
API or implementation, the following steps need to be applied:
Procedure
- Obtain a compliant Bean Validation API and implementation
JAR files, for example, obtain these artifacts from Hibernate.
- Incorporate these JAR files into WebSphere® Application Server and make the
JAR files accessible to the application by setting the appropriate
classpath in the application server or application's manifest.
- Define a system property "com.ibm.websphere.validation.api.jar.path"
in the Application Server Java Virtual Machine. The value of this
system property is the full path name where the Bean Validation API
implementation and JAR files are located.
- Refresh the WebSphere Application
Server OSGI cache using the following command:
$WAS_USR_HOME/bin/osgiCfgInit.[bat|sh] -all