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 217727 - Cannot register GlassFish 3.1.2.2
Summary: Cannot register GlassFish 3.1.2.2
Status: VERIFIED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: GlassFish (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P1 normal (vote)
Assignee: TomasKraus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-03 09:08 UTC by Jiri Skrivanek
Modified: 2012-09-12 07:31 UTC (History)
2 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 Jiri Skrivanek 2012-09-03 09:08:58 UTC
It is not possible to register GlassFish 3.1.2.2. To reproduce:

- download http://download.java.net/glassfish/3.1.2.2/release/glassfish-3.1.2.2.zip
- unzip it to e.g. C:\Users\jskrivanek\GlassFish_Server
- start to create Java Web project
- start to add unzipped GlassFish
- it prints: "Not a valid GlassFish Server installation."

Product Version: NetBeans IDE Dev (Build 201209020001)
Java: 1.7.0_06; Java HotSpot(TM) 64-Bit Server VM 23.2-b09
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
Comment 1 Jiri Skrivanek 2012-09-03 10:38:24 UTC
Related to this bug is also that GlassFish 3.1.2.2 is presented as "GlassFish Server 3.1.2" in NetBeans. If it is not intentional, please fix it together.
Comment 2 TomasKraus 2012-09-03 12:29:20 UTC
I'm trying to reproduce this on both Linux and windows machines with actual web-main build and I see no problem.
GlassFish 3.1.2.2 from the same zip file is seen as GlassFish 3.1.2.2.
Comment 3 TomasKraus 2012-09-03 13:49:26 UTC
We found out that this fix was not propagated from web-main into build yet. It's already fixed in web-main.
Comment 4 Jiri Skrivanek 2012-09-04 12:45:26 UTC
Verified in build 201209040947.
Comment 5 Petr Jiricka 2012-09-04 14:34:35 UTC
This is still happening to me. I realized this only happens when I add the server as part of project creation. When I go through the Services window, it works fine. I.e.:
1. Create a new Maven web project
2. On the Settings panel, press the Add... button to add server
3. Choose GF, press next and on the Server Location panel choose the GF installation usin the Browse... button

Product Version: NetBeans IDE Dev (Build web-main-8401-on-20120904)
Java: 1.6.0_33; Java HotSpot(TM) 64-Bit Server VM 20.8-b03-424
System: Mac OS X version 10.7.4 running on x86_64; MacRoman; en_US (nb)
Comment 6 TomasKraus 2012-09-04 18:08:11 UTC
It probably uses different code to check GF version. I'll take care of it tomorrow.
Thanks for finding more details about this.
Comment 7 TomasKraus 2012-09-05 14:02:08 UTC
This is typical consequence of copy-pasting in the code:

1) When opening project there is ServerUtilities.getAddInstanceIterator method being called to return list of supported servers
   org.netbeans.modules.glassfish.common.wizards.ServerWizardIterator.<init>(ServerWizardIterator.java:103)
   org.netbeans.modules.glassfish.spi.ServerUtilities.getAddInstanceIterator(ServerUtilities.java:195)
   org.netbeans.modules.glassfish.javaee.Hk2OptionalFactory$J2eeInstantiatingIterator.<init>(Hk2OptionalFactory.java:209)
   org.netbeans.modules.glassfish.javaee.Hk2OptionalFactory.getAddInstanceIterator(Hk2OptionalFactory.java:149)
2) When adding server from Services tab GlassfishWizardProvider.getInstantiatingIterator method is used
   org.netbeans.modules.glassfish.common.wizards.ServerWizardIterator.<init>(ServerWizardIterator.java:103)
   org.netbeans.modules.glassfish.common.wizards.GlassfishWizardProvider.getInstantiatingIterator(GlassfishWizardProvider.java:81)
   org.netbeans.modules.server.ui.wizard.ServerWizardVisual$WizardListModel.resultChanged(ServerWizardVisual.java:401)
   org.netbeans.modules.server.ui.wizard.ServerWizardVisual$WizardListModel.<init>(ServerWizardVisual.java:372)

I fixed GlassfishWizardProvider only in previous bug.

Now to make code consistent I moved getInstantiatingIterator() into ServerDetails and I made it static. It works with ServerDetails constants anyway and it should be updated any time there is a change in ServerDetails constants related to future new Glassfish releases.

Method getAddInstanceIterator() was removed from ServerUtilities and it's usage was replaced with ServerDetails.getInstantiatingIterator().

GlassfishWizardProvider instance method getInstantiatingIterator() is only facade to ServerDetails.getInstantiatingIterator() now.
Comment 8 TomasKraus 2012-09-06 12:15:39 UTC
Pushed to web-main.morf_