【问题标题】:issue with writing to KML file using JavaAPIForKML使用 JavaAPIForKML 写入 KML 文件的问题
【发布时间】:2012-12-18 13:31:07
【问题描述】:

我试图从文本文件生成 KML 文件。 当我尝试编组内存文件时,出现以下异常。 有什么线索吗?

javax.xml.bind.PropertyException: name: com.sun.xml.bind.namespacePrefixMapper value: de.micromata.opengis.kml.v_2_2_0.Kml$NameSpaceBeautyfier@1cfa4b2
    at javax.xml.bind.helpers.AbstractMarshallerImpl.setProperty(Unknown Source)
    at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.setProperty(Unknown Source)
    at de.micromata.opengis.kml.v_2_2_0.Kml.createMarshaller(Kml.java:642)
    at de.micromata.opengis.kml.v_2_2_0.Kml.marshal(Kml.java:682)
    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 sun.reflect.misc.Trampoline.invoke(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at sun.reflect.misc.MethodUtil.invoke(Unknown Source)

【问题讨论】:

    标签: java jaxb eclipse-rcp kml jak


    【解决方案1】:

    使用com.sun.xml.bind.namespacePrefixMapper 时,您需要确保您的类路径中有JAXB RI(或EclipseLink JAXB (MOXy)

    JDK 包含 JAXB RI 的包重命名版本,因此您可以尝试使用以下属性名称:

    com.sun.xml.internal.bind.namespacePrefixMapper
    

    更多信息

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-20
      相关资源
      最近更新 更多