dev@glassfish.java.net

Re: Two G/F instances on same box

From: kedar <Kedar.Mhaswade_at_Sun.COM>
Date: Sat, 28 Oct 2006 18:07:10 -0700

Yes, I think that's the basic idea. You can use the same
set of basic app server bits and configure them to your needs
using various domains of interest.

Going ahead, we are going to formalize the support such that
most of the information that is available in domain.xml is
configurable at the *domain-creation time*. Please see
Profiles One-pager and
https://glassfish.dev.java.net/servlets/BrowseList?list=dev&by=thread&from=541226

Regarding class loaders:

Think of the domain as a runtime available to Java EE applications and
web services,
with an administrative capability. To impart this capability, it depends
on basic Java
platform services. Thus, a domain needs a JVM. Every domain has its own
independent
VM which can host applications. In this regard, every domain in a *given
GlassFish
installation* is independent. What is *identical* is the *core app
server bits* that
every domain runs. This is aptly expressed by the setup targets like
"configure-runtime".
Note that a domain's configuration (ala domain.xml) can live anywhere on
a given file
system independent of the GlassFish installation location.

Since the VM is specific to a domain, it's fair to say that class
loaders obey a
domain boundary.

I must warn you however, against the class-loader hierarchy that is
available in each domain at
runtime. There are various class-loaders that load from various URL's
and you
should refer to class loader documentation for the same. Sivakumar
Thyagarajan should
help you more.

I believe the way you have suggested to load different WSIT
implementation classes
for various domains should work seamlessly.

Thanks,
Kedar
Sameer Tyagi wrote:
> The reason I need tow instances is that I need to use two different
> version so of WSIT
> and they are loaded via classpath-prefix from the lib directory.
>
> I landed up doing a second install and it works - but I see how the
> create-domain command
> makes more sense.
>
> So here is what I assume should be done
> -Create another domain
> - Modify the classpath-prefix from
> classpath-prefix="${com.sun.aas.installRoot}/lib/webservices-rt.jar
> to
> classpath-prefix="${com.sun.aas.instanceRoot}/lib/webservices-rt.jar
>
> Put the two different jars in the doman1\lib and domain2\lib directory
>
> Are the class loaders isolated at the domain level and wll the
> different versions of
> webservices-rt.jar be picked up for each domain ?
>
> Thanks
> /s
>
>
>
> kedar wrote:
>
>> I agree with Vince, partially.
>> Also see: Issue Tracker issue # 90.
>>
>> But for this purpose, please don't do another installation.
>> It is a huge overhead and is needless.
>>
>> Darn! We should document/publicize "asadmin create-domain" command more.
>> That is a supported way of doing it. You can create as many
>> instances/domains
>> as you want (on the same box).
>>
>> GlassFish users/developers: Please get used to "asadmin create-domain
>> --adminuser
>> admin --adminport xyzz" command. No need to play around with
>> setup.xml or
>> setup-cluster.xml. It is error prone *and* does additional things
>> (apart from creating
>> the domain, which might negatively side-effect you).
>>
>> Do I need to blog about this? How about:
>>
>> http://blogs.sun.com/bloggerkedar/entry/concept_of_a_glassfish_domain
>>
>> Kedar
>>
>> vince kraemer wrote:
>>
>>> Sameer Tyagi wrote:
>>>
>>>> How do I set up 2 GF instances on the same box ?
>>>>
>>>> I copied the existing dir and edited the paths in all the files in
>>>> the bin dir, edited the configs\asenv
>>>> and edited all the ports in the domain.xml.
>>>
>>>
>>> I guess I would recommend doing the 'install' a second time... in
>>> your second location...
>>>
>>> Editing all the various paths and ports is bound to be error prone...
>>>
>>> If you need to create a second domain (instead of a second install,
>>> you might want to try using asadmin's create-domain subcommand.
>>>
>>> vbk
>>>
>>>>
>>>> However it just hangs after this line
>>>> C:\Glassfish2\bin>asadmin start-domain domain1
>>>> Starting Domain domain1, please wait.
>>>> Log redirected to C:\glassfish2\domains\domain1\logs\server.log.
>>>>
>>>> Any ideas ?
>>>>
>>>> /s
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>