In previous releases, it was always possible to start/stop an OC4J instance, but it wasn't possible to start/stop the individual applications that are deployed to an OC4J instance.
The application start/stop operations are exposed in multiple places.
- Within Application Server Control
This is relatively straight forward, so I'll leave it to you to play with. - Within admin_client.jar
Stop operation:>java -jar admin_client.jar
deployer:oc4j:localhost oc4jadmin [password] -stop myApp
Notification ==>Stopping manageable object:
oc4j:j2eeType=J2EEApplication,name=myAppJ2EEServer=standalone
Notification ==>Stop completed for state manageable object:
oc4j:j2eeType=J2EEApplication,name=myApp,J2EEServer=standalone
The new state of the application is written in the server.xml file:<application name="myApp" path="../applications/myApp.ear"
parent="default" start="false" />
Start operation:>java -jar admin_client.jar
deployer:oc4j:localhost oc4jadmin [password] -start myApp
Notification ==>Starting manageable object:
oc4j:j2eeType=J2EEApplication,name=myAppJ2EEServer=standalone
Notification ==>Start completed for state manageable object:
oc4j:j2eeType=J2EEApplication,name=myApp,J2EEServer=standalone
<application name="myApp" path="../applications/myApp.ear"
parent="default" start="true" /> - Using the Oracle Ant tasks <oracle:stop> and <oracle:start>
Stop operation:<target name="stopapp">
<echo message="-----> Stopping application" />
<oracle:stop
deployerUri="deployer:oc4j:localhost"
userid="oc4jadmin" password="welcome1"
deploymentName="myApp"
/>
</target>
Buildfile: build.xml
stopapp:
[echo] -----> Stopping application
[oracle:stop] Stopping application testpermgen.
[oracle:stop] 06/11/14 15:42:45 Notification ==>
Stop completed for state manageable object:
oc4j:j2eeType=J2EEApplication,name=myApp,J2EEServer=standalone
And the same pattern for the start operation.<target name="startapp">
<echo message="-----> Starting application" />
<oracle:start
deployerUri="deployer:oc4j:localhost"
userid="oc4jadmin" password="welcome1"
deploymentName="myApp"
/>
</target>
Buildfile: build.xml
startapp:
[echo] -----> startping application
[oracle:start] Starting application myApp.
[oracle:start] 06/11/14 15:47:48 Notification ==>
Starting manageable object:
oc4j:j2eeType=J2EEApplication,name=myApp,J2EEServer=standalone
[oracle:start] 06/11/14 15:47:48 Notification ==>
Start completed for state manageable object:
oc4j:j2eeType=J2EEApplication,name=myApp,J2EEServer=standalone
[oracle:start] Application myApp started.
No comments:
Post a Comment