dev@glassfish.java.net

Re: Habitat.getAllByType(NetworkListener.class) returns empty after asadmin create-domain

From: Amy Roh <Amelia.Roh_at_Sun.COM>
Date: Thu, 16 Apr 2009 14:40:57 -0700

Thanks for the quick fix, Kedar.

I am noticing another strange behavior.

When I try "asadmin create-http-listener", ConfigListener used to
receive ADD event on HttpListener and WebContainer processes the ADD
event to create new web connector, etc.

After grizzly-config changes, I am expecting it has changed to receive
ADD event on *NetworkListener*. However, no event is sent on
*NetworkListener*, just CHANGE event on VirtualServer. The CHANGE event
on VirtualServer is trying to update with the newly created
NetWorkListener after "asadmin create-http-listener" call and
Habitat.getAllByType(NetworkListener.class) does not yet include the
newly created listener resulting in an error "Listener new-listener
referenced by virtual server server does not exist"

1. shouldn't asadmin create-listener trigger ConfigListener ADD event on
NetworkListener?

2. shouldn't Habitat.getAllByType(NetworkListener.class) include the
newly created listener after asadmin create-listener is performed?

Thanks,
Amy

Kedar Mhaswade wrote:
> Fixed in r 26189 of source tree.
>
> In the process, I also added certain required http-service/virtual-server
> properties (e.g docroot, accessLoggingEnabled etc.) in
> domain1/config/domain.xml. I believe these properties are required for the
> web-container to run.
>
> -Kedar
>
>
> Kedar Mhaswade wrote:
>>
>>
>> Jerome Dochez wrote:
>>> looks like the templates need to be changed....
>>
>> Looks like that.
>>
>>>
>>> Kedar or Justin, can you look into this.
>>
>> Yes, I will make changes to templates. Thanks for reporting the issue.
>>
>>
>> -Kedar
>>
>>>
>>> Thanks, jerome
>>>
>>> On Apr 14, 2009, at 4:07 PM, Amy Roh wrote:
>>>
>>>> Hi,
>>>>
>>>> When you delete the default domain1 and create a new one,
>>>> Habitat.getAllByType(NetworkListener.class) is returning an empty
>>>> array when WebContainer is starting up for the first time and fails
>>>> to configure its network listeners for virtual servers.
>>>>
>>>> This can be reproduced by (Hudson webtier devtest uses create-domain
>>>> to avoid port conflicts)
>>>>
>>>> 1. Remove domain1
>>>> bash-3.2$ rm -rf glassfish/domains/domain1/
>>>>
>>>> 2. Create new domain1
>>>> bash-3.2$ glassfish/bin/asadmin create-domain --adminport 4848
>>>> --user anonymous --instanceport=8080 domain1
>>>> Using port 4848 for Admin.
>>>> Using port 8080 for HTTP Instance.
>>>> Using default port 7676 for JMS.
>>>> Using default port 3700 for IIOP.
>>>> Using default port 8181 for HTTP_SSL.
>>>> Using default port 3820 for IIOP_SSL.
>>>> Using default port 3920 for IIOP_MUTUALAUTH.
>>>> Using default port 8686 for JMX_ADMIN.
>>>> Distinguished Name of the self-signed X.509 Server Certificate is:
>>>> [CN=cpe-76-174-87-171.socal.res.rr.com,OU=GlassFish,O=Sun
>>>> Microsystems,L=Santa Clara,ST=California,C=US]
>>>> Domain domain1 created.
>>>> Command create-domain executed successfully.
>>>>
>>>> 3. Start domain
>>>> bash-3.2$ glassfish/bin/asadmin start-domain
>>>>
>>>> Launching Watchdog in a separate JVM. The Domain is now
>>>> remote-restart enabled.
>>>>
>>>> Name of the domain started: [domain1] and
>>>> its location:
>>>> [/Users/Amy/v3-4-15/v3/distributions/glassfish/target/glassfish/domains/domain1].
>>>>
>>>> Admin port for the domain: [4848].
>>>>
>>>> 4. Deploy webapp to start web container
>>>> bash-3.2$ glassfish/bin/asadmin deploy /Users/Amy/sample.war
>>>>
>>>> Command deploy executed successfully.
>>>>
>>>> And you'll see these logging info -
>>>>
>>>> [#|2009-04-14T15:54:54.076-0700|SEVERE|glassfish|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=15;_ThreadName=Thread-1;|*Listener
>>>> http-listener-1 referenced by virtual server server does not exist*|#]
>>>>
>>>> [#|2009-04-14T15:54:54.076-0700|SEVERE|glassfish|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=15;_ThreadName=Thread-1;|*Listener
>>>> http-listener-2 referenced by virtual server server does not exist*|#]
>>>>
>>>> [#|2009-04-14T15:54:54.079-0700|INFO|glassfish|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=15;_ThreadName=Thread-1;|Created
>>>> virtual server server|#]
>>>>
>>>> [#|2009-04-14T15:54:54.081-0700|SEVERE|glassfish|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=15;_ThreadName=Thread-1;|*Listener
>>>> admin-listener referenced by virtual server __asadmin does not
>>>> exist*|#]
>>>>
>>>> So apparently after create-domain,
>>>> Habitat.getAllByType(NetworkListener.class) in WebContainer is
>>>> returning an empty array.
>>>>
>>>> I tried changing the code (in WebContainer.configureHost) to use
>>>> habitat.*getAllByContract*(NetworkListener.class) instead and only
>>>> http-listener-2 and admin-listener are returned. The
>>>> http-listener-1 is still not found by the time web container is
>>>> first started.
>>>>
>>>> Any idea why the NetworkListeners are not available using Habitat
>>>> after create-domain?
>>>>
>>>> Thanks,
>>>> Amy
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>