diff --git a/pom.xml b/pom.xml index 935ee899..a204db2a 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ Aviation weather message conversions - IWXXM module fi.fmi.avi.converter fmi-avi-messageconverter-iwxxm - 0.11.1.K-SNAPSHOT + 0.11.2.K-SNAPSHOT ${scm-url} @@ -83,7 +83,7 @@ fi.fmi.avi.converter fmi-avi-messageconverter - 3.6.1-SNAPSHOT + 3.6.1.K-SNAPSHOT @@ -111,7 +111,26 @@ JAXBNamespacePrefixMapper 2.2.4 - + + + com.sun.xml.bind + jaxb-core + compile + 2.3.0.1 + + + com.sun.xml.bind + jaxb-impl + compile + 2.3.0.1 + + + javax.xml.bind + jaxb-api + compile + 2.4.0-b180830.0359 + + commons-io commons-io diff --git a/src/main/java/fi/fmi/avi/converter/iwxxm/AbstractIWXXMSerializer.java b/src/main/java/fi/fmi/avi/converter/iwxxm/AbstractIWXXMSerializer.java index 8e5953f1..fca34561 100644 --- a/src/main/java/fi/fmi/avi/converter/iwxxm/AbstractIWXXMSerializer.java +++ b/src/main/java/fi/fmi/avi/converter/iwxxm/AbstractIWXXMSerializer.java @@ -87,7 +87,7 @@ protected Document renderXMLDocument(final Object input, final ConversionHints h "http://icao.int/iwxxm/2.1 http://schemas.wmo.int/iwxxm/2.1.1/iwxxm.xsd http://def.wmo.int/metce/2013 " + "http://schemas.wmo.int/metce/1.2/metce.xsd http://def.wmo.int/collect/2014 http://schemas.wmo.int/collect/1.2/collect.xsd " + "http://www.opengis.net/samplingSpatial/2.0 http://schemas.opengis.net/samplingSpatial/2.0/spatialSamplingFeature.xsd"); - marshaller.setProperty("com.sun.xml.internal.bind.namespacePrefixMapper", new IWXXMNamespaceContext()); + marshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper", new IWXXMNamespaceContext()); marshaller.marshal(wrap(input, (Class) input.getClass()), sw); return asCleanedUpXML(sw.toString(), hints); } catch (final JAXBException e) { diff --git a/src/main/java/fi/fmi/avi/converter/iwxxm/IWXXMConverterBase.java b/src/main/java/fi/fmi/avi/converter/iwxxm/IWXXMConverterBase.java index 52162f5a..bc10804e 100644 --- a/src/main/java/fi/fmi/avi/converter/iwxxm/IWXXMConverterBase.java +++ b/src/main/java/fi/fmi/avi/converter/iwxxm/IWXXMConverterBase.java @@ -196,7 +196,7 @@ protected static void validateDocument(final S input, final Class clz, fi final Marshaller marshaller = getJAXBContext().createMarshaller(); marshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8"); marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, schemaLocation); - marshaller.setProperty("com.sun.xml.internal.bind.namespacePrefixMapper", new IWXXMNamespaceContext()); + marshaller.setProperty("com.sun.xml.bind.namespacePrefixMapper", new IWXXMNamespaceContext()); marshaller.setSchema(schemaFactory.newSchema(schemaSources)); marshaller.setEventHandler(eventHandler); diff --git a/src/main/java/fi/fmi/avi/converter/iwxxm/IWXXMNamespaceContext.java b/src/main/java/fi/fmi/avi/converter/iwxxm/IWXXMNamespaceContext.java index 1e5387dd..627071e7 100644 --- a/src/main/java/fi/fmi/avi/converter/iwxxm/IWXXMNamespaceContext.java +++ b/src/main/java/fi/fmi/avi/converter/iwxxm/IWXXMNamespaceContext.java @@ -7,7 +7,7 @@ import javax.xml.namespace.NamespaceContext; -import com.sun.xml.internal.bind.marshaller.NamespacePrefixMapper; +import com.sun.xml.bind.marshaller.NamespacePrefixMapper; /** diff --git a/src/main/java/fi/fmi/avi/converter/iwxxm/airmet/AbstractAIRMETIWXXMSerializer.java b/src/main/java/fi/fmi/avi/converter/iwxxm/airmet/AbstractAIRMETIWXXMSerializer.java index 6246fa15..8fe493fc 100644 --- a/src/main/java/fi/fmi/avi/converter/iwxxm/airmet/AbstractAIRMETIWXXMSerializer.java +++ b/src/main/java/fi/fmi/avi/converter/iwxxm/airmet/AbstractAIRMETIWXXMSerializer.java @@ -218,10 +218,8 @@ public ConversionResult convertMessage(final AIRMET input, final ConversionHi if (eventHandler.errorsFound()) { result.setStatus(Status.FAIL); - System.err.println("FAILED in eventhandler"); for (ConversionIssue iss: eventHandler.getResult().getConversionIssues()) { System.err.println("Validation issue: "+iss.getMessage()); - result.addIssue(new ConversionIssue(ConversionIssue.Severity.ERROR, ConversionIssue.Type.OTHER, iss.getMessage())); } } else { result.setConvertedMessage(this.render(airmet, hints)); diff --git a/src/main/java/fi/fmi/avi/converter/iwxxm/sigmet/AbstractSIGMETIWXXMSerializer.java b/src/main/java/fi/fmi/avi/converter/iwxxm/sigmet/AbstractSIGMETIWXXMSerializer.java index 487bffcf..76027eab 100644 --- a/src/main/java/fi/fmi/avi/converter/iwxxm/sigmet/AbstractSIGMETIWXXMSerializer.java +++ b/src/main/java/fi/fmi/avi/converter/iwxxm/sigmet/AbstractSIGMETIWXXMSerializer.java @@ -306,6 +306,7 @@ public ConversionResult convertMessage(final SIGMET input, final ConversionHi { result.setStatus(Status.SUCCESS); this.updateMessageMetadata(input, result, sigmet); + ConverterValidationEventHandler eventHandler = new ConverterValidationEventHandler(result); if (input.getSigmetPhenomenon().equals(AviationCodeListUser.AeronauticalSignificantWeatherPhenomenon.VA)) { this.validateDocument(((VolcanicAshSIGMETType) sigmet), VolcanicAshSIGMETType.class, hints, eventHandler); //TODO true is for debugging: shows