open-power / serverwiz

Apache License 2.0
4 stars 18 forks source link

Can't add module-module-dellovo instance #16

Closed alvintpwang closed 8 years ago

alvintpwang commented 8 years ago

Reproduce steps:

  1. Add module-module-dellovo
  2. Save and it will pop up error. The log is as follows

3/08/2016 03:47:49.141 - ServerWiz2 Starting... 03:47:49.712 - [INFO] - Loading Attributes: D:\serverwiz\xml\attribute_types.xml 03:47:49.915 - [INFO] - Loading Attributes: D:\serverwiz\xml\attribute_types_hb.xml 03:47:49.949 - [INFO] - Loading Attributes: D:\serverwiz\xml\attribute_types_mrw.xml 03:47:49.967 - [INFO] - Loading Target Types: D:\serverwiz\xml\target_types_mrw.xml 03:47:49.997 - [INFO] - Loading Instances: D:\serverwiz\xml\target_instances_v3.xml 03:48:04.003 - [INFO] - D:\workdir\serverwiz_test\daan.xml Saved 03:48:29.637 - [SEVERE] - Invalid Child target id: p8p_occ-0 java.lang.NullPointerException at com.ibm.ServerWizard2.Target.writeInstanceXML(Unknown Source) at com.ibm.ServerWizard2.Target.writeInstanceXML(Unknown Source) at com.ibm.ServerWizard2.Target.writeInstanceXML(Unknown Source) at com.ibm.ServerWizard2.Target.writeInstanceXML(Unknown Source) at com.ibm.ServerWizard2.Target.writeInstanceXML(Unknown Source) at com.ibm.ServerWizard2.Target.writeInstanceXML(Unknown Source) at com.ibm.ServerWizard2.SystemModel.writeXML(Unknown Source) at com.ibm.ServerWizard2.TargetWizardController.writeXML(Unknown Source) at com.ibm.ServerWizard2.MainDialog$4.widgetSelected(Unknown Source) at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source) at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Display.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source) at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source) at org.eclipse.jface.window.Window.runEventLoop(Window.java:832) at org.eclipse.jface.window.Window.open(Window.java:808) at com.ibm.ServerWizard2.ServerWizard2.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.simontuffs.onejar.Boot.run(Boot.java:342) at com.simontuffs.onejar.Boot.main(Boot.java:168)

Root cause

The root cause is "p8p_occ-0" target instance missing in target_instances_v3.xml. I added the p8p_occ-0 in target_instances_v3.xml and it can fix this issue.

<targetInstance>
    <type>occ</type>
    <id>p8p_occ-0</id>
    <hidden_child_id>occ_active_sensor</hidden_child_id>
    <attribute>
        <id>CHIP_UNIT</id>
        <default>0</default>
    </attribute>
</targetInstance>
nkskjames commented 8 years ago

this is fixed with refactoring