New or updated for this feature pack


Using Bean Validation with JPA

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

  1. Obtain a compliant Bean Validation API and implementation JAR files, for example, obtain these artifacts from Hibernate.
  2. 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.
  3. 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.
  4. Refresh the WebSphere Application Server OSGI cache using the following command:
    $WAS_USR_HOME/bin/osgiCfgInit.[bat|sh] -all



In this information ...


IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic    

Terms of Use | Feedback

Last updated: Oct 22, 2010 3:02:28 AM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=v700osgijpa&product=was-nd-mp&topic=tejb_jpabeanval
File name: tejb_jpabeanval.html