2

I was trying to generate KML file from a text file. When I am trying to marshal the memory file, I am getting following exception. Any clue?

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)
CodeMonkey
  • 22,825
  • 4
  • 35
  • 75
Meera Menon
  • 69
  • 1
  • 4

1 Answers1

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

bdoughan
  • 147,609
  • 23
  • 300
  • 400