views:

309

answers:

2

Hi. I would like to deploy web application on a remote OC4J server using Eclipse. Is it possible? I'm using WTP and when adding the OC4J server there is only localhost available.

A: 

One way to deploy from Eclipse is creating an Ant build to do it, calling admin_client.jar option to deploy.

JuanZe
+1  A: 

Here's an ant task to deploy to OC4J. Just define the variables in build.properties and execute this from Eclipse. You can also execute it from command line. This will work on a standalone oc4j and with some modifications on the Application Server.

<target name="deploy"
     description="deploy enterprise archive">
     <java classname="${oc4j_home}/j2ee/home/admin_client.jar>
      <jvmarg value="-jar"/>
      <arg value="deployer:oc4j:opmn://${oc4j_host}:${oc4j_rmiport}/${oc4j_name}"/>
      <arg value="${oc4j_admin}"/>
      <arg value="${oc4j_admin_password}"/>
      <arg value="-deploy"/>
      <arg value="-file"/>
      <arg value="${application.ear}"/>
      <arg value="-deploymentName"/>
      <arg value="${application_name}"/>
     </java>
     <!-- bind the web app -->
     <java classname="${oc4j_home}/j2ee/home/admin_client.jar">
      <jvmarg value="-jar"/>
      <arg value="deployer:oc4j:opmn://${oc4j_host}:${oc4j_rmiport}/${oc4j_name}"/>
      <arg value="${oc4j_admin}"/>
      <arg value="${oc4j_admin_password}"/>
      <arg value="-bindWebApp"/>
      <arg value="-appName"/>
      <arg value="${application_name}"/>
      <arg value="-webModuleName"/>
      <arg value="${webmodule_name}"/>
     </java>
</target>