比较好的文章在这里
http://docs.oracle.com/cd/E21764_01/web.1111/e13720/using_toplink.htm#EJBAD1311
Installing Manually
The files required for supporting JPA 2.0 are included with a default WebLogic Server installation, but they are not enabled by default. The files are installed in the WL_HOME
\modules
directory. The files are:
-
The
javax.persistence_1.0.0.0_2-0-0 JAR
file contains the JPA 2.0 libraries. -
The
com.oracle.jpa2support_1.0.0.0_2-0.jar
file contains the files for enabling JPA 2.0 support in WebLogic Server.
If you do not have an active My Oracle Support account (which you need to use Smart Update) you can install the patch manually by putting the files at the start of the WebLogic classpath. For example, you can use either of the following ways:
-
Define a
PRE_CLASSPATH
environment variable before starting WebLogic Server.For example, in a Windows console window, run the following script before running
startWebLogic.cmd
:@echo off if ".%1" == "." goto TellSyntax set wls_modules=%1 set PRE_CLASSPATH=%wls_modules%\javax.persistence_1.0.0.0_2-0-0.jar; %wls_modules%\com.oracle.jpa2support_1.0.0.0_2-0.jar goto End :TellSyntax echo setJPA2SupportPatch [path-to-weblogic-modules-directory :End echo PRE_CLASSPATH=%PRE_CLASSPATH%
A similar script can be written for Linux, UNIX, or Macintosh.
-
Modify the
commEnv.cmd
orcommEnv.sh
script in theWL_HOME
/common/bin
directory, and define thePRE_CLASSPATH
at the beginning of the script.
set PRE_CLASSPATH=%MODULES_DIR%\org.eclipse.persistence_1.2.0.0_2-3.jar;%MODULES_DIR%\javax.persistence_1.1.0.0_2-0.jar
setDomainEnv.cmd
and adding
javax.persistence_1.0.0.0_2-0-0.jar
and
com.oracle.jpa2support_1.0.0.0_2-0.jar
to the
PRE_CLASSPATH
environment variable as below shown.
REM Add JARs for JPA 2.0 at the front of the class path.
set WLS_MODULES=%WL_HOME%\..\modules
set PRE_CLASSPATH=%WLS_MODULES%\javax.persistence_1.0.0.0_2-0-0.jar;%WLS_MODULES%\com.oracle.jpa2support_1.0.0.0_2-0.jar