This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 221075 - NetBeans fails to start GlassFish
Summary: NetBeans fails to start GlassFish
Status: RESOLVED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: GlassFish (show other bugs)
Version: 7.3
Hardware: PC All
: P1 normal (vote)
Assignee: TomasKraus
URL:
Keywords: REGRESSION, THREAD
: 221212 230496 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-10-30 10:51 UTC by tim_sa
Modified: 2015-02-13 16:23 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE logs (136.81 KB, application/octet-stream)
2012-10-30 10:52 UTC, tim_sa
Details
GlassFish Logs (655.33 KB, application/octet-stream)
2012-10-30 10:55 UTC, tim_sa
Details
Ide Log2 (752.23 KB, application/octet-stream)
2012-10-30 14:12 UTC, tim_sa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tim_sa 2012-10-30 10:51:08 UTC
[ BUILD # : 201210300001 ]
[ JDK VERSION : <1.7.7 ]

When trying to start my web application I get presented with the following
error message "GlassFish Server 3.1.1 Start Failed"

If I start glassfish using 'asadmin start-domain domain1' and then run my web
application from NetBeans then the web app is succesfully deployed and run.
Comment 1 tim_sa 2012-10-30 10:52:10 UTC
Created attachment 126768 [details]
IDE logs
Comment 2 tim_sa 2012-10-30 10:55:01 UTC
Created attachment 126769 [details]
GlassFish Logs
Comment 3 TomasKraus 2012-10-30 13:20:14 UTC
It looks like process was not started at all. 

 * Is it first 7.3 build that you were testing, or was it working fine with some previous builds?
 * How did you start GlassFish from NetBeans?
 * What exactly did you see in GlassFish log window in GUI?

Please add -J-Dglassfish.level=0 -J-Dorg.glassfish.tools.ide.level=0
options into netbeans_default_options in your netbeans config file (etc/netbeans.conf) and reproduce this issue again. This will produce more detailed logs to let me know what exactly is happening.

Message
[GlassFish Server 3.1.1] Could not connect to localhost:4848: Connection refused: connect
is from new server status check that I finished yesterday. At this point I'm not sure if there is a problem in this test itself or GlassFish did not start at all.
Comment 4 tim_sa 2012-10-30 14:10:10 UTC
>  * Is it first 7.3 build that you were testing, or was it working fine with
> some previous builds?

It was working with previous builds, most recently 201210240001

>  * How did you start GlassFish from NetBeans?
I selected the projected and tried to run it. When this failed I went to Services -> Servers -> GlassFish Server 3.1.1 -> start
>  * What exactly did you see in GlassFish log window in GUI?

The title was "Information"
the message was "GlassFish Server 3.1.1 Start Failed"
 
> Please add -J-Dglassfish.level=0 -J-Dorg.glassfish.tools.ide.level=0
> options into netbeans_default_options in your netbeans config file
> (etc/netbeans.conf) and reproduce this issue again. This will produce more
> detailed logs to let me know what exactly is happening.
> 
> Message
> [GlassFish Server 3.1.1] Could not connect to localhost:4848: Connection
> refused: connect
> is from new server status check that I finished yesterday. At this point I'm
> not sure if there is a problem in this test itself or GlassFish did not start
> at all.

I observed the following when modifying netbeans_default_options

When I added '-J-Dglassfish.level=0 -J-Dorg.glassfish.tools.ide.level=0' to netbeans_default_options 
then GlassFish launched succesfully.

When I added '-J-Dorg.glassfish.tools.ide.level=0' to netbeans_default_options then GlassFish launched succesfully.

When I added '-J-Dglassfish.level=0' to netbeans_default_options then GlassFish failed to launch.
I will attach the IDE Log for this last case.
Comment 5 tim_sa 2012-10-30 14:12:09 UTC
Created attachment 126777 [details]
Ide Log2

-J-Dglassfish.level=0 argument set
Comment 6 TomasKraus 2012-10-30 14:39:42 UTC
OK, looks like server was started but did not respond fast enough. Maybe adding -J-Dorg.glassfish.tools.ide.level=0 slows something down to get glassfish additional time to finish startup.

Unfortunately without -J-Dorg.glassfish.tools.ide.level=0 output I can only guess.
Can you try to put some load on the machine to slow it down and run it with -J-Dorg.glassfish.tools.ide.level=0  again?

This is the only way to see server status check results.
Comment 7 TomasKraus 2012-10-30 15:10:07 UTC
Anyway, I'll raise startup timeout from 2 to 10 minutes.

GlassFish Tooling SDK:
----------------------
changeset:   343:beb80b3513ed
date:        Tue Oct 30 16:08:59 2012 +0100
summary:     Startup timeout raised to 10 minutes

Everything is pointing to this as cause of your problem.
Comment 8 TomasKraus 2012-10-31 11:02:03 UTC
Please try to test it with last build on 
http://bertram2.netbeans.org:8080/job/web-main/9050/

It should give GlassFish 10 minutes to start instead of 2.
Comment 9 Jiri Skrivanek 2012-10-31 11:53:20 UTC
It works only if there is no application deployed on GlassFish. If I create web app with REST web services from DB, run it once, stop server and then it fails when I try to run it again. Unfortunately I cannot reproduce it with logging.
Comment 10 tim_sa 2012-10-31 12:53:46 UTC
(In reply to comment #8)
> Please try to test it with last build on 
> http://bertram2.netbeans.org:8080/job/web-main/9050/
> 
> It should give GlassFish 10 minutes to start instead of 2.

I've just tried this build the problems still occurs.
I think it's worth noting that from starting the server to getting the failure to start message approximately 10 seconds have elapsed.

Also If I open the Task Manager I can see the GlassFish process running, until the  Failure dialog pops up, and then it disappears. 

Will try with the arguements provided previously to see if i can get anything to log.
Comment 11 Petr Hejl 2012-10-31 16:38:07 UTC
Tomasi, this looks like threading issue. Happened to me twice randomly.

For these type of issues (race conditions) it is typical that enabling of logging will semi-synchronizes the code and issue disappears.
Comment 12 TomasKraus 2012-11-01 07:12:54 UTC
Yes, it may be some race condition. I'll go trough this code later today again and I'll check for them.
Comment 13 Marian Mirilovic 2012-11-01 08:14:21 UTC
*** Bug 221212 has been marked as a duplicate of this bug. ***
Comment 14 muellermi 2012-11-01 10:18:49 UTC
see issue 221106 (NB wont stop web app, even thought Shift-Ctrl-F5 is pressed. Might this be related to or reason for current bug?
Comment 15 Petr Hejl 2012-11-01 10:23:47 UTC
My guess is this changeset caused regression: 9779fccf6693.

What is not really ok the changeset contains two unrelated things and that "Server status check rewritten from scratch" does not really sound like anything which is related to mentioned issue #220316 and which should be done in a bug fixing phase (unless justified by defect in server status check).
Comment 16 TomasKraus 2012-11-01 15:00:22 UTC
GlassFish Tooling SDK:
----------------------
changeset:   348:12166bc5d922
summary:     Bug# 221075 - NetBeans fails to start GlassFish: Fixed
             tasks timeout calculation.

NetBeans web-main:
------------------
changeset:   237814:4d0bd0580541
summary:     #221075 - NetBeans fails to start GlassFish: Fixed tasks
             timeout calculation.
Comment 17 TomasKraus 2012-11-01 15:29:27 UTC
Please test Bug# 221101 - Run process not finished together with this fix.
Comment 18 Marian Mirilovic 2012-11-01 15:45:08 UTC
Could somebody port the fix into release73_beta2 branch in releases repository ASAP ?! Thanks in advance.
Comment 19 Petr Jiricka 2012-11-01 15:59:55 UTC
Pushed to release73_beta2 branch: http://hg.netbeans.org/releases/rev/8f1154b4cd3f
Comment 20 Petr Jiricka 2012-11-01 16:03:35 UTC
One question about the patch: I see the SDK is still b29 as it was before - shouldn't the SDK build number be incremented? with changes like this?
Comment 21 Petr Hejl 2012-11-01 16:08:48 UTC
BTW I believe status.close() should be called in finally block.
Comment 22 TomasKraus 2012-11-01 21:41:19 UTC
I updated b29 hash too to make beta2 transplate simple.
There should already be b30 in web-main.
Comment 23 TomasKraus 2012-11-01 21:47:04 UTC
...and yes, close should be in finally block. I'll change it in web-main.
But we can keep beta2 as it is now, all expected exceptions thrown by tasks are already handled so it won't miss close outside finally.
Comment 24 Quality Engineering 2012-11-02 03:29:46 UTC
Integrated into 'main-golden', will be available in build *201211020001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/4d0bd0580541
User: Tomas Kraus <TomasKraus@netbeans.org>
Log: #221075 - NetBeans fails to start GlassFish: Fixed tasks timeout calculation.
Comment 25 Jiri Skrivanek 2012-11-02 10:04:47 UTC
It works for me in build 201211020001. tim_sa, could you please verify?
Comment 26 Quality Engineering 2012-11-02 10:52:34 UTC
Integrated into 'releases', will be available in build *201211020750* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/8f1154b4cd3f
User: Tomas Kraus <TomasKraus@netbeans.org>
Log: #221075 - NetBeans fails to start GlassFish: Fixed tasks timeout calculation.
Comment 27 tim_sa 2012-11-02 11:18:11 UTC
confirm as resolved
Comment 28 muellermi 2012-11-02 12:04:27 UTC
works for me
thanks
Comment 29 TomasKraus 2012-11-02 13:16:13 UTC
NetBeans web-main:
------------------
changeset:   238040:4faea3368ab7
summary:     #221075 -  Moved close() call to finally block

This is trunk only checkin to make sure there won't be any mess left.
Comment 30 Petr Jiricka 2012-11-02 14:36:55 UTC
Per agreement with Jirka transplanted the latest changeset to release73_beta2: http://hg.netbeans.org/releases/rev/59346aaa9998
Comment 31 Quality Engineering 2012-11-03 02:42:20 UTC
Integrated into 'main-golden', will be available in build *201211030001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/4faea3368ab7
User: Tomas Kraus <TomasKraus@netbeans.org>
Log: #221075 -  Moved close() call to finally block
Comment 32 Quality Engineering 2012-11-04 23:12:46 UTC
Integrated into 'releases', will be available in build *201211042000* or newer. Wait for official and publicly available build.
Changeset: http://hg.netbeans.org/releases/rev/59346aaa9998
User: Tomas Kraus <TomasKraus@netbeans.org>
Log: #221075 -  Moved close() call to finally block
Comment 33 TomasKraus 2013-08-03 23:09:43 UTC
*** Bug 230496 has been marked as a duplicate of this bug. ***
Comment 34 cesarurrea 2015-02-13 16:13:40 UTC
Sorry for my English.

Waaoo after long long time, finally I can find an easy, temporary and not definitive to solve this issue, but it works for me. I can proved in nb 7.x an 8.x for Glassfish 4.x.

That solution depends if you have one copy for your original installation domain.xml file, because for some reason Netbeans let it to read this file after you deploy an re-deploy your applications.

First stop all your domain instances, if you can do this with Netbeans, do it with asadmin.

Steps

1- go to <glassfish directory install>\glassfish\domains\<your domain>\config
2- edit your domain.xml backed file with your <network-listeners> if your domain do not use default ports and if you have more than one domain, maybe you have to edit your <jmx-connector> connection port to avoid conflicts.
3- That is all, now you can start your Netbeans and start your server instance.

4- Now don't forget it. Please Be happy.
Comment 35 TomasKraus 2015-02-13 16:23:10 UTC
As far as I remember, GF4 was not available at the time when I was working on those changes. Unfortunately I moved to another project and my current NetBeans contributions are very limited. :(
Anyway, it's good to have some workaround for GF4.