JDK-6695609 : wmic is called on every method call of RegistrationData.loadFromXML
  • Type: Bug
  • Component: install
  • Sub-Component: servicetags
  • Affected Version: 6u5
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: windows
  • CPU: generic
  • Submitted: 2008-04-29
  • Updated: 2013-06-04
  • Resolved: 2008-11-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6u12 b01Fixed
Related Reports
Relates :  
Description
It was designed that wmic is called only once to obtain the system environmental data.  Apparently, at every NetBeans IDE startup, wmic is invoked 5 times repeatedly. It is called on every call of RegistrationData.loadFromXML().

       at java.lang.Thread.dumpStack(Thread.java:1206)
       at org.netbeans.modules.servicetag.WindowsSystemEnvironment.getWmicResult(WindowsSystemEnvironment.java:121)
       at org.netbeans.modules.servicetag.WindowsSystemEnvironment.<init>(WindowsSystemEnvironment.java:75)
       at org.netbeans.modules.servicetag.SystemEnvironment.getSystemEnvironment(SystemEnvironment.java:83)
       at org.netbeans.modules.servicetag.RegistrationData.initEnvironment(RegistrationData.java:241)
       at org.netbeans.modules.servicetag.RegistrationData.<init>(RegistrationData.java:235)
       at org.netbeans.modules.servicetag.RegistrationDocument.load(RegistrationDocument.java:125)
       at org.netbeans.modules.servicetag.RegistrationData.loadFromXML(RegistrationData.java:426)
       at org.netbeans.modules.reglib.NbServiceTagSupport.getRegistrationData(NbServiceTagSupport.java:373)
       at org.netbeans.modules.reglib.NbServiceTagSupport.getNbServiceTag(NbServiceTagSupport.java:453)
       at org.netbeans.modules.reglib.NbServiceTagSupport.createNbServiceTag(NbServiceTagSupport.java:171)
       at org.netbeans.modules.registration.NbInstaller.restored(NbInstaller.java:98)
       at org.netbeans.core.startup.NbInstaller.loadCode(NbInstaller.java:419)
       at org.netbeans.core.startup.NbInstaller.load(NbInstaller.java:340)
       at org.netbeans.ModuleManager.enable(ModuleManager.java:936)
       at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:428)
       at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:364)
       at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:276)
       at org.netbeans.core.startup.Main.getModuleSystem(Main.java:163)
       at org.netbeans.core.startup.Main.start(Main.java:314)
       at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:110)
       at java.lang.Thread.run(Thread.java:619)

Comments
SUGGESTED FIX ------- RegistrationData.java ------- 177,178c177,179 < private final Map<String, String> environment; < private final Map<String, ServiceTag> svcTagMap; --- > private final Map<String, String> environment = initEnvironment(); > private final Map<String, ServiceTag> svcTagMap = > new LinkedHashMap<String, ServiceTag>(); 194c195,205 < this(Util.generateURN()); --- > this.urn = Util.generateURN(); > SystemEnvironment sysEnv = SystemEnvironment.getSystemEnvironment(); > setEnvironment(ST_NODE_HOSTNAME, sysEnv.getHostname()); > setEnvironment(ST_NODE_HOST_ID, sysEnv.getHostId()); > setEnvironment(ST_NODE_OS_NAME, sysEnv.getOsName()); > setEnvironment(ST_NODE_OS_VERSION, sysEnv.getOsVersion()); > setEnvironment(ST_NODE_OS_ARCH, sysEnv.getOsArchitecture()); > setEnvironment(ST_NODE_SYSTEM_MODEL, sysEnv.getSystemModel()); > setEnvironment(ST_NODE_SYSTEM_MANUFACTURER, sysEnv.getSystemManufacturer()); > setEnvironment(ST_NODE_CPU_MANUFACTURER, sysEnv.getCpuManufacturer());> setEnvironment(ST_NODE_SERIAL_NUMBER, sysEnv.getSerialNumber()); 200,201d210 < this.environment = initEnvironment(); < this.svcTagMap = new LinkedHashMap<String, ServiceTag>(); 206,215c215,223 < SystemEnvironment sysEnv = SystemEnvironment.getSystemEnvironment(); < map.put(ST_NODE_HOSTNAME, sysEnv.getHostname()); < map.put(ST_NODE_HOST_ID, sysEnv.getHostId()); < map.put(ST_NODE_OS_NAME, sysEnv.getOsName()); < map.put(ST_NODE_OS_VERSION, sysEnv.getOsVersion()); < map.put(ST_NODE_OS_ARCH, sysEnv.getOsArchitecture()); < map.put(ST_NODE_SYSTEM_MODEL, sysEnv.getSystemModel()); < map.put(ST_NODE_SYSTEM_MANUFACTURER, sysEnv.getSystemManufacturer()); < map.put(ST_NODE_CPU_MANUFACTURER, sysEnv.getCpuManufacturer()); < map.put(ST_NODE_SERIAL_NUMBER, sysEnv.getSerialNumber()); --- > map.put(ST_NODE_HOSTNAME, ""); > map.put(ST_NODE_HOST_ID, ""); > map.put(ST_NODE_OS_NAME, ""); > map.put(ST_NODE_OS_VERSION, ""); > map.put(ST_NODE_OS_ARCH, ""); > map.put(ST_NODE_SYSTEM_MODEL, ""); > map.put(ST_NODE_SYSTEM_MANUFACTURER, ""); > map.put(ST_NODE_CPU_MANUFACTURER, ""); > map.put(ST_NODE_SERIAL_NUMBER, "");
11-09-2008

EVALUATION The RegistrationData() should only call the initEnvironment() method when creating a brand new RegistrationData object but not loading from a XML file.
29-04-2008