Fails to load gt-psg-hsql jar from executable jar

Description

Although the project dependencies include gt-epsg-hsql-11.3.jar and the created executable jar includes gt-epsg-hsql-11.3.jar, executing it results in:

org.opengis.referencing.NoSuchAuthorityCodeException: No code "EPSG:2193" from authority "EPSG" found for object of type
"EngineeringCRS".
at org.geotools.referencing.factory.epsg.CartesianAuthorityFactory.noSuchAuthorityException(CartesianAuthorityFactory.java:136)
at org.geotools.referencing.factory.epsg.CartesianAuthorityFactory.createEngineeringCRS(CartesianAuthorityFactory.java:130)
at org.geotools.referencing.factory.epsg.CartesianAuthorityFactory.createCoordinateReferenceSystem(CartesianAuthorityFactory.java:121)
at org.geotools.referencing.factory.AbstractAuthorityFactory.createProjectedCRS(AbstractAuthorityFactory.java:716)
at org.geotools.referencing.factory.AuthorityFactoryAdapter.createProjectedCRS(AuthorityFactoryAdapter.java:878)

at org.geotools.referencing.factory.ThreadedAuthorityFactory.createProjectedCRS(ThreadedAuthorityFactory.java:864)
at maps.Global.<clinit>(Global.java:70)
at UserInterface.Gui.initialize(Gui.java:266)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.load(Unknown Source)
at frankv.mapping.MainApp.start(MainApp.java:24)
at com.sun.javafx.application.LauncherImpl$8.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl$7.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl$6$1.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl$6$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl$6.run(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$300(Unknown Source)
at com.sun.glass.ui.win.WinApplication$4$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

My Global.java:70 line says

CRSAuthorityFactory authorityFactory = CRS.getAuthorityFactory(true);

Putting the gt-epsg-hsql-11.3.jar file into the current working directory is a workaround.

Verified in v11.3, but I suspect this relates to much earlier versions as well.

Comment: This seems similar to a JavaFX problem I reported https://netbeans.org/bugzilla/show_bug.cgi?id=248080 - https://netbeans.org/bugzilla/show_bug.cgi?id=248080 where getClass().getResource() fails to find an embedded file, but getClass().getResourceAsStream() does find it.

Environment

None

Assignee

Unassigned

Reporter

codehaus

Triage

None

Affects versions

Priority

Low
Configure