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 165957 - cannot register v3 servers
Summary: cannot register v3 servers
Status: VERIFIED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: GlassFish (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Vince Kraemer
URL:
Keywords:
: 166228 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-05-25 15:11 UTC by Vince Kraemer
Modified: 2009-05-29 17:02 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vince Kraemer 2009-05-25 15:11:55 UTC
the fix for issue 162741 prevents new servers from being registered.
Comment 1 Vince Kraemer 2009-05-25 15:13:55 UTC
additional info... like stack traces is available in http://www.netbeans.org/issues/show_bug.cgi?id=162214#desc24

Comment 2 Vince Kraemer 2009-05-25 16:21:30 UTC
http://hg.netbeans.org/web-main/rev/ce740019ac3b
Comment 3 Quality Engineering 2009-05-26 07:29:33 UTC
Integrated into 'main-golden', will be available in build *200905260201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/ce740019ac3b
User: vince kraemer <vkraemer@netbeans.org>
Log: #165957: second half of fix for 162741...
Comment 4 Michal Mocnak 2009-05-26 16:40:47 UTC
Verified in trunk build #200905260201 ... Has to be verified in RC1 build
Comment 5 Vince Kraemer 2009-05-26 17:53:06 UTC
align with the HR 6.7 process
Comment 6 _ pcw 2009-05-27 01:54:15 UTC
In reviewing this patch, I'm troubled by the inclusion of this line at this position in the GlassFishInstance
constructor.  This makes the instance publicly visible before it's fully constructed (which is completed by the
updateModuleSupport() call).

     2.8 +        instanceProvider.addServerInstance(this);
     2.9          updateModuleSupport();

On the other hand, putting the addServerInstance() call at the end of the constructor causes the failure this issue was
filed for the in the first place.

The real issue is that in the get*DeploymentManager() methods in glassfish.javaee module are calling getServerInstance()
to find out if a particular URI is a registered server URI.  This method exposes publicly available servers which is
acceptable except in the case where the server URI in question is in the process of being registered (which is the case
for this bug.).

I propose an amendment to the attach patch to add new isRegisteredUri(String uri) api to the glassfish.common SPI that
can be used find out if a particular URI is registered, or in process, rather than calling getServerInstance().

The portion of the original patch that pushes the addServerInstance() call to the GlassFishInstance constructor stays,
but is moved to the last line of the constructor.  Also a small temporary registry is introduced that tracks server
URI's that are in the act of being registered.

Patch to follow.
Comment 7 _ pcw 2009-05-27 03:05:21 UTC
http://hg.netbeans.org/web-main/rev/0c3d55cd53f6

AND

http://hg.netbeans.org/web-main/rev/57200c6a9ab6

Two commits because Vince found a hypothetical NPE in the finally clause after I pushed this.
Comment 8 Vince Kraemer 2009-05-27 13:10:06 UTC
The combined fix (my initial changes plus Peter's amendments) are good, codewise...  I will have QA verify it in a build.
Comment 9 Quality Engineering 2009-05-27 18:43:57 UTC
Integrated into 'main-golden', will be available in build *200905271401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/0c3d55cd53f6
User: pcw@netbeans.org
Log: #165957 - augmented patch that resolves encapsulation loophole in original patch
Comment 10 davisn 2009-05-27 22:51:10 UTC
Verified the fix with NetBeans-dev-web-main-709-on-090527-full build from
(http://bertram.netbeans.org/hudson/job/web-main/lastSuccessfulBuild/)

-Was able to register GlassFish v3 Prelude & V3 Enterprise
-Created a web project and was able to select GlassFish v3 Prelude & V3 Enterprise in the server list
-If Java EE Web features were deactivated, when create a new Java EE project the feature is re-activated and I was able
to select a v3 server from the server list

The problem is verified as fix
Comment 11 Vince Kraemer 2009-05-28 01:16:40 UTC
http://hg.netbeans.org/release67/rev/66c0024bc019
Comment 12 Michal Mocnak 2009-05-29 14:24:15 UTC
Verified in nb67rc1 build #200905282243
Comment 13 _ pcw 2009-05-29 17:02:48 UTC
*** Issue 166228 has been marked as a duplicate of this issue. ***