Reputation: 1161
Using the new GUI builder, I have a simple GUI builder container that causes an error on build, despite of the fact that I did not touch the xml manually. This was built with the latest version of the cn1 netbeans plugin (v3.8). The error I get is:
javax.xml.bind.UnmarshalException
- with linked exception:
[org.xml.sax.SAXParseException; systemId: file:/Users/yaakov/Development/workspace/medonline/medonline-cn1-new/MedonlineCn1/res/guibuilder/il/co/medonline/forms/components/DoctorListItem.gui; lineNumber: 9; columnNumber: 76; An invalid XML character (Unicode: 0x8) was found in the value of attribute "name" and element is "component".]
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmarshalException(AbstractUnmarshallerImpl.java:335)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.createUnmarshalException(UnmarshallerImpl.java:563)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:249)
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:214)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:157)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:162)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:171)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:189)
at com.codename1.build.client.GenerateGuiSources.generateGuiSource(GenerateGuiSources.java:241)
at com.codename1.build.client.GenerateGuiSources.generateGuiSource(GenerateGuiSources.java:231)
at com.codename1.build.client.GenerateGuiSources.execute(GenerateGuiSources.java:202)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor201.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:286)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:555)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
My .gui
file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<component type="Container" layout="LayeredLayout" layeredLayoutPreferredWidthMM="0.0" layeredLayoutPreferredHeightMM="0.0" autolayout="true" name="DoctorListItem">
<component type="Container" layout="BoxLayout" boxLayoutAxis="Y" name="Container">
<layoutConstraint insets="0px 0px 0px 0px" referenceComponents="-1 -1 -1 -1" referencePositions="0.0 0.0 0.0 0.0" />
<component type="Container" layout="BorderLayout" borderLayoutAbsoluteCenter="false" name="Container_2">
<component type="Container" layout="FlowLayout" flowLayoutFillRows="false" flowLayoutAlign="1" flowLayoutValign="0" uiid="PaddedContainer" name="Container_3">
<layoutConstraint value="West" />
<component type="Button" uiid="MarginlessContainer" name="ExpertPic">
</component>
</component>
<component type="Container" layout="BoxLayout" boxLayoutAxis="Y" name="Container_4">
<layoutConstraint value="East" />
<component type="SpanLabel" name="ExpertArea">
<custom name="textUiid" type="java.lang.String" value="LargeText"/>
</component>
<component type="SpanButton" uiid="TopPaddedContainer" name="ExpertName">
<custom name="textUiid" type="java.lang.String" value="BoldText"/>
</component>
<component type="SpanLabel" name="ExpertSubtitle">
<custom name="textUiid" type="java.lang.String" value="LargeText"/>
</component>
</component>
</component>
<component type="Container" layout="FlowLayout" flowLayoutFillRows="false" flowLayoutAlign="1" flowLayoutValign="0" uiid="DocListLowerHalf" name="Container_1">
<component type="SpanLabel" name="ExpertShortDesc">
<custom name="textUiid" type="java.lang.String" value="SmallText"/>
</component>
</component>
</component>
</component>
Any help will be greatly appreciated
Update
Running the app in the simulator normally produces no error, but the file doesn't seem to be building - the components I added in the GUI builder don't get generated in the java file. When I try running Build
or running the app in debug mode, the error appears and the execution is stopped.
Upvotes: 1
Views: 52
Reputation: 52760
This seems to be a bug in the GUI builder that somehow got the 0x8
character (backspace) into the output. You don't see this character in the editor since it's invisible. Open the file in your editor and retype the "name" entry in line 8 then save. It should workaround this specific error. If additional errors like this exist notice the parser writes the specific line and attribute where corrupted data was saved.
Upvotes: 1