users@glassfish.java.net

Re: Deploy-VirtualServer concept is not good

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Thu, 01 Mar 2007 09:26:53 -0800

Hi "hammoud",

glassfish_at_javadesktop.org wrote On 02/28/07 03:48 PM,:

>Hi Jan, thanks for your answer, nice to meet you again.
>But i am very sorry, your answer is really not enough.
>
>
>
>
>>By default, user apps are deployed to all configured virtual servers (minus "__asadmin").
>>
>>
>That describes what i detected.
>Does not make sense for me, why AppOne of CompanyOne should be deployed also to Domain of CompanyTwo.
>But is not really core of the problematic, if next point could be resolved.
>
>
>
>
>>or specify the target virtual servers in the admingui.
>>
>>
>This is the core of the problematic, this is what does not work or should be exactly defined here step by step.
>CoreProblematic: Two Context Roots
>
>Step 1: Create the Virtual Servers
>Defining two Virtual Server each for one app/company
>VirtualServer1: Id=V_ONE, Host=www.one.de
>VirtualServer2: Id=V_TWO, Host=www.two.de
>
>Step2: Deploy Apps to the Virtual Servers
>Deploy two different apps to different depending Virtuals Server
>App1: AppName=One, ContextRoot=/, VirtualServers=V_ONE => this works ok
>App2: AppName=Two, ContextRoot=/, VirtualServers=V_TWO => Exception
>
>ContextRoot must be unique depending to virtual servers and not depending to Webapplications.
>
>

part of my answer was trying to explain why your webapp is started
several times (as many times as the number of virtual servers it is
being deployed on).

Unless you specify a list of target virtual servers (by name) to the
deploy command, your webapp will be deployed to all configured
virtual servers. I think this is a reasonable default.

As for the error you're getting, this is a bug. I just filed:

  https://glassfish.dev.java.net/issues/show_bug.cgi?id=2526
  ("Deployment enforces unique context roots across virtual servers,
  instead of on a per-virtual-server basis")

against deployment.

As a workaround, you could deploy "App1" to "V_ONE/One", and declare
it as the default-web-module of virtual server "V_ONE", and deploy "App2" to
"V_TWO/Two", and declare it as the default-web-module of virtual server
"V_TWO".

This will have the effect of making "App1" available at both "V_ONE/" and
"V_ONE/App1", and "App2" available at both "V_TWO/" and "V_TWO/App2",
which is what you want.

Hope this helps.

Thanks,


Jan

>
>