Using ant to deploy to OC4J
I found the following usefull information in the OTN forums. You can use this example to deploy a war archive to a remote OC4J server in an Ant build file. I noticed that oc4j_remote_deploy.jar is not part of the jdeveloper 9.0.3 installation i have here, and it’s also not part of the standalone oc4j installation i’m using.
<java jar="${jdev.dir}/jdev/lib/oc4j_remote_deploy.jar" fork="yes">
<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient" />
<arg value="http://remote_server:1810/Oc4jDcmServletAPI/" />
<arg value="username" />
<arg value="password" />
<arg value="redeploy" />
<arg value="E:ora9ias" />
<arg value="${build.dir}/${name}.ear" />
<arg value="${name}" />
<arg value="OC4J_PORTAL" />
</java>
11 Mar 2004 |
March 11th, 2004 at 2:25 pm
Hi,
I use the standalone OC4J 9.0.3 installation and my ant task executes a variant of the command-line options you pass to admin.jar to deploy/undeploy/restart (the ”-restart” switch to restart the application alone, not the whole container):
<java classname=”com.evermind.client.orion.OrionConsoleAdmin”
classpathref=”deployment.classpath”>
<arg value=”ormi_deployment_server_url” />
<arg value=”deployment_username” />
<arg value=”deployment_password” />
<arg value=”-deploy” />
<arg value=”-file” />
<arg value=”application_ear_name” />
<arg value=”-deploymentName” />
<arg value=”application_name” />
</java>
Where “deployment.classpath” includes oc4j.jar (which contains the class referenced in the classname attribute) (I also include the other J2EE jars: j2ee.jar broken up as ejb.jar etc etc, just so that exception traces work at my end if the command fails). The “ormi_deployment_server_url” would be ormi://<name_of_machine_running_the container>:<port_if_not_23791>/. The “deployment_username” and “deployment_password” would usually be ‘admin’ and the associated password you set up when you installed the container. Hope this helps.
March 11th, 2004 at 2:46 pm
I am using the same statements when testing on a local oc4j server, but it doesn’t work when you want to deploy to a remote oc4j/9ias server.
August 10th, 2004 at 3:27 pm
Hello, what does the refer to?
Also, is the argument specify the application name as you would enter when you deploy using OEM?
Thanks!!
August 10th, 2004 at 3:29 pm
It does not look like the post took the copy and pasted arguments
${name} – Application Name?
E:ora9ias – what is this referring to?
August 26th, 2004 at 2:58 pm
Olaf has a better explanation on his blog: http://www.orablogs.com/olaf/archives/000363.html. As you can see E:ora9ias should have been e:ora9as, which is the remote ias home. And ${name} is the application name.
August 26th, 2004 at 2:59 pm
Ok, backslashes aren’t displayed, there should be one between the e: and ora9ias.
November 23rd, 2005 at 9:39 am
Hi
I used ant to make an ear of my app
then i used above proccedures to deploy it
but encountered the error
[java] Error: Missing ormi://:
[java] Java Result: 1
any help in this regard would be much appreciated
thanx