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 224016 - GlassFish Server 3.1.2.2 Start Failed
Summary: GlassFish Server 3.1.2.2 Start Failed
Status: VERIFIED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: GlassFish (show other bugs)
Version: 7.3
Hardware: PC Windows XP
: P2 normal (vote)
Assignee: TomasKraus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-19 09:04 UTC by bht
Modified: 2013-01-11 10:21 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log file (198.46 KB, text/plain)
2012-12-19 09:04 UTC, bht
Details
server log file (178.09 KB, text/plain)
2012-12-19 09:04 UTC, bht
Details
ide log file with level 0 (327.80 KB, text/plain)
2012-12-20 10:58 UTC, bht
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bht 2012-12-19 09:04:24 UTC
Created attachment 129526 [details]
IDE log file

IDE Dev Build 201212170919

I could start the server a few times before this failure.

Before it, I stopped it in the services window due to a deployment error.
Then I started it, using the IDE and the startup seems to run fine until the message appeared:

"GlassFish Server 3.1.2.2 Start Failed"


Subsequently, I was not able to start it from the services window at all.

Starting it from the command line is no problem. Opening the console in the web browser is no problem.

As before, the issue seems to be that if a web application is already deployed, then the server takes a littl longer to start upwhich prompts he NetBeans plugin to kill the server process.
Comment 1 bht 2012-12-19 09:04:51 UTC
Created attachment 129527 [details]
server log file
Comment 2 TomasKraus 2012-12-19 13:10:32 UTC
I remember similar issue some time ago but it should already be fixed.
But Build 201212170919 is pointing to fresh build.
Comment 3 bht 2012-12-19 17:24:50 UTC
Old occurrences that hit me were bug 197375, 199099, 203937, 217395

Please let me suggest a permanent fix for this:

If NetBeans thinks that it wants to kill the server process then it asks the user for permission to kill it (in a while loop). If the user declines then the IDE continues the while loop. If the user cancels then the IDE breaks out of the while loop and behaves the same way as if the user had started the server from the command line.
Comment 4 TomasKraus 2012-12-20 10:27:50 UTC
I would like to avoid doing such a changes in 7.3. But I'll do it in next release.

Can you attach NetBeans logs with finest logging settings for plugin?
Add "-J-Dglassfish.level=0 -J-Dorg.glassfish.tools.ide.level=0"
into netbeans_default_options in netbeans.conf

It will show me more details about startup process.
Comment 5 bht 2012-12-20 10:58:28 UTC
Created attachment 129578 [details]
ide log file with level 0

Added log file with "-J-Dglassfish.level=0 -J-Dorg.glassfish.tools.ide.level=0" for failing startup.
Comment 6 TomasKraus 2012-12-20 11:26:10 UTC
Looks like server responded with something that plugin did not expect.

FINE [org.glassfish.tools.ide]: [20.109] Locations task completed.
FINEST [glassfish]: Server GlassFish Server 3.1.2.2 version response: null
FINEST [glassfish]: Server GlassFish Server 3.1.2.2 locations response returned
0 records
INFO [glassfish]: GlassFish Server 3.1.2.2 is not responding, killing the
process.

Expected version response is: "V3 cannot process this command at this time,
please wait" which indicates that GlassFish is still in startup mode.
Comment 7 TomasKraus 2012-12-20 11:31:27 UTC
Let's try to evaluate null response as "not yet ready" message.
diff -r ca78f7491d97 glassfish.common/src/org/netbeans/modules/glassfish/common/GlassFishStatus.java
--- a/glassfish.common/src/org/netbeans/modules/glassfish/common/GlassFishStatus.java   Wed Dec 19 13:50:32 2012 +0100
+++ b/glassfish.common/src/org/netbeans/modules/glassfish/common/GlassFishStatus.java   Thu Dec 20 12:29:08 2012 +0100
@@ -380,8 +380,8 @@
                                 instance.getName(), value});
                     switch (versionCommandResult.getState()) {
                         case FAILED:
-                            if (notYetReady
-                                    = ServerUtils.notYetReadyMsg(value)) {
+                            if (notYetReady = (value == null
+                                    || ServerUtils.notYetReadyMsg(value))) {
                                 Logger.getLogger("glassfish").log(Level.FINEST,
                                         LOG_SERVER_STARTUP, instance.getName());
                                 continue;

I can't verify it locally so I'll push this into web-main to let you test it.
Comment 8 TomasKraus 2012-12-20 12:23:37 UTC
I did local testing and it should resolve your problem at this moment. Unfortunately there is a regression in version response processing code causing that null is returned instead of "V3 cannot process this command at this time..." message.

I'll fix it after I'll be back from vacation.
Comment 9 TomasKraus 2012-12-20 12:25:39 UTC
NetBeans web-main:
------------------
changeset:   242911:1d12be860dcc
summary:     #224016 - Quick fix in server startup code
Comment 10 Quality Engineering 2012-12-21 02:33:53 UTC
Integrated into 'main-golden', will be available in build *201212210001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/1d12be860dcc
User: Tomas Kraus <TomasKraus@netbeans.org>
Log: #224016 - Quick fix in server startup code
Comment 11 TomasKraus 2013-01-03 10:26:20 UTC
Looks like previous fix made things even worse. I had to revert one former change that causes server response not being processed in case of FAILURE exit code from asadmin command. Even with FAILURE we still need to process response Manifest to get message text which may contain information about server still being in starup mode.

Now server status detection based on version asadmin command works this way:
1) FAILURE exit code and "V3 cannot process this command at this time, please wait" response message - server is still in startup mode
2) FAILURE exit code and anything else - something went wrong, considering server as dead and kill it during startup

NetBeans 7.3 GF Tooling SDK branch:
-----------------------------------
changeset:   241:b450560556fb
branch:      0.3-b036
summary:     Bug 224016 - GlassFish Server 3.1.2.2 Start Failed

NetBeans web-main:
------------------
changeset:   243301:515044968661
description:
#224162 - IDE can not synch Glassfish running state
#224016 - GlassFish Server 3.1.2.2 Start Failed
GlassFish Tooling SDK library updated to glassfish-tooling-sdk-0.3-b036.1.jar
TODO: Forward port GF Tooling SDK fix to trunk.
Comment 12 TomasKraus 2013-01-03 10:52:20 UTC
GF Tooling SDK trunk:
---------------------
changeset:   403:d7d74b9153d6
tag:         tip
summary:     Bug #224016 - GlassFish Server 3.1.2.2 Start Failed
Comment 13 Quality Engineering 2013-01-04 02:29:53 UTC
Integrated into 'main-golden', will be available in build *201301040001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/515044968661
User: Tomas Kraus <TomasKraus@netbeans.org>
Log: #224162 - IDE can not synch Glassfish running state
#224016 - GlassFish Server 3.1.2.2 Start Failed
GlassFish Tooling SDK library updated to glassfish-tooling-sdk-0.3-b036.1.jar
TODO: Forward port GF Tooling SDK fix to trunk.