• No results found

DEPLOYMENT PROCESS FOR DIFFERENT WEB / APP SERVERS 1 TOMCAT:

In document Java Book Latest (Page 83-88)

// exception handler code here

DEPLOYMENT PROCESS FOR DIFFERENT WEB / APP SERVERS 1 TOMCAT:

1. set JAVA_HOME=C:\jdk1.x.xx in AutoExec.bat or Environment Variables. 2. c:\tomcat 5.x.x /bin> Startup / Catalina start

3. deploy java class files in c:\tomcat\webapps\user defined folder\classes

4. TOMCAT --> WEB-APPS --> USER-DEFINED-FOLDER --> WEB-INF --> CLASSES 5. Change Port no in Tomcat --> tomcat/server/conf.xml --> change port no. 6. Change user details --> tomcat-users.xml <role ---/>

7. http://localhost/user-defined folder/ filename(servlet / filename.jsp). 8. c:/tomcat 5.x.x/bin/shutdown.

Java Session is stored in the Container

On Executing more than 1 tomcat with same port-no will result in binding exception at a time. On executing more than 1 tomcat with different port-no works fine at a time.A tomcat version 4.x support servlet 2.3 & JSP 1.2 whereas Tomcat 5.x support servlet 2.4 & jsp 2.0

2. JRUN EXECUTION PROCESS 1. C:\jrun\bin> jrun commands inJRUN 2. Enter into a screen -start -nohup

3. --> Enter Admin Login & PWD -stop -config 4. --> Enter Home page -restart -version 5. --> Add JRUN Server -status -build

6. --> [top menu] create –new server name -Info 7. --> give servername & port no.

8. (note for each project Port no is different) 9. For New Server

10. --> c:\jrun\server \ create new server 11. --> Enter project name

12. --> default ear \ server-INF

13. --> default EJB default-War \ META-INF 14. --> paste all files & moify the property files.

15. ECLI PSE I DE --> load the project with ANT as Build.xml 16. Java Project --> Existing ANT File (Build.xml).

17. Type Project Name --> select build.xml --> finish. 3. Weblogic Deployment Process

The following documentation assumes that a WebLogic 8.1 server has been installed and you have built the application specific archive for deployment on weblogic 8.1

If you do not want internationalization support then skip first two steps.

1. Following changes are required to support internationalization in application using Maker-Checker functionality. Place "weblogic.xml" file in "\Web-inf" folder with application home folder set in packager tool with following content:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'> <web-app id="WebApp_ID"> <charset-params> <input-charset> <resource-path>/*</resource-path> <java-charset-name>UTF-8</java-charset-name> </input-charset> </charset-params> </web-app>

Note: If you already‏have‏weblogic.xml‏in‏―\Web-inf‖‏folder,‏then‏copy‏the‏tags-values of <charset- params>.

2. Re-Build J2EE archive to build your application deployable using packager tool.

3. From web-logic directory, open startWebLogic.cmd(NT) or startWebLogic.sh(UNIX) in a text editor. Ensure that the respective database specific driver jars are in class-path as listed below and should be in class-path before the weblogic specific jars:

ORACLE Specific Classes14.jar

DB2 Specific db2jcc.jar,

db2jcc_license_cisuz.jar, db2jcc_license_cu.jar 4. Start the WebLogic server.

5. Start the WebLogic console. (http://<ip>:<port>/console) 6. The‏first‏activity‏is‏to‏create‏a‏―Connection‏Pool‖.

i) From the menu in the left-hand side pane, navigate to ―<domainname>ServicesJDBCConnectionPool‖ ii) Click‏―Configure‏a‏new‏JDBC‏Connection‏Pool‖

iii) Choose the relevant database type in the Database Type drop down box. (for MLSAMPLEAPP application,‏value‏should‏be‏―ORACLE‖)

iv) Select the relevant database driver from the list of Database Drivers and‏click‏on‏―Continue‖.‏ (For‏Class‏4‏driver‏based‏application,‏value‏should‏be‏Oracle‘s‏Driver‏(Thin)‏

Versions:8.1.7,9.0.1,9.0.2).

For‏DB2‏Select‏IBM‘s‏DB2‏Drivers(Type‏2)‏version‏7.x.8.x v) Fill in the following in the window that is shown.

Name <ConnectionPoolName> Database Name <Name of your database> Host Name <Database Host / Machine Name>

Port <Database Port> (Default value is 1521) this step is not required for DB2

Database User Name

and Password < Database User Name and Password> vi) Click Continue to create the Connection Pool.

vii) For DB2, provide the following information

Driver‏ClassName‏:‏―com.ibm.db2.jcc.DB2Driver‖

URL :‏―jdbc:db2://<ip‏address>:50000/<schema‏name>‖ Note: DB2 default port is 50000.

viii) Click‏the‏―Test‏Driver‏Configuration‖‏(if‏you‏want‏to‏test‏the‏connection)‏or‏click‏―Skip‏this‏ test‖‏button‏and‏then‏click‏on‏―Create‏and‏deploy‖‏button.

ix) Click on newly created pool name. Click on connections tab. Change the initial capacity to 2. x) Navigate‏to‏―Monitoring‖

xi) Check whether the just created pool is mentioned in this list. If it is present, it means that the connection pool has been created properly. If it is not present, then there has been some error creating the pool. Check whether all the above instructions have been followed. Check WebLogic console and WebLogic logs for error.

7. The‏next‏activity‏is‏to‏create‏a‏―Transactional‏Data‏Source‖.

i) In‏the‏menu‏navigate‏to‏―<domainname>ServicesJDBCDataSource‖. ii) Click‏―Configure‏a‏new‏JDBC‏Data‏Source‖.

Name <TxDataSourceName>

JNDI Name <Any name> (This must match the name given in the‏―<DataSourceJNDI>―‏tag‏in‏the‏configuration‏ file required by <ApplicationName>.xml file) E.g. while deploying MLSAMPLEAP, the value of ―<DataSourceJNDI>―‏in‏MLSAMPLEAPP.xml‏is‏ ―mlPool‖.

iv) Click‏―Continue‖‏and‏select‏the‏pool‏name‏(created‏in‏step‏7)‏from‏the‏drop‏down. v) Click‏―Continue‖‏and‏verify‏that‏checkbox‏is‏checked‏against‏your‏server‏name.‏Click‏on‏

―Create‖‏to‏create‏the‏Data Source.

vi) A new Transactional Data Source has now been created.

8. The final activity is to deploy the Application component i.e. <applicationName>.ear (ear which is generated by tool and put in the distribution folder. This ear also contains the jar file for the sample entity i.e. EntityClasses.jar)

i) In‏the‏menu‏navigate‏to‏―<domainname>DeploymentApplications‖. ii) Click‏on‏―Deploy‏a‏new‏Application‖.

iii) In‏the‏resulting‏screen‏click‏on‏―upload‏your‏file(s)‖‏link‏and‏then‏―Browse‖‏and‏navigate‏to‏ the location of DIST_HOME and select EAR archive to be deployed.

iv) Now‏click‏on‏―Upload‖.

v) After uploading, one entry would appear for MLSAMPLEAPP.ear with radio button. vi) Select‏the‏radio‏button‏and‏click‏on‏―Continue‖.

vii) Confirmation page will be displayed before deploying the application.‏Click‏―Deploy‖‏button‏to‏ deploy the application.

viii) In‏the‏resultant‏page‏Status‏of‏Action‏should‏be‏seen‏as‏―Success‖‏(it‏might‏take‏some‏time‏ – so please wait or refresh the page if it is taking too much of time).

ix) Navigate‏to‏―<domainname>DeploymentApplicationsMLSAMPLEAPP MLAppCore‖‏ from the menu.

x) In‏the‏resulting‏screen,‏click‏on‏―Monitoring‖

xi) Check‏that‏―RequestSession‖‏is‏present‏in‏the‏ensuing‏list.

xii) Navigate‏to‏―<domainname>DeploymentApplicationsMLSAMPLEAPP MLAppServlets‖‏ from the menu.

xiii) In‏the‏resulting‏screen,‏click‏on‏―Monitoring Servlets‖ xiv) Check‏that‏―/Log4jLoader‖‏is‏present‏in‏the‏ensuing‏list. Websphere Application Server – WAS – Admin console Use the administrative console to configure connection pooling

1. Start the HTTP Server Administration interface. 2. Click the Manage tab.

3. Select your application server from the Server list.

4. Enable the adminconsole application if it is not already enabled. a. In the navigation menu, click Manage installed applications. b. Select the adminconsole application.

c. Click Properties.

d. For Application Enablement, select Enabled.

5. To start your application server, click the Start button ( ) at the top of navigation menu. If your application server is running, you must stop it and restart it.

6. In the navigation menu, click Launch Express Console.

7. When prompted, enter a user ID. The WebSphere administrative console is displayed in the browser window.

Note: The user ID does not need to be an OS/400 user profile. This user ID is used only to track which users make changes to the application server configuration.

You can also start the console without starting the HTTP Server Administration interface. To use this method, follow these steps:

1. Start the HTTP Server Administration interface. 2. Click the Manage tab.

3. Select your application server from the Server list.

4. Enable the adminconsole application if it is not already enabled. a. In the navigation menu, click Manage installed applications. b. Select the adminconsole application.

c. Click Properties.

d. For Application Enablement, select Enabled.

5. To start your application server, click the Start button ( ) at the top of navigation menu. If your application server is running, you must stop it and restart it.

6. Open this URL in your browser: http://your.server.name:port/admin

where your.server.name is the host name of the iSeries server on which your application server is running, and port is the WebSphere administrative console port as noted in the ready

message in the joblog of your application server. This port is also specified in the admin_host virtual host.

7. When prompted, enter a user ID. The WebSphere administrative console is displayed in the browser window.

Note: The user ID does not need to be an OS/400 user profile. This user ID is used only to track which users make changes to the application server configuration.

1. Expand Resources and click JDBC Providers.

2. Click the name of the JDBC provider that is associated with the data source for which you want to configure connection pooling.

3. Click Data Sources.

4. On the Data Sources page, click the name of the data source for which you want to configure connection pooling.

5. Click Connection Pool.

6. On the Connection Pools page, configure connection pooling settings. 7. Click Apply or OK.

8. Save the application server configuration. Use wsadmin to configure connection pooling

To configure connection pooling with wsadmin, follow these steps:

1. On the OS/400 command line, run the STRQSH (Start Qshell) command.

2. Run the cd command to change to the directory that contains the wsadmin tool: cd /QIBM/ProdData/WebASE/ASE5/bin

3. Start wsadmin.

4. At the wsadmin prompt, run this command to identify the parent ID: 5. set newds [$AdminConfig getid

6. /Cell:myCell/Node:myNode/Server:myAppSvr/ JDBCProvider:JDBC1/DataSource:DS1/]

where myCell is the name of the cell that contains your application server, myNode is the name of the node that contains your application server, myAppSvr is the name of your application server, JDBC1 is the name of your JDBC provider, and DS1 is the name of your the data source for which you want to create a connection pool.

Note: This command has been wrapped for display purposes. 7. Run this command to create a new connection pool:

$AdminConfig create ConnectionPool $newds {} 8. Run this command to save your changes:

JBOSS APP SERVER

In document Java Book Latest (Page 83-88)