【发布时间】:2018-05-07 00:23:50
【问题描述】:
使用新的 GUI 构建器,我有一个简单的 GUI 构建器容器,尽管我没有手动触摸 xml,但它会导致构建错误。这是使用最新版本的 cn1 netbeans 插件 (v3.8) 构建的。我得到的错误是:
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)
我的.gui 文件如下所示:
<?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>
任何帮助将不胜感激
更新
在模拟器中运行应用程序通常不会产生错误,但文件似乎没有构建 - 我在 GUI 构建器中添加的组件不会在 java 文件中生成。当我尝试运行Build 或在调试模式下运行应用程序时,出现错误并停止执行。
【问题讨论】:
标签: xml codenameone