{"record":{"id":"93f8cccc9aff1e2f","repo":"apereo/cas","slug":"geo-locating-an-address-by-latitude-longitude","errorCode":null,"errorMessage":"Geo-locating an address by latitude/longitude [{}]/[{}] is not supported","messagePattern":"Geo-locating an address by latitude/longitude \\[(.+?)\\]/\\[(.+?)\\] is not supported","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"support/cas-server-support-geolocation-maxmind/src/main/java/org/apereo/cas/support/geo/maxmind/MaxmindDatabaseGeoLocationService.java","lineNumber":81,"sourceCode":"                collectGeographicalPosition(location, cityResponse);\n\n                val countryResponse = client.country(address);\n                location.addAddress(countryResponse.country().name());\n            }\n\n            LOGGER.debug(\"Geo location for [{}] is calculated as [{}]\", address, location);\n            return location;\n        } catch (final AddressNotFoundException e) {\n            LOGGER.info(e.getMessage(), e);\n        } catch (final Exception e) {\n            LoggingUtils.error(LOGGER, e);\n        }\n        return null;\n    }\n\n    @Override\n    public @Nullable GeoLocationResponse locate(final Double latitude, final Double longitude) {\n        LOGGER.warn(\"Geo-locating an address by latitude/longitude [{}]/[{}] is not supported\", latitude, longitude);\n        return null;\n    }\n\n    protected WebServiceClient buildWebServiceClient() {\n        return Optional.ofNullable(this.webServiceClient).orElseGet(\n            () -> new WebServiceClient.Builder(properties.getAccountId(), properties.getLicenseKey())\n                .host(\"geolite.info\")\n                .requestTimeout(Duration.ofSeconds(5))\n                .proxy(ProxySelector.getDefault())\n                .build());\n    }\n\n    private static void collectGeographicalPosition(final GeoLocationResponse location,\n                                                    final CityResponse response) {\n        val loc = response.location();\n        if (loc != null) {\n            if (loc.latitude() != null) {\n                location.setLatitude(loc.latitude());","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/apereo/cas/blob/e7288fc434b4f4505b8452e1a57e8fb3111bb863/support/cas-server-support-geolocation-maxmind/src/main/java/org/apereo/cas/support/geo/maxmind/MaxmindDatabaseGeoLocationService.java#L63-L99","documentation":"MaxmindDatabaseGeoLocationService only implements geolocation by IP address. The locate(Double latitude, Double longitude) overload is explicitly unsupported and always logs this warning and returns null. Callers requesting coordinate-based lookup get no result by design.","triggerScenarios":"Any code path (e.g. geolocation service invocations from adaptive authentication or user-profile flows) that calls locate(latitude, longitude) against the Maxmind-backed service.","commonSituations":"Modules or custom code that assume all GeoLocationService implementations support coordinate lookup; switching the configured geolocation provider from a coordinate-capable one to the Maxmind IP database.","solutions":["Use address/IP-based geolocation instead of coordinates with this service","Implement a custom GeoLocationService that supports lat/long (e.g. backed by a different API) if coordinate lookup is required","Do not route coordinate-based geolocation requests to the Maxmind database service"],"exampleFix":"// before\ngeoLocationService.locate(40.7128, -74.0060); // always null\n// after\ngeoLocationService.locate(InetAddress.getByName(\"8.8.8.8\"));","handlingStrategy":"type-guard","validationCode":"if (geoService instanceof MaxmindDatabaseGeoLocationService) {\n    LOGGER.warn(\"coordinate lookup unsupported; use IP/address lookup\");\n}","typeGuard":"boolean supportsCoordinateLookup(GeoLocationService s) { return !(s instanceof MaxmindDatabaseGeoLocationService); }","tryCatchPattern":null,"preventionTips":["Check the GeoLocationService implementation's supported methods before choosing lookup style","Wrap coordinate lookups behind an adapter that falls back to IP lookup","Document per-provider capability in your integration code"],"tags":["geolocation","maxmind","unsupported-operation","lat-long"],"backgroundTag":"unsupported-operation","analyzedSha":"e7288fc434b4f4505b8452e1a57e8fb3111bb863","analyzedAt":"2026-09-08T15:39:16.015Z","contentChangedAt":"2026-09-08T15:39:16.015Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}