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 239836 - [80cat] cannot persist uncheck "start registered derby server"
Summary: [80cat] cannot persist uncheck "start registered derby server"
Status: VERIFIED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: GlassFish (show other bugs)
Version: 8.0
Hardware: PC Windows 8
: P1 normal with 2 votes (vote)
Assignee: TomasKraus
URL:
Keywords: REGRESSION
: 243081 243878 244756 245751 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-12-27 22:43 UTC by muellermi
Modified: 2014-08-14 13:40 UTC (History)
11 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (65.20 KB, text/plain)
2013-12-27 22:43 UTC, muellermi
Details
possible patch (1.60 KB, patch)
2014-08-11 11:33 UTC, Petr Hejl
Details | Diff
patch version 2 (3.63 KB, patch)
2014-08-11 21:45 UTC, Petr Hejl
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description muellermi 2013-12-27 22:43:11 UTC
Product Version = NetBeans IDE Dev (Build 201312270002)
Operating System = Windows 8 version 6.2 running on amd64
Java; VM; Vendor = 1.8.0-ea
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.0-b61

- Install NB with GF 4
- Open tools, Server
- un-check  "start registered derby server"
- re-Open tools, server
--> the checkbox is still un-checked
- close and restart NB
- Open tools, Server
--> the checkbox is CHECKED. NB will start derby when it starts GF
Comment 1 muellermi 2013-12-27 22:43:28 UTC
Created attachment 143490 [details]
IDE log
Comment 2 Libor Fischmeistr 2014-01-09 13:04:41 UTC
I don't think it belongs under databases.

Reassigning to serverplugins for further evaluation.

Anyway when I tried to reproduce it worked for me.

Product Version: NetBeans IDE Dev (Build 201401090002)
Java: 1.8.0-ea; Java HotSpot(TM) 64-Bit Server VM 25.0-b65
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b122
System: Windows 8 version 6.2 running on amd64; Cp1252; en_US (nb
Comment 3 palman 2014-04-24 06:50:49 UTC
I can reproduce it 

Product Version: NetBeans IDE 8.0 (Build 201403101706)
Java: 1.8.0_20-ea; Java HotSpot(TM) 64-Bit Server VM 25.20-b09
Runtime: Java(TM) SE Runtime Environment 1.8.0_20-ea-b09
System: Mac OS X version 10.9.2 running on x86_64; UTF-8; en_US (nb)
Comment 4 rafaelsantini 2014-04-24 18:46:21 UTC
I have the same problem.
Comment 5 granella 2014-05-08 12:01:10 UTC
I have the same problem
Comment 6 bordasb 2014-06-26 12:56:32 UTC
Same problem here too. Linux-64, Glassfish 3.1, NetBeans(Build 201403101706), Java 1.7
Comment 7 Stepan Zebra 2014-08-11 06:01:45 UTC
*** Bug 243081 has been marked as a duplicate of this bug. ***
Comment 8 Stepan Zebra 2014-08-11 06:02:18 UTC
*** Bug 243878 has been marked as a duplicate of this bug. ***
Comment 9 Stepan Zebra 2014-08-11 06:02:53 UTC
*** Bug 244756 has been marked as a duplicate of this bug. ***
Comment 10 Stepan Zebra 2014-08-11 06:03:18 UTC
*** Bug 245751 has been marked as a duplicate of this bug. ***
Comment 11 Stepan Zebra 2014-08-11 06:08:12 UTC
GF server configuration is being reset on NB restart. This is a severe issue and should be fixed in 8.0.1.
Comment 12 Petr Hejl 2014-08-11 10:44:10 UTC
The problem is in GlassfishInstance.prepareProperties. The other code seems to be using logic that non-existing property implies false (and the code is removing the properties configured to false) while the prepareProperties called on the IDE start configures the missing properties to defaults (which is true for derby).

The code is hard to track as there are block movements in commits unrelated to that blocks in vcs.
Comment 13 Petr Hejl 2014-08-11 11:33:25 UTC
Created attachment 148639 [details]
possible patch

This is a patch that seems to work. However as the touched code is too complex it would need heavy testing and review of different scenarios (new server registration, imported properties, installer registered server).

Let me know if this is something we want to do for 8.0.1.
Comment 14 Stepan Zebra 2014-08-11 11:54:08 UTC
(In reply to Petr Hejl from comment #13)
> Created attachment 148639 [details]
> possible patch
> 
> This is a patch that seems to work. However as the touched code is too
> complex it would need heavy testing and review of different scenarios (new
> server registration, imported properties, installer registered server).
> 
> Let me know if this is something we want to do for 8.0.1.

Thank you Petr, I'll start testing the patch right away...
Comment 15 Stepan Zebra 2014-08-11 20:33:40 UTC
Tested the patch on custom build on Windows 7 and all scenarios are working as expected, except one case:
The case however might be artificial due to testing environment. It's the scenario where installer generates the config for automatic server registration. As I haven't had the installers available I added the config into my build manually before first run. There were one 4.0 and one 4.1 server. Both servers were autoregistered successfully. The 4.0 server is persisting properties correctly. The 4.1 server keeps resetting some properties, namely:
"Enable Comet Support" and "Enable HTTP Monitor" are being untick
"Enable JDBC Driver Deployment" is being tick
Having real installer would be more conclusive.
Other than that, the patch seems to be stable.
Comment 16 Petr Hejl 2014-08-11 21:32:12 UTC
(In reply to Stepan Zebra from comment #15)
> Tested the patch on custom build on Windows 7 and all scenarios are working
> as expected, except one case:
> The case however might be artificial due to testing environment. It's the
> scenario where installer generates the config for automatic server
> registration. As I haven't had the installers available I added the config
> into my build manually before first run. There were one 4.0 and one 4.1
> server. Both servers were autoregistered successfully. The 4.0 server is
> persisting properties correctly. The 4.1 server keeps resetting some
> properties, namely:
> "Enable Comet Support" and "Enable HTTP Monitor" are being untick
> "Enable JDBC Driver Deployment" is being tick
> Having real installer would be more conclusive.
> Other than that, the patch seems to be stable.

Couple of quick observations:
1) GF plugin does not seem to be ready to allow multiple autoregistered instances at time
2) with this patch the default values in autoregistered instance are wrong
3) the checkbox "Show Password in this Form" is userdir wide settings so if you change the value in properties dialog of one server it will have this value even if open the dialog for another GF server (P3 I guess)
Comment 17 Petr Hejl 2014-08-11 21:45:36 UTC
Created attachment 148647 [details]
patch version 2

Ok, there seems to be another bug (hidden by prepareProperties method) where only string properties are copied form autoregistered instance - thus the different defaults. This new version of the patch should solve it.

Or there might be some "great plan" behind the scenes I do not understand completely :/

As written above I also believe the plugin never assumed multiple autoregistered instances.
Comment 18 Petr Hejl 2014-08-11 21:50:19 UTC
For autoregistered instance testing one may use this approach:
1) clear userdir and cachedir
2) copy freshly built ide (from nbbuild/netbeans) somewhere
3) cd to that dir
4) invoke:
java -cp ./platform/core/core.jar:./platform/lib/boot.jar:./platform/lib/org-openide-modules.jar:./platform/core/org-openide-filesystems.jar:./platform/lib/org-openide-util.jar:./platform/lib/org-openide-util-lookup.jar:./enterprise/modules/org-netbeans-modules-j2eeapis.jar:./enterprise/modules/org-netbeans-modules-j2eeserver.jar:./enterprise/modules/org-netbeans-modules-glassfish-common.jar:./enterprise/modules/ext/glassfish-tooling-sdk.jar org.netbeans.modules.glassfish.common.registration.AutomaticRegistration ./ide /the/dir/to/glassfish41/glassfish
5) start the IDE from bin
6) there should be the GF instance registered the same way as it would be with installer

*Note the folder in step 5 for gf is glassfish folder _inside_ of the gf installation folder
Comment 19 Petr Jiricka 2014-08-12 11:51:39 UTC
Stepan, can you please also test Petr's second patch? We need to decide whether to put this into the release or not. Thanks.
Comment 20 Stepan Zebra 2014-08-12 12:31:24 UTC
I finished testing of the v2.

The default values for autoregistered instance are now same as if the server is registered manually.

Problem of multiple autoregistered instances remains, though if that's a design flaw, it's likely out of scope of this issue. I'll create a new issue for that.

Regarding "Show password" being userdir wide, I considered that as a feature. Is that a desired behavior or not?

Other scenarios are OK. If you consider the patch ready for integration, please do so. Thank you.
Comment 21 Petr Hejl 2014-08-12 13:17:29 UTC
Fixed in web-main 71698678638a.
Comment 22 Petr Hejl 2014-08-12 13:20:33 UTC
Fixed in release801 85342ccc6bbe.
Comment 23 Quality Engineering 2014-08-13 02:10:38 UTC
Integrated into 'releases/release801', will be available in build *201408122300* or newer. Wait for official and publicly available build.

Changeset: http://hg.netbeans.org/releases/rev/85342ccc6bbe
User: Petr Hejl <phejl@netbeans.org>
Log: #239836 - [80cat] cannot persist uncheck "start registered derby server"
Comment 24 Quality Engineering 2014-08-13 02:24:04 UTC
Integrated into 'main-silver', will be available in build *201408130001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/71698678638a
User: Petr Hejl <phejl@netbeans.org>
Log: #239836 - [80cat] cannot persist uncheck "start registered derby server"
Comment 25 Stepan Zebra 2014-08-14 13:40:25 UTC
verified in 8.0.1

Product Version: NetBeans IDE 8.0.1 RC1 (Build 201408122300)
Java: 1.8.0_11; Java HotSpot(TM) 64-Bit Server VM 25.11-b03
Runtime: Java(TM) SE Runtime Environment 1.8.0_11-b12
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)