2

我试图从文本文件生成 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)
4

1 回答 1

0

When using the com.sun.xml.bind.namespacePrefixMapper you need to ensure that you have the JAXB RI (or EclipseLink JAXB (MOXy) on your class path.

The JDK contains a package renamed version of the JAXB RI so you could try the following property name instead:

com.sun.xml.internal.bind.namespacePrefixMapper

For More Information

于 2012-12-18T19:58:22.857 回答