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. Add the com.ibm.websphere.validation.api.jar.path Java Virtual Machine custom property to the application server JVM settings.

    The value you specify for this property is the fully-qualified path to the location of the Bean Validation API JAR file. The fully-qualified path includes the name of the JAR file.

    For example, if SomeBeanValAPI.jar is the name of the Bean Validation API JAR file you want to use, and this file is located in the E:/mydir/mybeanval/ directory, specify E:/mydir/mybeanval/SomeBeanValAPI.jar as the value of the com.ibm.websphere.validation.api.jar.path JVM custom property.

  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 Task topic    

Terms and conditions for information centers | Feedback

Last updatedLast updated: Jan 16, 2013 3:37:33 AM CST
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=v700osgijpa&product=was-nd-mp&topic=tejb_jpabeanval
File name: tejb_jpabeanval.html