awips2 icon indicating copy to clipboard operation
awips2 copied to clipboard

MetarDecoder: EDEX - null - Unable to decode METAR/SPECI

Open mjames-upc opened this issue 6 years ago • 1 comments

ERROR 2019-01-29 23:56:12,368 3393 [Ingest.obs-1] MetarDecoder: EDEX - null - Unable to decode METAR/SPECI
java.util.IllegalFormatConversionException: Y != java.lang.String
        at java.util.Formatter$FormatSpecifier.failConversion(Formatter.java:4302) ~[na:1.8.0_101]
        at java.util.Formatter$FormatSpecifier.printDateTime(Formatter.java:2835) ~[na:1.8.0_101]
        at java.util.Formatter$FormatSpecifier.print(Formatter.java:2740) ~[na:1.8.0_101]
        at java.util.Formatter.format(Formatter.java:2526) ~[na:1.8.0_101]
        at java.util.Formatter.format(Formatter.java:2455) ~[na:1.8.0_101]
        at java.lang.String.format(String.java:2940) ~[na:1.8.0_101]
        at com.raytheon.edex.plugin.obs.metar.MetarDecoder.decode(MetarDecoder.java:848) ~[com.raytheon.edex.plugin.obs.jar:na]
        at com.raytheon.edex.plugin.obs.ObsDecoder.decode(ObsDecoder.java:89) [com.raytheon.edex.plugin.obs.jar:na]
        at sun.reflect.GeneratedMethodAccessor225.invoke(Unknown Source) ~[na:na]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_101]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_101]
        at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:458) [camel-core-2.18.3.jar:2.18.3]

mjames-upc avatar Jan 29 '19 23:01 mjames-upc

Looks like the problem may be the format statement at com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/metar/MetarDecoder.java:848

String dt = String .format("%d hour precip reported from %s at %2$tY%2$tm%2$td %2$tH%2$tM", obsHr, record.getStationId(), record.getTimeObs());

Note that the date/time format is looking for the 2nd data item and should be using the 3rd item "record.getTimeObs()"

The format statement should read %d hour precip reported from %s at %3$tY%3$tm%3$td %3$tH%3$tM

jrkorman avatar Aug 31 '21 00:08 jrkorman