[geotk] migration to java 11

juergen sorg j.sorg at fz-juelich.de
Thu Mar 4 00:38:32 PST 2021


hi martin,

the exception [1] still occurs after changing the dependencies in the 
way you described. i looked into org.opengis:geoapi-pending:jar:4.0-M15 
in my local maven repo, but there is no Factory class.
in [0] you can find the maven dependencies tree filtered by words 
opengis,geotoolkit and apche.sis

regards
juergen


On 03/03/2021 15:52, Martin Desruisseaux wrote:
> I suggest to remove explicit declaration of Apache SIS dependencies in 
> the pom.xml file and instead inherit the one declared by the CSW module. 
> Geotk uses an Apache SIS milestone more recent than SIS 1.0, which is 
> the reason why we can not make formal release of Geotk (the Geotk 
> developments takes advantage of SIS developments early, which allow us 
> to test SIS extensively during its development phase).
> 
> The only explicit Apache SIS dependency should be for EPSG as below:
> 
>     <dependency>
>        <groupId>org.apache.sis.non-free</groupId>
>        <artifactId>sis-epsg</artifactId>
>        <version>1.0</version>
>        <exclusions>
>          <exclusion>
>            <groupId>org.apache.sis.core</groupId>
>            <artifactId>sis-referencing</artifactId>
>          </exclusion>
>        </exclusions>
>     </dependency>
> 
> The exclusion is because of above-cited mismatch between Apache SIS 
> formal release and the milestones used by Geotk. In the particular case 
> of "sis-epsg" it is okay because this module contains mostly a database 
> with almost no Java code.
> 
>      Martin
> 
> 



[0]
[INFO] +- org.apache.sis.non-free:sis-epsg:jar:1.0:compile
[INFO] +- org.geotoolkit:geotk-client-csw:jar:5.0.0-MC0116:compile
[INFO] |  +- org.geotoolkit:geotk-client-store:jar:5.0.0-MC0116:compile
[INFO] |  |  +- org.geotoolkit:geotk-storage:jar:5.0.0-MC0116:compile
[INFO] |  +- org.geotoolkit:geotk-xml-ebrim:jar:5.0.0-MC0116:compile
[INFO] |  |  \- org.geotoolkit:geotk-xml-csw:jar:5.0.0-MC0116:compile
[INFO] |  |     +- 
org.geotoolkit:geotk-xml-feature-catalogue:jar:5.0.0-MC0116:compile
[INFO] |  |     |  \- org.apache.sis.core:sis-metadata:jar:2.0-M0076:compile
[INFO] |  |     +- org.geotoolkit:geotk-xml-ogc:jar:5.0.0-MC0116:compile
[INFO] |  |     +- org.geotoolkit:geotk-xml-dif:jar:5.0.0-MC0116:compile
[INFO] |  |     +- org.geotoolkit:geotk-xml-xsd:jar:5.0.0-MC0116:compile
[INFO] |  |     \- 
org.apache.sis.profiles:sis-french-profile:jar:2.0-M0076:compile
[INFO] |  +- org.geotoolkit:geotk-xml-sld:jar:5.0.0-MC0116:compile
[INFO] |  |  +- org.geotoolkit:geotk-xml-se:jar:5.0.0-MC0116:compile
[INFO] |  |  \- org.geotoolkit:geotk-style:jar:5.0.0-MC0116:compile
[INFO] |  \- org.geotoolkit:geotk-metadata-store:jar:5.0.0-MC0116:compile
[INFO] +- org.geotoolkit:geotk-xml-wms:jar:5.0.0-MC0116:compile
[INFO] |  +- org.geotoolkit:geotk-xml-ows:jar:5.0.0-MC0116:compile
[INFO] |  |  \- org.geotoolkit:geotk-utility:jar:5.0.0-MC0116:compile
[INFO] |  |     +- org.apache.sis.storage:sis-storage:jar:2.0-M0076:compile
[INFO] |  |     +- org.apache.sis.core:sis-referencing:jar:2.0-M0076:compile
[INFO] |  |     \- org.apache.sis.non-free:sis-embedded-data:jar:1.0:runtime
[INFO] |  \- org.geotoolkit:geotk-feature:jar:5.0.0-MC0116:compile
[INFO] |     +- org.apache.sis.core:sis-cql:jar:2.0-M0076:compile
[INFO] |     |  \- org.apache.sis.core:sis-feature:jar:2.0-M0076:compile
[INFO] |     +- org.geotoolkit:geotk-jtswrapper:jar:5.0.0-MC0116:compile
[INFO] |     +- org.geotoolkit:geotk-coverage:jar:5.0.0-MC0116:compile
[INFO] |     |  +- 
org.geotoolkit:geotk-coverage-imagery:jar:5.0.0-MC0116:compile
[INFO] +- org.geotoolkit:geotk-xml-gml:jar:5.0.0-MC0116:compile
[INFO] |  +- org.apache.sis.core:sis-utility:jar:2.0-M0076:compile
[INFO] |  |  \- org.opengis:geoapi-pending:jar:4.0-M15:compile
[INFO] |  +- org.geotoolkit:geotk-temporal:jar:5.0.0-MC0116:compile
[INFO] |  \- org.geotoolkit:geotk-geometry:jar:5.0.0-MC0116:compile

[1]
java.lang.NoClassDefFoundError: org/opengis/referencing/Factory
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
	at 
java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
	at 
java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:821)
	at 
java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:719)
	at 
java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:642)
	at 
java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:600)
	at 
java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
	at 
java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
	at 
java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:821)
	at 
java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:719)
	at 
java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:642)
	at 
java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:600)
	at 
java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:427)
	at 
java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass(ServiceLoader.java:1211)
	at 
java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1222)
	at 
java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1266)
	at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1301)
	at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1386)
	at 
org.apache.sis.internal.system.DefaultFactories.forClass(DefaultFactories.java:94)
	at 
org.apache.sis.internal.system.DefaultFactories.forBuildin(DefaultFactories.java:136)
	at 
org.apache.sis.referencing.factory.sql.EPSGFactory.factory(EPSGFactory.java:291)
	at 
org.apache.sis.referencing.factory.sql.EPSGFactory.<init>(EPSGFactory.java:278)
	at 
org.apache.sis.referencing.AuthorityFactories.EPSG(AuthorityFactories.java:122)
	at 
org.apache.sis.referencing.AuthorityFactories.initialValues(AuthorityFactories.java:216)
	at 
org.apache.sis.referencing.AuthorityFactories.initialValues(AuthorityFactories.java:53)
	at 
org.apache.sis.internal.referencing.LazySet.createCache(LazySet.java:138)
	at 
org.apache.sis.internal.referencing.LazySet.canPullMore(LazySet.java:156)
	at org.apache.sis.internal.referencing.LazySet.exists(LazySet.java:245)
	at org.apache.sis.internal.referencing.LazySet$1.hasNext(LazySet.java:280)
	at 
org.apache.sis.referencing.factory.MultiAuthoritiesFactory.getAuthorityFactory(MultiAuthoritiesFactory.java:636)
	at 
org.apache.sis.referencing.factory.MultiAuthoritiesFactory.create(MultiAuthoritiesFactory.java:860)
	at 
org.apache.sis.referencing.factory.MultiAuthoritiesFactory.createCoordinateReferenceSystem(MultiAuthoritiesFactory.java:921)
	at org.apache.sis.referencing.CRS.forCode(CRS.java:243)
	at 
org.fzj.ibg.catalog.server.tests.TestProj.transformPoint(TestProj.java:34)
	at 
org.fzj.ibg.catalog.server.tests.TestProj.testProjTransform(TestProj.java:28)
	at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)
	at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at 
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
	at 
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
	at 
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)
	at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at 
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at 
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at 
org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at 
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: java.lang.ClassNotFoundException: org.opengis.referencing.Factory
	at 
java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
	at 
java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	... 71 more




-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5335 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.osgeo.org/pipermail/geotoolkit/attachments/20210304/cdca6128/attachment.bin>


More information about the Geotoolkit mailing list