IN
WEBLOGIC14C
This part of the
document provides the required details for deploying the Sample WAR product in
Weblogic Appliation server.
We use WebLogic
Application Server to deploy all our Java based applications. Most of our
applications are web based and hence we have most of our code written in Java
language and all server side code gets build and deployed on weblogic server
across our organization for all internal and external applications.
Software
Classification |
Software |
Application Server |
Weblogic 14c with
Managed Server on Linux OS. |
Database |
Oracle 19C –
19.0.0.0.0 |
JAVA |
JDK 11 |
Browser |
IE11,Opera,Google Chrome. |
•
Weblogic 14c installation to be installed.
•
Managed Server for to be
created
•
JDK 11 version to be present in Linux Box
•
Sample WAR schema to be present in Oracle Database
•
Winscp.exe and Putty.exe to be present in Windows to Transfer the
files from Windows to Linux Server and login to linux server respectively.
5. Verifications of Weblogic12c and
Managed Server
- Login to putty using linux Server Ip credentials. (refer the
below sample screen shot)
Login
to the Application Server and execute the ‘ls’ command in server HOME
Directory. This will display the mydomain folder. (Refer the below screen shot)
Navigate
the mydomain folder and check whether the Managed server is created e.g.,
Sample WARServer in the screen shot.
6. JDK 11 - To check the JDK
installation in the Server
•
Login to Linux server using putty and verify whether JDK11 is
installed
•
Execute the command ‘Java -version’ in the Home Directory (refer
the below sample screen shot)
7. Configuring a JDBC Data
Source and Deploying an Application
To deploy Sample WARapplication, login to the
administration console,
Open a web browser and enter the URL: http://hostname:port/console.
For example, in this Document , it is http://<ip_address>:7001/console.
If URL
is not opening, it means Admin Server is not running and it has to be started
as given in the section 7.1
7.1 Starting of Weblogic Administration Server
7.1.1. Open a Terminal window and
navigate to the domain directory. In this document, the domain directory is /scratch/u01/app/fmw/user_projects/domains/mydomain.
In the domain directory, enter the following command:
7.1.2. $ ./startWebLogic.sh
7.1.3. At the prompt, enter the administrator username
and password that you entered when you created the domain. In this Document ,
the username is weblogic and the password is <xxx>
Note : The password is not displayed. The Console URL should
open on successful start.
7.1.4. Check whether Managed server created for is in RUNNING state. This can be done by
logging in to console,and Clicking the Environment- >Servers. This will take
to the page Summary of Servers in which
Managed Server can be found and the state should be RUNNING. If not, the
Managed Server has to be started as given in the section 7.2
7.2 Starting of Weblogic
Managed Server
7.2.1. Open a Terminal window and navigate to the bin directory under your domain directory. In this document , the
domain directory is
/scratch/u01/app/fmw/user_projects/domains/mydomain.
7.2.2. In
the bin directory, enter the following command: startManagedWebLogic.sh. This
command takes two arguments:
•
The name of the managed server you want to start
•
The URL of the administration server
In this document , those arguments are:
server1 and http://<ip_address>:7001$ cd /scratch/u01/app/fmw/user_projects/domains/mydomain/bin
$ ./startManagedWebLogic server1 http://<ip_address> :7001
Note:
Replace <ip_address> with the host name or IP address of your
administration server.
nohup
./startManagedWebLogic.sh Sample WARServer http://<ip_address>:10001 > Sample WAR.log &
7.2.3. At the
prompt, enter the administrator username and password.
Note:
The password is not displayed.
7.3
Configuring a JDBC Data Source
7.3.1. In the
administration console under Domain Structure, expand Services (by clicking the
+ next to it). Then click Data Sources.
7.3.2 On the right, notice that the Summary of JDBC Data Sources
section apps.
Under the Data Sources
table heading, click the New drop-down list. Then select Generic Data Source.
7.3.3 On the first page of the Create a New JDBC Data Source wizard, enter the Name of the data source as Sample WARServer.
Enter the JNDI Name of
the data source as java/OracleDS.
Note: There is no
requirement that the data source name and the JNDI name match. The JNDI name is
the one to make note of, because it is used by JDBC clients to access the data
source.
Use the Database Type drop-down list to select Oracle.
Then click Next.
7.3.5. On the next page of the wizard, keep all the default Transaction Options, and click Next.
7.3.6. On the next page of the
wizard, enter the Database Name. In this Document it is EPIC. Your database
name may be diffrerent.
Enter the Host Name/Ip
address of the Database Server. In this Document it is 10.10.5.50.
Leave the database Port
at the default of 1521. (Unless it is different for your database.)
Enter the Database User
Name of Sample WAR. This is the user that was created by the SQL script.
Enter the database
user's password twice, in the Password and Confirm Password fields. The
password is Sample WAR.
Then click Next
7.3.7. On the
next page of the wizard, click the Test Configuration button to check if a
connection to the Database can be made, based upon the information entered.
7.3.8. If the message
"Connection test succeeded" is displayed, click Next.
If the connection test fails, use the Back button to review the entries made for the data source and correct any errors. If there are no errors in the entries and the test still fails, make sure your
database is running.
7.3.9. On the last page of the wizard, the data source is targeted. Targeting a data source to a server means that the server will manage that data source and it will be available as one of the resources of that server.
Select the check box
next to Sample WARServer.
Then click Finish.
7.3.10. In the Summary of JDBC Data Sources area, in the Data Sources table, the new data source, Sample WARServer, is listed.
To modify the configuration of the new data source, click its
name, Sample WARServer, in the table.
7.3.11. Under the Settings for Sample WARServer, click the Connection Pool
tab under the Configuration tab.
7.3.12. Scroll down to find the "capacity" fields.
For Initial Capacity
enter 2.
For Maximum Capacity enter 10.
For Minimum Capacity
enter 2.
Then click Save.
The message "Settings
updated successfully" is displayed.
Similarly
create the Required datasources with specified JNDI name ex :
SampleOracleDS Generic java/SampleOracleDS Sample WARServer
7.4 Deploying
Sample WARApplication
7.4.1. Application WAR to be
copied in Domain folder of Weblogic in Linux from local windows folder through
winscp by entering the Server Ip and browing the Source and target path
(/mydomain/WAR/).
Drag The Application from
Left Side (Windows folder) to right side (Linux Deployment folder)
7.4.2. Login to admin
console(as described in section 7.0) Under
Domain Structure, click Deployments.
7.4.3. On the right, above the Deployments table, click Install.
7.4.4. Locate
the downloaded archive file. To the right of Current Location, click the links to browse to the
location where you placed the downloaded WAR. file. In this Document , the file
is in the /usr1/SIR21371/Oracle/Middleware/Oracle_Home/Sample WAR_WAR directory.
7.4.5. Select the WAR. option
that is displayed after you click the link and locate the WAR. file. The
console fills in the Path field for you. Alternatively, you can manually enter
the path and the file name in the Path field.
Click Next.
7.4.6. On the
next screen, ensure that Install this deployment as an application is selected,
and then click Next.
7.4.7. On the
targets screen, select Sample WARServer, and then click Next.
7.4.8. On the
next screen, keep all the default values and click Next.
7.4.9. On the
review screen, select No, I will review the configuration later, and then click
Finish.
7.4.10. Messages
indicate that the deployment was installed, but changes must be activated. The
WAR application is listed in the Deployments table.
7.4.11. Under
Summary of Deployments, select Control tab.
7.4.12. In the
Deployments table, select the check box to the left of the WAR application, and
then select Servicing all requests in the Start list.
7.4.13. A message
indicates that a start request was sent. Momentarily, the state of the WAR
application becomes "Active." This means that the application is
available to those who have access to the server.
8. Testing the Deployed Application
To test the newly deployed web application, perform the following
steps:
8.1. In
another web browser window or tab, enter the host and port for the Sample
WARServer managed
server, followed by /WAR.
8.2. In this
Document , the URL is http://<ip_address>:10002/WAR/login.faces.
Note: Replace <ip_address> with the host
name or IP address of the Sample WARServer machine.
9. Instructions to start / stop the app server
9.1.1 Starting the Weblogic12c Admin Server and Managed server :
Open a Putty Terminal window and enter the Server
IP,username, Pwd details and navigate to the domain directory. In this Document
, the domain directory is Ex : /usr1/Sample WAR/mydomain/
Change the directory to bin folder
In the domain directory, enter the following
command as given in the screen shot to start the Admin server.
At the prompt, enter the administrator username and password
that you entered when you created the domain.
In
thisDocument, the username is weblogic and the
password is welcome1.
Note:
The password is not displayed.
To start Sample
WARServer Managed server, navigate to the bin
directory under your domain directory. In this Document, the domain directory
is /usr1/Sample
WAR/mydomain/bin
In the bin directory,
enter the following command: startManagedWebLogic.sh. This command takes two
arguments:
•
The name of the managed server you want to start
•
The URL of the administration server
In this Document, those
arguments are:
•
Sample WARServer
http://<ip_address>:10001
[Sample WAR@ctrlsdemoapp61
bin]$ nohup ./startManagedWebLogic.sh Sample WARServer http://<ip_address>:10001
> Sample WARC.log &
Note: 1. Replace <ip_address> with the host
name or IP address of your administration server.
2. Application log file is redirected to Sample
WAR.log in the above command.
3. To view the log file, give command tail -100f
Sample WAR.log from mydomain bin
directory.
9.1.2 Stoppint the Weblogic 14c Managed
Server
Open a Putty Terminal window and enter the Server
IP,username, Pwd details and navigate to the domain directory. In this Document
, the domain directory is Ex : /usr1/Sample WAR/mydomain/
Go to your Domain bin Directory and execute the following command
to stop the Managed server. in this document Managed server name Sample
WARServer.
To stop Admin Server in Weblogic 14c, go to Domain bin
Directory and execute the following command.
To Cl the log files, go to domain directory and change
directory to Managed server directory under
Servers
directory, for example, /usr1/Sample WAR/mydomain/Servers/Sample WARServer
Give ls command to list the directories and remove the directories
show in the screen shot
***End of Document***