Using admin_client.jar to deploy an application to oc4j
Posted by Steve Racanovic | Posted in OAS , OC4J | Posted on 1:29 PM
0
An example of deploying an application to a single OC4J instance through the command line.
You can deploy an application using the admin_client.jar from the command line. Either locally or remotely. If you want to deploy from remotely, you will first need to download the Administration Client. Ensure you download the same client version as your OAS version.
10.1.3.0
http://download.oracle.com/otn/java/oc4j/1013/oc4j_admin_client_101300.zip
10.1.3.1
http://download.oracle.com/otn/java/oc4j/101310/oc4j_admin_client_101310.zip
10.1.3.2
http://download.oracle.com/otn/java/oc4j/101320/oc4j_admin_client_101320.zip
10.1.3.3 & 10.1.3.4
http://www.oracle.com/technology/software/products/ias/htdocs/utilsoft.html
In this example I will only deploy locally. Further details can be found here:
http://download-west.oracle.com/docs/cd/B32110_01/web.1013/b28951/adminclient.htm#BABFHIEB
1. Check the instance I want to deploy to is up and running.
[sracanov@sracanov-au D]$ opmnctl status
Processes in Instance: web.sracanov-au.au.oracle.com
---------------------------------+--------------------+---------+---------
ias-component | process-type | pid | status
---------------------------------+--------------------+---------+---------
OC4JGroup:default_group | OC4J:OC4J_Apps2 | 4296 | Alive
OC4JGroup:default_group | OC4J:home | 2308 | Alive
HTTP_Server | HTTP_Server | 2732 | Alive
ASG | ASG | N/A | Down
2. Find the opmn port.
[sracanov@sracanov-au D]$ opmnctl status -port
sracanov-au:6007
3. Go to the $OH/j2ee/home folder where admin_client.jar sits.
[sracanov@sracanov-au D]$ cd %ORACLE_HOME%\j2ee\home
[sracanov@sracanov-au D]$ pwd
D:\Oracle\product\10.1.3.2.0\OracleAS_1\j2ee\home
[sracanov@sracanov-au D]$ dir | grep admin_
11/01/2007 06:53 PM 733 admin_client.jar
4. Deploy the application to oc4j instance. In my example OC4J_Apps2. The command line should looks something like:
java -jar admin_client.jar deployer:oc4j:opmn://
[sracanov@sracanov-au D]$ echo %JAVA_HOME%
D:\Oracle\product\10.1.3.2.0\OracleAS_1\jdk
[sracanov@sracanov-au D]$ java -version
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)
[sracanov@sracanov-au D]$ java -jar admin_client.jar deployer:oc4j:opmn://localhost:6007/OC4J_Apps2
oc4jadmin welcome1 -deploy -file C:\drvtest.ear -deploymentName drvtest -bindAllWebApps
09/05/13 13:23:14 Notification ==>Application Deployer for drvtest STARTS.
09/05/13 13:23:14 Notification ==>Copy the archive to D:\Oracle\product\10.1.3.2.0
\OracleAS_1\j2ee\OC4J_Apps2\applications\drvtest.ear
09/05/13 13:23:14 Notification ==>Initialize D:\Oracle\product\10.1.3.2.0\OracleAS_1
\j2ee\OC4J_Apps2\applications\drvtest.ear begins...
09/05/13 13:23:14 Notification ==>Unpacking drvtest.ear
09/05/13 13:23:14 Notification ==>Done unpacking drvtest.ear
09/05/13 13:23:14 Notification ==>Unpacking drvtest.war
09/05/13 13:23:14 Notification ==>Done unpacking drvtest.war
09/05/13 13:23:14 Notification ==>Initialize D:\Oracle\product\10.1.3.2.0\OracleAS_1
\j2ee\OC4J_Apps2\applications\drvtest.ear ends...
09/05/13 13:23:14 Notification ==>Starting application : drvtest
09/05/13 13:23:14 Notification ==>Initializing ClassLoader(s)
09/05/13 13:23:14 Notification ==>Initializing EJB container
09/05/13 13:23:14 Notification ==>Loading connector(s)
09/05/13 13:23:14 Notification ==>Starting up resource adapters
09/05/13 13:23:14 Notification ==>Initializing EJB sessions
09/05/13 13:23:14 Notification ==>Committing ClassLoader(s)
09/05/13 13:23:14 Notification ==>Initialize drvtest begins...
09/05/13 13:23:14 Notification ==>Initialize drvtest ends...
09/05/13 13:23:14 Notification ==>Started application : drvtest
09/05/13 13:23:14 Notification ==>Binding web application(s) to site default-web-site begins...
09/05/13 13:23:14 Notification ==>Binding drvtest web-module for application drvtest
to site default-web-site under context root drvtest
09/05/13 13:23:17 Notification ==>Initializing Servlet:
org.apache.struts.action.ActionServlet for web application drvtest
09/05/13 13:23:17 Notification ==>Binding web application(s) to site
default-web-site ends...
09/05/13 13:23:17 Notification ==>Application Deployer for drvtest COMPLETES.
Operation time: 3328 msecs
5. Check the application is deployed and running:
[sracanov@sracanov-au D]$ opmnctl status -app
Applications in Instance: web.sracanov-au.au.oracle.com
application type: OC4J
-----+-----------+---------+---------+----------------+----------+--------
pid | name | state | rtid | classification | routable | parent
-----+-----------+---------+---------+----------------+----------+--------
4296 | drvtest | started | g_rt_id | external | true | default
4296 | system | started | g_rt_id | external | true |
4296 | default | started | g_rt_id | external | true | system
4296 | jamagent | started | g_rt_id | external | true | default
4296 | ascontrol | stopped | g_rt_id | external | false |
4296 | datatags | started | g_rt_id | internal | true | default
4296 | javasso | stopped | g_rt_id | internal | true |
2308 | system | started | g_rt_id | external | true |
2308 | default | started | g_rt_id | external | true | system
2308 | ascontrol | started | g_rt_id | external | true | system
2308 | datatags | started | g_rt_id | internal | true | default
2308 | javasso | stopped | g_rt_id | internal | true |