Friday, June 25, 2021

Weblogic 14c sample WAR installation



INSTALLATION OF SAMPLE WAR

IN

WEBLOGIC14C


1. Introduction

This part of the document provides the required details for deploying the Sample WAR product in Weblogic Appliation server.


2. Scope

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.


3. Software Environment

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.

 

 

4. Prerequisites

   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.


7.3.4. On the second page of the wizard, use the Database Driver drop-down list to select


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 :

Name Type JNDI Name Targets

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***

Sample WAR file Deployment in Jboss







INSTALLATION of SAMPLE WAR

in

JBOSS EAP 7.1.1 in STANDALONE











Index





1.Introduction


This part of the document provides the required configuration / installation details for deploying Sample in JBOSS 7.1 environment.



2.Software Environment


Below mentioned Software Environment is required for the deployment of Sample WAR in JBOSS 7.1


Software Classification

Software version

App. Server

JBOSS 7.1 on Linux OS.

Database

Oracle 19C – 19.0.0.0.0

JAVA

JDK 1.8.0


3.Prerequisites

  • Jboss 7.1.x version to be installed. For Jboss 7.1, Jboss home directory should be present in the linux Box

    • Example : /usr1/SIR12345/jboss-eap-7.1

  • JDK 1.8 version to be present in Linux Box

  • Sample Core 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.








4.Verifications of JBOSS, JDK installation and Policy files Update.

Jboss 7.1 - To check whether Jboss 7.1 is installed in linux 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 JBOSS folder names with version no. (Refer the below screen shot)


JDK 1.8 - To check the JDK installation in the Server,

  • Login to Linux server using putty and verify whether JDK1.8 is installed

  • Execute the command ‘Java -version’ in the Home Directory (refer the below sample screen shot)



5.JAVA_HOME, PATH setting Change

To change the Java path in start.sh file available in bin directory under jboss 7.1

Set the JAVA_HOME and PATH in the start.sh file based on the current JAVA path (Refer the content of the start.sh shown below)







6.Copy WAR into Linux using winscp

Application WAR to be copied in deployment folder of Jboss 7.1 in Linux from local windows folder through winscp

Enter the Server Ip, username and password of the target path (/jboss-eap-7.1/standalone/deployments) as given below.


Drag the Application WAR from Left Side (Windows folder) to right side (Linux Deployment folder)












7.Copy ojdbc6.jar from oracle server to JBOSS_HOME deployment folder

Copy ojdbc6.jar / ojdbc8.jar from oracle server(\app\oracle\product\19.0\dbhome_1\jdbc\lib) to JBOSS_HOME deployment folder

Verify the availability of the same (refer the screen shot shown below)








8.Datasource Configuration in Standalone.xml

8.a) Login to linux server using putty and go to the folder /usr1/root/jboss-eap-7.1/standalone/configuration

8.b) Add Non-XA datasource named SampleDS1 with Jndi name java:/java/SampleDS1 for Sample- Core application in standalone.xml file.

8.c) Add Non-XA datasource named SampleDS2 with Jndi name java:/java/EODOracleDS for Sample- Core application in standalone.xml file.






2.Change the database name, IP Address and Schema name in the standalone.xml file (see the content of standalone.xml file shown below)




3. Add Business object lookup name related to application inside binding tags in standalone.xml file.

Note : Get the list of Business object lookup's from respective application team.

Ex :

<subsystem xmlns="urn:jboss:domain:naming:2.0">

<bindings>

<lookup name="java:/ejb/mutilspBO" lookup="java:global/Panacea/PanaceaEJB/mutilspBO!panacea.UTIL.interfaces.mutilspHome"/>

</bindings>

<remote-naming/>



9. Starting the Jboss 7.1 Server


  • To start the Jboss Server go to directory $JBOSS_HOME/bin (refer the content of the start.sh file shown below)

  • Execute the start.sh to start the JBOSS Server

  • Application log file will be re-directed in statdalone.out and Error file redirected into standalone.err respectively.


To view the logfile go to $JBOSS_HOME/bin and give the following command

[SIR18334@APCL28 bin]$ tail -100f statdalone.out









Sample log shown below


10.Sample Application Landing Page

Sample Landing Page URL Consists of combination of http String, IP Address of the Linux Server, Application Port number and web root path.

Example, http://<Ip Address>:<http port>/Sample.login To check the Application Landing URL port SWARch for Socket binding TAG Port Defined in Standalone.xml file.

<socket-binding name="http" port="20141"/>

Open Internet Explorer browser and type the URL



11.Stopping the Jboss 7.1 Server

Execute the stop.sh to stop the JBOSS Server
















*** End of document ***


In Oracle How to shrink Securefile LOB tables

As per Oracle support, if the table uses securefile LOB the traditional shrink method ALTER TABLE MODIFY LOB (XMLRECORD) (SHRINK SPACE) will...