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.
GlassFish registration is lost after restart if it was previously registered during installation. To reproduce: - install NetBeans with GlassFish and Tomcat from installer - start NetBeans - create Web project with GlassFish, check server at the Services view - restart NetBeans - look at the Services view but server is gone - if you try to add server again it does not offer path to installed Glassfish (see bug 239173). Product Version: NetBeans IDE 8.0 Beta (Build 201401091443) 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-b123 System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb) User directory: C:\Users\jskrivanek\AppData\Roaming\NetBeans\8.0beta Cache directory: C:\Users\jskrivanek\AppData\Local\NetBeans\Cache\8.0beta
Tomas, please evaluate ASAP (today!) and let us know .... otherwise we will release 8.0 with this bug, thanks in advance.
A problem is related to preferences of glassfish module, stored in file <userdir>/config/Preferences/org/netbeans/modules/glassfish/common.properties If the file found in the userdir, GF4 server is not in Services tab. When I removed the file and restarted IDE, the GF4 was back in Services tab. After next restart will disappear again and so on.
Btw. it's reproducible on latest Dev build on Windows and on Mac too.
I think I've found a fix. If my assumptions are correct this used to work only by accident in 7.4. Basically there is a logic which for some reason copy the data from autoregistered instance file to a regular one and saving the mark it has been done. There is also logic that prevents duplicated instance files. In 7.4 the autoregistered instance was in folder GlassFishEE6WC and the regular instance file was created in GlassFishEE6 in userdir. In dev the autoregistered instance is in folder GlassFishEE6 and the regular instance file is going to be created in GlassFishEE6 in userdir. So the duplication prevention code takes place and the instance is not stored in user dir, but marked as copied. I believe the attached patch could solve the issue though I'm not sure about possible side effects - the GF code is too complex.
Created attachment 143924 [details] the patch
Fixed in web-main add2166c0cda.
Fixed in 8.0_beta - http://hg.netbeans.org/releases/rev/d6258d35641d
Fix looks good. Values of instance.url and instance.name are unique so this shall be working. I would just replace instanceFOs[i].getAttribute(GlassfishModule.URL_ATTR)) with instanceFOs[i].getUrl(). I made all those getters and setters to hide backend map and to allow getting rid of it in the future. But it's just a cosmetic change so it's up to you.
Verified in NetBeans IDE 8.0 Beta (Build 201401141042).