当我尝试org.apache.jena.geosparql.implementation.SRSInfo
在 JUnit 测试函数中初始化 Object 时,我得到一个java.lang.ExceptionInInitializerError
,堆栈跟踪是:
Caused by: java.lang.ArrayStoreException: org.geotools.referencing.factory.epsg.FactoryUsingWKT
at org.apache.sis.internal.referencing.LazySet.cache(LazySet.java:219)
at org.apache.sis.internal.referencing.LazySet.get(LazySet.java:256)
at org.apache.sis.internal.referencing.LazySet$1.next(LazySet.java:282)
at org.apache.sis.referencing.factory.MultiAuthoritiesFactory.getAuthorityFactory(MultiAuthoritiesFactory.java:687)
at org.apache.sis.referencing.factory.MultiAuthoritiesFactory.create(MultiAuthoritiesFactory.java:861)
at org.apache.sis.referencing.factory.MultiAuthoritiesFactory.createCoordinateReferenceSystem(MultiAuthoritiesFactory.java:922)
at org.apache.sis.referencing.CRS.forCode(CRS.java:234)
at org.apache.jena.geosparql.implementation.SRSInfo.getDefaultWktCRS84(SRSInfo.java:242)
at org.apache.jena.geosparql.implementation.SRSInfo.<clinit>(SRSInfo.java:51)
... 26 more
我CRS.forCode
直接测试了这个功能,但得到了同样的错误。
文件显示derby.log
有异常
java.sql.SQLException: Database 'classpath:SIS_DATA/Databases/SpatialMetadata' not found.
Caused by: ERROR XJ004: Database 'classpath:SIS_DATA/Databases/SpatialMetadata' not found.
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown Source)
... 18 more
我添加了 Maven 依赖项sis-embedded-data
<dependency>
<groupId>org.apache.sis.non-free</groupId>
<artifactId>sis-embedded-data</artifactId>
<version>1.0</version>
<scope>runtime</scope>
</dependency>
我也尝试添加sis-epsg
依赖项并设置SIS_DATA
环境变量,但遇到了类似的错误。
<dependency>
<groupId>org.apache.sis.non-free</groupId>
<artifactId>sis-epsg</artifactId>
<version>1.0</version>
<scope>runtime</scope>
</dependency>
任何想法来解决这个问题?