You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Chris Russell <ch...@oracle.com> on 2008/03/11 23:58:43 UTC

Deploy to multiple oc4j instances

Hello,

I've had good success deploying my application to a single oc4j instance 
using 'mvn install'.
Now I have two instances to deploy to and I'm wondering how to do this.

Initially I tried to add another <tasks> entry in that pom file.

              <!-- this is the original task that is working - note: 
port is not listed in the URI (7777) -->
              <tasks>
                <java 
jar="/app/oracle/ias/10131/Oracle_AS1/j2ee/home/admin_client.jar" 
fork="yes">
                  <arg 
value="deployer:oc4j:opmn://wd2045.us.oracle.com/oc4j_od"/>
                  <list of args......>
                </java>
              </tasks>
              <!-- this is the new task with the port number added 
"wd2045.us.oracle.com:7778" -->
              <tasks>
                <java 
jar="/app/oracle/ias/10131/Oracle_AS1/j2ee/home/admin_client.jar" 
fork="yes">
                  <arg 
value="deployer:oc4j:opmn://wd2045.us.oracle.com*:7778*/oc4j_od"/>               

                  <list of args......>
                </java>
              </tasks>

When I try to install I get:

[java] Failed at "Could not get DeploymentManager".
[java] This is typically the result of an invalid deployer URI format 
being supplied, the target server not being in a started state or 
incorrect authentication details being supplied.

So it doesn't like my URI of 
"deployer:oc4j:opmn://wd2045.us.oracle.com*:7778*/oc4j_od".

Given that I didn't specify a port number in the first case, I'm not 
sure what this is looking for.

Thanks for the help in advance,
Chris

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Deploy to multiple oc4j instances

Posted by Stephen Connolly <st...@gmail.com>.
On Tue, Mar 11, 2008 at 10:58 PM, Chris Russell <ch...@oracle.com>
wrote:

> Hello,
>
> I've had good success deploying my application to a single oc4j instance
> using 'mvn install'.
>


Sounds like you're using a sledge-hammer to crack a peanut.

There are at least three lifecycles in maven: build, clean, and site.

The clean lifecycle has only one phase: "clean"
The reporting lifecycle has two phases: "site" and "site-deploy"
The build lifecycle has many phases: "validate", "compile", "test",
"package", "install", and "deploy" are just some of the well known ones.

When you specify a phase as a goal for the maven command, maven will invoke
all of the previous phases in the lifecycle.

The <packaging>...</packaging> section in the pom defines the default
binding of plugins to phases in the lifecycles, and you can add bindings of
other plugins to phases using the <build> and <reporting> sections of the
pom. When binding a plugin to a lifecycle phase it helps to understand what
the different phases are designed to achieve:

The "package" phase of the build lifecycle is designed to package up the
artifact that you have built.
The "install" phase of the build lifecycle is designed to install the
packaged artifact into your local maven repository cache.
The "deploy" phase of the build lifecycle is designed to deploy the packaged
artifact to it's remote maven repository.

I said that I thought you were using a sledge-hammer to crack a peanut
because what I fear you are doing is configuring the maven-install-plugin to
copy the packaged artifact to your oc4j server _instead of_ the local maven
repository cache. That would be a bad thing as now any other maven projects
that depend on your artifact will fail their builds.

I hope that what you have done is bind another plugin to the install phase
so that the artifact still ends up in the local maven repository cache. That
would be less bad.

However, what I would do would be something completely different. I would
not bind the plugin you are using to copy the packaged artifact to any phase
at all, I would just invoke that plugin directly. Then I could use profiles
to configure that plugin for each of the servers that it will be deploying
to.

For example, if I was using the antrun plugin, I would have profiles that
define the deploy locations for each of the oc4j servers that I want to
deploy to (or if that's just an url, I'd use a command line property) then I
could do

mvn install

which would package up the artifact and install it into the local repository

followed by

mvn antrun:run -PtestServer

if I was using profiles or

mvn antrun:run -Doc4jDeployUrl=.......

I could even do both in one go:

mvn install antrun:run -PtestServer

If you really want to bind the plugin to the install phase, I would do that
in the profiles using unique execution id's, that way you could just specify
all the profiles for the servers to deploy to, for example

mvn install

would just install to local repository

while

mvn install -PdevServer -PtestServer

would install to local repo, development server and test server!

-Stephen

Re: Deploy to multiple oc4j instances - solved

Posted by Chris Russell <ch...@oracle.com>.
Ignore the first post. The issue was actually with the use of 
"admin_client.jar" and I understand the port numbers that I need to use now.
BTW, for those who need it, I got the port numbers from Oracle 
Enterprise Manager and clicking on the "Runtime Ports" link.

Now thats cleared up, I see me other error. You don't create two 
<tasks>, its would look like this:

             <tasks>
               <java 
jar="/app/oracle/ias/10131/Oracle_AS1/j2ee/home/admin_client.jar" 
fork="yes">
                 ......
               </java>
              <java 
jar="/app/oracle/ias/10131/Oracle_AS1/j2ee/home/admin_client.jar" 
fork="yes">
                 .....
               </java>
             </tasks>

Thanks,
Chris

Chris Russell wrote:
> Hello,
>
> I've had good success deploying my application to a single oc4j 
> instance using 'mvn install'.
> Now I have two instances to deploy to and I'm wondering how to do this.
>
> Initially I tried to add another <tasks> entry in that pom file.
>
>              <!-- this is the original task that is working - note: 
> port is not listed in the URI (7777) -->
>              <tasks>
>                <java 
> jar="/app/oracle/ias/10131/Oracle_AS1/j2ee/home/admin_client.jar" 
> fork="yes">
>                  <arg 
> value="deployer:oc4j:opmn://wd2045.us.oracle.com/oc4j_od"/>
>                  <list of args......>
>                </java>
>              </tasks>
>              <!-- this is the new task with the port number added 
> "wd2045.us.oracle.com:7778" -->
>              <tasks>
>                <java 
> jar="/app/oracle/ias/10131/Oracle_AS1/j2ee/home/admin_client.jar" 
> fork="yes">
>                  <arg 
> value="deployer:oc4j:opmn://wd2045.us.oracle.com*:7778*/oc4j_od"/>               
>
>                  <list of args......>
>                </java>
>              </tasks>
>
> When I try to install I get:
>
> [java] Failed at "Could not get DeploymentManager".
> [java] This is typically the result of an invalid deployer URI format 
> being supplied, the target server not being in a started state or 
> incorrect authentication details being supplied.
>
> So it doesn't like my URI of 
> "deployer:oc4j:opmn://wd2045.us.oracle.com*:7778*/oc4j_od".
>
> Given that I didn't specify a port number in the first case, I'm not 
> sure what this is looking for.
>
> Thanks for the help in advance,
> Chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org