dev@glassfish.java.net

Re: JSR 88 java API deploying on a cluster in glassfish

From: Hong Zhang <Hong.Zhang_at_Sun.COM>
Date: Fri, 15 Feb 2008 10:17:40 -0500

Hi, Kalle
   In JSR88, there is no concept of adding an application reference to
an additional target for a deployed application. You can specify the
target list that you want your application to be deployed to in the
initial distribute API.
 
    Looking at what you described below, you can only see the web page
after you do "asadmin create-application-ref testApp". This command adds
an application reference to the default target "server" as you did not
specify the target explicitly. This tells me you were trying to browse
the web page under server's http listener port, while instead you
should've browsed the web page under cluster's http listener port as the
target you were interested seems to be "cluster1".

   More on the cli commands you run:
   asadmin deploy --target=cluster1 testApp.war
   asadmin create-application-ref testApp
   
   The first commands deploys the application to target "cluster1". And
the second command adds an additional target "server" for the
application. So now the application is available on both targets
"cluster1" and "server".

   If this is what you intended to do, to deploy the application to both
targets. You can do this with JSR88 API by passing both targets
('cluster1" and "server") to the target list in the distribute API.

- Hong

Kalle Widlert wrote:

> Hi,
> I am trying to deploy a web application (war file) on a cluster using
> the JSR88 java API.
> Everything works fine when not using a cluster.
> When I deploy it on a cluster I can not reach the web page and have to
> add the command
> "asadmin create-application-ref testApp"
> to get it to work.
> So the question is how to do the "asadmin create-application-ref
> testApp" in the java API?
>
> This is how It is done with asadmin:
> asadmin deploy --target=cluster1 testApp.war
> asadmin create-application-ref testApp
>
> Regards
> Kalle
>
>
>
>