构建

时间:2017-11-23 06:08:32

标签: xml codenameone

使用新的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或运行应用程序时,会出现错误并停止执行。

1 个答案:

答案 0 :(得分:1)

这似乎是GUI构建器中的一个错误,它以某种方式将0x8字符(退格)输入到输出中。你不会在编辑器中看到这个角色,因为它是不可见的。在编辑器中打开文件,然后重新键入&#34; name&#34;在第8行输入然后保存。它应解决此特定错误。如果存在此类其他错误,请注意解析器会写入保存损坏数据的特定行和属性。