Installing the following products in these locations has been tested with this tutorial:
- JDK 1.8 version 60 - /u01/jdk1.8.0_60
- WebLogic Server 12.2.1 - /u01/wls1221
While other versions of these products may function for this tutorial, they have not been tested.
Starting the WebLogic Domain
- Open a secure shell terminal session to the Linux development machine and login as the oracle user.
- Change to the jrf_restricted_domain directory:
[oracle@ol71 ~]$ cd /u01/wls1221/user_projects/domains/jrf_restricted_domain
[oracle@ol71 ~]$ ./startWebLogich.sh
After starting the WebLogic Server, it enters the RUNNING state:
.
Creating the Derby Database
- Open a secure shell terminal session to the Linux development machine and login as the oracle user.
- Change to the medrec database migration directory:
[oracle@ol71 ~]$ cd /u01/wls1221/wlserver/samples/server/medrec/database-migration
[oracle@ol71 ~]$ vi ../project.properties
# --------------- infrastructure info ----------------- database = derby db = derby
# --------------- infrastructure info ----------------- database = derby db = derby
:wq
[oracle@ol71 database-migration]$ . ../../setExamplesEnv.sh
The script outputs that the environment has been set:
Your environment has been set.
[oracle@ol71 database-migration]$
[oracle@ol71 database-migration]$ ant data.import
The script outputs that the build is successful:
data.importer.run: [java] [EL Info]: server: 2015-07-30 14:43:23.222--Detected server platform: org.eclipse.persistence.platform.server.NoServerPlatform. [java] [EL Info]: server: 2015-07-30 14:43:23.299--ServerSession(1007880005)--Detected server platform: org.eclipse.persistence.platform.server.NoServerPlatform. [java] Jul 30, 2015 2:43:23 PM org.hibernate.validator.internal.util.Version [java] INFO: HV000001: Hibernate Validator 5.1.3.Final [java] All the data has been imported successfully! BUILD SUCCESSFUL Total time: 5 seconds
[oracle@ol71 database-migration]$
Creating the Derby Data Source
- Open a browser.
- In the browser navigate to http://localhost:7001/console.
- Open a terminal shell where the files are downloaded and where you want to install; in this exercise, /u01 is the location.
- Enter the Username and Password for this domain - this tutorial uses weblogic for the Username and welcome1 for the Password. Click Login.
- In the Domain Structure pane, click Services and Data Sources. The Summary of JDBC Data Sources displays.
- In the Summary of JDBC Data Sources, select Generic Data Source from the New drop down menu.
- Enter MedRecGlobalDataSourceXA for Name, jdbc/MedRecGlobalDataSourceXA for JNDI Name, select Derby from the Database Type drop down menu and click Next.
- From the Database Driver drop down menu, select Derby's Driver (Type 4 XA) Versions:Any and click Next.
- Click Next.
- Enter medrec for Database Name, localhost for Host Name, 1527 for Port, medrec for Database User Name, medrec for Password, medrec for Confirm Password, and click Next.
- Click the Test Configuration button.
- The connection test succeeds. Click Next.
- In Select Targets page, click AdminServer and click Finish.The domain changes activate.
Deploying the MedRec Sample Application
- In the Domain Structure pane, click Deployments.
- In the Summary of Deployments pane, click Install.
- Navigate to the path that contains the medrec.ear file; this tutorial uses /u01/wls1221/wlserver/samples/server/medrec/dist/standalone/medrec.ear. Select the medrec.ear file and click Next.
- Select Install this deployment as an application and click Next.
- Enter medrec for Name and click Next.
- Click Finish.The deployment completes.
Testing the MedRec Sample Application
- In the browser, navigate to the MedRec application URL, http://localhost:7001/medrec and click Getting Started!
- In the Patient section of the page, click Login.
- Enter fred@golf.com for Email, weblogic for Password, and click Sign In.
- In the View Record Summary section of the page, click Go.
- The records for the current patient displays. Click Logout.
- Click Logout. The deployed MedRec sample application test is successful.
Summary
In this tutorial, you learned to:
- Create a Derby database for the MedRec Sample Application
- Create and Configure a JDBC Data Source for the MedRec Sample Application
- Deploy and Test the MedRec Sample Application
Resources
- WebLogic Server 12.2.1 Documentation
- To learn more about WebLogic Server refer to additional OBEs in the Oracle Learning Library
Credits
- Lead Curriculum Developer: Tom Eliason
- Other Contributors: TJ Palazzolo