I decode a CRS from its EPSG code using:

CoordinateReferenceSystem crs = CRS.decode("EPSG:3035");

This works like a charm, but when the same line of code is executed from an executable *.jar program, the following error occurs:

Exception in thread "main" org.opengis.referencing.NoSuchAuthorityCodeException: No code "EPSG:3035" for authority "EPSG" was found for an object of type "EngineeringCRS".

It seems the EPSG codes can no longer be decoded. This is confirmed by:


which returns

[EPSG, http://www.opengis.net/gml, http://www.opengis.net/def, AUTO2, AUTO, urn:ogc:def, urn:x-ogc:def, CRS]


from the original code, but:

[EPSG, http://www.opengis.net/gml, AUTO2, AUTO, urn:ogc:def, urn:x-ogc:def, CRS, http://www.opengis.net/def]


once executed from the *.jar program.

I am stuck for hours with this issue...

Changing the dependency from gt-epsg-hsql to gt-epsg-wkt did not fix the problem. When unzipping the *.jar file, the EPSG database is there, but it seems it cannot be read.

The *.jar program is produced using the maven-assembly-plugin.

1 Answer 1


I missed this section of the FAQ, which describes a proper way to produce an executable *.jar from GeoTools.

Using maven-shade-plugin instead of maven-assembly-plugin fixed the issue. I had in addition to deal with invalid signatures as described here.

This is how the pom.xml looks like in the end:

                            implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.