[geotk] GML Marshaller
Пузова Наталья Вениаминовна
cbmd at meteo.ru
Sat May 25 13:42:41 PDT 2019
Hello!
I got the same exception with the version 5.0 SNAPSHORT (jars from nexus.geomatys.com), JDK 1.8.0_71. Develop and run under NetBeans 8.2
My sample code:
.........
MarshallerPool poolGml = GMLMarshallerPool.getInstance(); <-- an exception appears in this line
ObjectFactory FACTORY = new ObjectFactory();
try {
Marshaller marshaller = poolGml.acquireMarshaller();
StringWriter sw = new StringWriter();
Duration d1 = javax.xml.datatype.DatatypeFactory.newInstance().newDuration("P2D");
TimePeriodType tp = new TimePeriodType(d1);
marshaller.marshal(FACTORY.createTimePeriod(tp), sw);
TimePositionType tpos = new TimePositionType("2002-08-15");
tp = new TimePeriodType(tpos);
marshaller.marshal(FACTORY.createTimePeriod(tp), sw);
String result = sw.toString();
System.out.println("result:"+result);
} catch (JAXBException | DatatypeConfigurationException ex) {
Logger.getLogger(ReaderXml.class.getName()).log(Level.SEVERE, null, ex);
}
..........
And exception :
Exception in thread "main" java.lang.AssertionError: javax.xml.bind.JAXBException: Provider com.sun.xml.internal.bind.v2.ContextFactory could not be instantiated: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
org.opengis.metadata.Identifier is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at org.opengis.metadata.Identifier
at private java.util.List org.geotoolkit.gml.xml.v321.AbstractGMLType.name
at org.geotoolkit.gml.xml.v321.AbstractGMLType
at org.geotoolkit.gml.xml.v321.DefinitionBaseType
at org.geotoolkit.gml.xml.v321.DefinitionType
at org.geotoolkit.gml.xml.v321.IdentifiedObjectType
at org.geotoolkit.gml.xml.v321.AbstractGeneralOperationParameterType
at org.geotoolkit.gml.xml.v321.OperationParameterGroupType
at private org.geotoolkit.gml.xml.v321.OperationParameterGroupType org.geotoolkit.gml.xml.v321.OperationParameterGroupPropertyType.operationParameterGroup
at org.geotoolkit.gml.xml.v321.OperationParameterGroupPropertyType
at public javax.xml.bind.JAXBElement org.geotoolkit.gml.xml.v321.ObjectFactory.createGroup(org.geotoolkit.gml.xml.v321.OperationParameterGroupPropertyType)
at org.geotoolkit.gml.xml.v321.ObjectFactory
- with linked exception:
[com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
org.opengis.metadata.Identifier is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at org.opengis.metadata.Identifier
at private java.util.List org.geotoolkit.gml.xml.v321.AbstractGMLType.name
at org.geotoolkit.gml.xml.v321.AbstractGMLType
at org.geotoolkit.gml.xml.v321.DefinitionBaseType
at org.geotoolkit.gml.xml.v321.DefinitionType
at org.geotoolkit.gml.xml.v321.IdentifiedObjectType
at org.geotoolkit.gml.xml.v321.AbstractGeneralOperationParameterType
at org.geotoolkit.gml.xml.v321.OperationParameterGroupType
at private org.geotoolkit.gml.xml.v321.OperationParameterGroupType org.geotoolkit.gml.xml.v321.OperationParameterGroupPropertyType.operationParameterGroup
at org.geotoolkit.gml.xml.v321.OperationParameterGroupPropertyType
at public javax.xml.bind.JAXBElement org.geotoolkit.gml.xml.v321.ObjectFactory.createGroup(org.geotoolkit.gml.xml.v321.OperationParameterGroupPropertyType)
at org.geotoolkit.gml.xml.v321.ObjectFactory
]
at org.geotoolkit.gml.xml.GMLMarshallerPool.<clinit>(GMLMarshallerPool.java:43)
at readerxml.ReaderXml.jaxbWigosToFile(ReaderXml.java:295)
at readerxml.ReaderXml.main(ReaderXml.java:120)
Field name in AbstractGMLType is interface org.opengis.metadata.Identifier. What about JAXB version?
Nataliia
От: "cbmd" <cbmd at meteo.ru>
Кому: "Martin Desruisseaux" <martin.desruisseaux at geomatys.com>
Копия: "geotoolkit" <geotoolkit at lists.osgeo.org>
Отправленные: Суббота, 25 Май 2019 г 22:33:47
Тема: Re: [geotk] GML Marshaller
Sorry, I used the version 5.0.0-MC0070. Now I will try latest build
От: "cbmd" <cbmd at meteo.ru>
Кому: "Martin Desruisseaux" <martin.desruisseaux at geomatys.com>
Копия: "geotoolkit" <geotoolkit at lists.osgeo.org>
Отправленные: Суббота, 25 Май 2019 г 14:07:43
Тема: Re: [geotk] GML Marshaller
Hello Martin!
I used ready-made libraries from nexus.geomatys.com (5.0 SNAPSHORT). I will try to use the latest build of May 24, 2019 5.0-20190524.141416-69
От: "Martin Desruisseaux" <martin.desruisseaux at geomatys.com>
Кому: "cbmd" <cbmd at meteo.ru>, geotoolkit at lists.osgeo.org
Отправленные: Пятница, 24 Май 2019 г 17:16:58
Тема: Re: [geotk] GML Marshaller
Le 24/05/2019 à 15:41, Пузова Н.В. a écrit :
Hello Martin!
I use JDK 1.8.0_71.
And which version of Geotk? If you are using 5.0-SNAPSHOT, can you try again with the "-u" option on Maven? (I uploaded updated JAR files in case)
Martin
_______________________________________________
Geotoolkit mailing list
Geotoolkit at lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/geotoolkit
_______________________________________________
Geotoolkit mailing list
Geotoolkit at lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/geotoolkit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geotoolkit/attachments/20190525/0acbac24/attachment.html>
More information about the Geotoolkit
mailing list