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.
Created attachment 133412 [details] JDK 6 in IDE See the issue 227371 for a background. Steps for reproduce: 1) run NB7.3.1 installer (javaee or full distro) 2) choose JDK 6 as JDK for IDE (see chosen_jdk6_for_ide.png) 3) the installer will warn the user the GF4 requires JDK 7 or newer (see insufficient_jdk6_for_gf4.png) 4) the user can choose JDK 7 for starting GF4 server (see correct_jdk7_for_gf4.png) 5) the installer hands over the JDK 7 (if differs to JDK for IDE) for glassfish AutoRegistation, it writes down the JDK path to the attribute java.platform of glassfish_autoregistered_instance 6) start the IDE and switch to Services|Servers => the chosen JDK from IDE is not in the properties of GlassFish Server 4.0 glassfish.common has to read the java.platform attribute if it's not empty and start the GF4 domain using this JDK
Created attachment 133413 [details] warning about JDK 6 for GF4
Created attachment 133414 [details] correct JDK 7 for GF4
Looks like java.platform attribute is not being saved/loaded in GlassfishInstanceProvider. this should be fixed.
Checked into web-main: ---------------------- changeset: 250105:6725de5bd527 branch: javaee7 summary: #228433 - Save and load GlassFish instance attributes after properties being changed changeset: 250106:70501ddcbc30 branch: javaee7 summary: #228433 - Fixed build issues This change made plugin to save server data after editing properties. That's the only way how to get java.platform attribute in properties file for server registered from wizard. I saw that java.platform value was restored correctly after netbeans were restarted.
Fixed in trunk - http://hg.netbeans.org/core-main/rev/2cbbafb6d1c9 Transplanted to release73 - http://hg.netbeans.org/releases/rev/0f4ae5474e71
It still doesn't work correctly. Steps to reproduce with today's build NetBeans IDE 7.3.1 Dev 201304152201 1) run the installer 2) choose JDK 6 as JDK for IDE 3) choose JDK 7 as JDK for GlassFish 4) start IDE 5) open popup menu over Services|Server|GlassFish Server 4.0 6) invoke Start ==> GlassFish starts on JDK 7 but the scenario bellow doesn't work 1) run the installer 2) choose JDK 6 as JDK for IDE 3) choose JDK 7 as JDK for GlassFish 4) start IDE 5) open popup menu over Services|Server|GlassFish Server 4.0 (the same as before) 6) open Properties and close w/o any modification 7) open popup menu over Services|Server|GlassFish Server 4.0 again 8) invoke Start ==> GlassFish won't start, only a dialog for browsing JDK 7 is shown
Integrated into 'releases', will be available in build *201304162201* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/6725de5bd527 User: Tomas Kraus <TomasKraus@netbeans.org> Log: #228433 - Save and load GlassFish instance attributes after properties being changed
Integrated into 'main-golden', will be available in build *201304172301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/2cbbafb6d1c9 User: Jiri Rechtacek <jrechtacek@netbeans.org> Log: #228433: Start GF domain on JDK chosen in IDE installer
JDK chosen from installer is not registered as java platform in NetBeans and properties editor will not find it. That's why this value is lost.
Optimal solution is to register JDK selected for GlassFish as a platform in NetBeans. But it should be done in installer itself. JDK unknown to platform manager is replaced with default platform. In Bug# 228451 I was asked to follow behavior of platform manager so I removed code that was able to manage platforms not registered in platform manager and that allowed to keep stored value untouched even when it was not registered.
Closing this as resolved, Java platform for GlassFish should be registered in NetBeans from installer. It will be then recognized properly by properties editor.
(In reply to comment #11) > Closing this as resolved, Java platform for GlassFish should be registered in > NetBeans from installer. It will be then recognized properly by properties > editor. I don't think it's good idea to mix up registration of Java Platforms in IDE (primarily purpose is for developing Java-based applications) with JDK for running runtimes bundled with IDE. Can be JDK for GF independent of JDK for Java application?
Well, I'm afraid that I'm not the one to decide this. I would like to see opinion of Petr Hejl / Petr Jiricka before implementing such a thing.
(In reply to comment #12) > (In reply to comment #11) > > Closing this as resolved, Java platform for GlassFish should be registered in > > NetBeans from installer. It will be then recognized properly by properties > > editor. > > I don't think it's good idea to mix up registration of Java Platforms in IDE > (primarily purpose is for developing Java-based applications) with JDK for > running runtimes bundled with IDE. Can be JDK for GF independent of JDK for > Java application? My opinion is this would not mix anything up. Quite the opposite. The JDK GF is running on is the JDK for developing apps. Also there is no concept of runtime platforms and development platforms so far. Seems to be weird for the user to select the JDK for GF and later to configure it once again in the IDE in order to develop EE7 apps on JDK7. Am I missing something? Registering JDK does not do any harm but certainly may help the user.
The best places to create the needed JDK 7 platform are the entry points of the GF integration module. Installer should not create the platform as the platform will be created even for users who don't need it and it may be strange from user point of view.
The only entry point in the plugin is instance provider where stored instances are being loaded. I can register platform if it's home directory is not registered and it's valid JDK.
There is a friend API to create a new J2SEPlatform in the java.j2seplatform module, the class is org.netbeans.modules.java.j2seplatform.api.J2SEPlatformCreator I will need to add the module among the friend modules. What is the module name?
It's glassfish.commonm (org.netbeans.modules.glassfish.common).
checked into web-main: ---------------------- changeset: 251172:171ec915234c branch: javaee7 summary: #228433 - Register unknown Java platform in plugin This will register platform stored in GF properties when it's unknown to platform manager.
Integrated into 'releases', will be available in build *201304242201* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/171ec915234c User: Tomas Kraus <TomasKraus@netbeans.org> Log: #228433 - Register unknown Java platform in plugin
Verified in: Product Version = NetBeans IDE 7.3.1 (Build 201304242201) (#8d14d57eeddb) Operating System = Linux version 3.0.0-32-generic running on i386 Java; VM; Vendor = 1.6.0_41; Java HotSpot(TM) Client VM 20.14-b01; Sun Microsystems Inc. Runtime = Java(TM) SE Runtime Environment 1.6.0_41-b02 Java Home = /usr/local/share/java/jdk1.6.0_41/jre
Integrated into 'main-golden', will be available in build *201304252301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/171ec915234c User: Tomas Kraus <TomasKraus@netbeans.org> Log: #228433 - Register unknown Java platform in plugin