dev@glassfish.java.net

Re: v3 start up is silent even when there is port conflicts

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Fri, 12 Sep 2008 13:42:49 -0400

Salut,

Shing Wai Chan wrote:
> Jeanfrancois Arcand wrote:
>> Salut,
>>
>> Jerome Dochez wrote:
>>> Jeanfrancois Arcand wrote:
>>>> Salu,
>>>>
>>>> Harsha Godugu wrote:
>>>>> On 09/11/08 18:14, Shing-Wai.Chan_at_Sun.COM wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I have a discussion with Rajiv.
>>>>>> Here is what we see.
>>>>>> 1. port 8080 was occupied by another process in the machine
>>>>>> 2. start v3 by asadmin without any error message
>>>>>> asadmin start-domain domain1
>>>>>> Name of the domain started: [domain1] and
>>>>>> its location:
>>>>>> [/export/gfv3/src/install/glassfish/domains/domain1].
>>>>>> Admin port for the domain: [4848].
>>>>>> 3. deployment with error
>>>>>> asadmin deploy hellojsp.war
>>>>>> Remote server does not listen for requests on
>>>>>> [localhost:4,848].
>>>>>> Is the server up?
>>>>>> Command deploy failed.
>>>>>>
>>>>>> I understand that we have (2) as the container have not started.
>>>>>> But should we check the port in (2)?
>>>>> Yes. We should. I also bumped into this issue. It took a while to
>>>>> figure what was happening.
>>>>> This is a p2 bug :-)
>>>>>
>>>>
>>>> Jerome can comments, but I think the current behavior is expected ;-)
>>> first of all, it's probably a bad idea to run your bit-torrent on
>>> 4848 ;-)
>>>
>>> I can indeed reproduce the issue (not that I have bit-torrent), Jean
>>> Francois, looks like you are not generating an exception when opening
>>> the port so I cannot trigger the shutdown.
>>>
>>> for instance if you do
>>>
>>>
>>> java -jar glassfish.jar (works fine)
>>> then another one....
>>> java -jar glassfish.jar (it fails to open the port, shutdown is
>>> initiated and performed).
>>>
>>> with the port occupied by something else than grizzly, it looks like
>>> Grizzly did not generate the
>>> java.net.BindException: Address already in use:
>>> 4848=com.sun.grizzly.http.SelectorThreadHandler_at_63a1ae
>>>
>>> any idea ?
>>
>> Hum...on Ubuntu I'm getting:
>>
>>> 12-Sep-2008 1:08:03 PM com.sun.grizzly.Controller doSelect
>>> SEVERE: doSelect exception
>>> java.net.BindException: Address already in use:
>>> 4848=com.sun.grizzly.http.SelectorThreadHandler_at_1799a1e
>>> at
>>> com.sun.grizzly.TCPSelectorHandler.preSelect(TCPSelectorHandler.java:346)
>>>
>>> at com.sun.grizzly.Controller.doSelect(Controller.java:367)
>>> at
>>> com.sun.grizzly.SelectorHandlerRunner.run(SelectorHandlerRunner.java:82)
>>> at
>>> com.sun.grizzly.Controller.startSelectorHandlerRunner(Controller.java:1136)
>>>
>>> at com.sun.grizzly.Controller.start(Controller.java:943)
>>> at
>>> com.sun.grizzly.http.SelectorThread.startListener(SelectorThread.java:1174)
>>>
>>> at
>>> com.sun.grizzly.http.SelectorThread.run(SelectorThread.java:1041)
>>> at
>>> com.sun.grizzly.http.SelectorThread.startEndpoint(SelectorThread.java:1106)
>>>
>>> at
>>> com.sun.enterprise.v3.services.impl.GrizzlyServiceListener.start(GrizzlyServiceListener.java:91)
>>>
>>> at
>>> com.sun.enterprise.v3.services.impl.GrizzlyProxy$1.run(GrizzlyProxy.java:221)
>>>
>>> 12-Sep-2008 1:08:03 PM OSGiModuleImpl start
>>
>> when the port is in use. What is the exact scenario and more
>> important, which OS/JDK?
> I am in Mac with java full version "1.5.0_13-b05-237"

Then, puzzling. I'm getting the stack trace on OSX as well:

> grizzly:~ jeanfrancoisarcand$ uname -a
> Darwin grizzly.local 8.11.1 Darwin Kernel Version 8.11.1: Wed Oct 10 18:23:28 PDT 2007; root:xnu-792.25.20~1/RELEASE_I386 i386 i386
> grizzly:~ jeanfrancoisarcand$ java -version
> java version "1.5.0_13"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-241)
> Java HotSpot(TM) Client VM (build 1.5.0_13-121, mixed mode, sharing)

Anybody that can reproduce the issue on x86 or win32? Will be tough to
get a fix if I have to file a bug agains Apple's JDK.

A+

-- Jeanfrancois



> Shing Wai Chan
>>
>> A+
>>
>> -- Jeanfrancois
>>
>>
>>
>>>>
>>>> A+
>>>>
>>>> -- Jeanfrancois
>>>>
>>>>
>>>>> thanks...
>>>>>> (If 8080 is occupied by another http engine, then one may (by
>>>>>> mistake) think
>>>>>> that v3 is up. But in fact, another process is serving the
>>>>>> request!!! This is an
>>>>>> issue.)
>>>>>>
>>>>>> Regards,
>>>>>> Shing Wai Chan
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> 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
>>>
>>
>> ---------------------------------------------------------------------
>> 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
>