You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@sis.apache.org by cs...@gmail.com, cs...@gmail.com on 2019/06/03 07:48:30 UTC

Error in maven build

Hi there,

when trying to run a maven build by issuing "maven clean verify" the build fails with the message 

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sis-javafx: Compilation failure
[ERROR] module not found: javafx.graphics

I have to admit that I am not an expert in maven. I would be glad if there is a hint what is going wrong here.

Thanks in advance,

Christoph

Re: EPSG database encoding (was: Error in maven build)

Posted by Martin Desruisseaux <ma...@geomatys.com>.
Le 05/06/2019 à 12:06, csteinforth@gmail.com a écrit :

> the replace() is only taking place on the last part of the String concat:
>>             "  BBox[-90.00, -180.00, 90.00, 180.00],\n" +
>>             "  Id[\"EPSG\", 4326,\\E.*\\Q URI[\"urn:ogc:def:crs:EPSG:\\E.*\\Q:4326\"]]]\n\\E"   // Version number of EPSG dataset may vary.
>> .replace("\n", System.lineSeparator());

Yes, we noticed that. A fix has already been pushed on the geoapi-4.0
branch and will be merged to master during the day.

Thanks!

    Martin



Re: EPSG database encoding (was: Error in maven build)

Posted by cs...@gmail.com, cs...@gmail.com.
Martin,

the replace() is only taking place on the last part of the String concat:

>             "  BBox[-90.00, -180.00, 90.00, 180.00],\n" +
>             "  Id[\"EPSG\", 4326,\\E.*\\Q URI[\"urn:ogc:def:crs:EPSG:\\E.*\\Q:4326\"]]]\n\\E"   // Version number of EPSG dataset may vary.
> .replace("\n", System.lineSeparator());

Regards,

Christoph

Re: EPSG database encoding (was: Error in maven build)

Posted by cs...@gmail.com, cs...@gmail.com.
Martin,

for some reasons I do not fully understand yet this one

 private final String WGS84 =
            "\\QGeodeticCRS[\"WGS 84\",\n" +
            "  Datum[\"World Geodetic System 1984\",\n" +
            "    Ellipsoid[\"WGS 84\", 6378137.0, 298.257223563]],\n" +
            "  CS[ellipsoidal, 2],\n" +
            "    Axis[\"Latitude (B)\", north],\n" +
            "    Axis[\"Longitude (L)\", east],\n" +
            "    Unit[\"degree\", 0.017453292519943295],\n" +
            "  Scope[\"Horizontal component of 3D system.\\E.*\\Q\"],\n" +                      // EPSG geodetic dataset provides more details here.
            "  Area[\"\\E.*\\Q\"],\n" +                                                         // Language may vary because of SIS localization.
            "  BBox[-90.00, -180.00, 90.00, 180.00],\n" +
            "  Id[\"EPSG\", 4326,\\E.*\\Q URI[\"urn:ogc:def:crs:EPSG:\\E.*\\Q:4326\"]]]\n\\E"   // Version number of EPSG dataset may vary.
.replace("\n", System.lineSeparator());

is not working but this

private final String WGS84 = new String(
            "\\QGeodeticCRS[\"WGS 84\",\n" +
            "  Datum[\"World Geodetic System 1984\",\n" +
            "    Ellipsoid[\"WGS 84\", 6378137.0, 298.257223563]],\n" +
            "  CS[ellipsoidal, 2],\n" +
            "    Axis[\"Latitude (B)\", north],\n" +
            "    Axis[\"Longitude (L)\", east],\n" +
            "    Unit[\"degree\", 0.017453292519943295],\n" +
            "  Scope[\"Horizontal component of 3D system.\\E.*\\Q\"],\n" +                      // EPSG geodetic dataset provides more details here.
            "  Area[\"\\E.*\\Q\"],\n" +                                                         // Language may vary because of SIS localization.
            "  BBox[-90.00, -180.00, 90.00, 180.00],\n" +
            "  Id[\"EPSG\", 4326,\\E.*\\Q URI[\"urn:ogc:def:crs:EPSG:\\E.*\\Q:4326\"]]]\n\\E")   // Version number of EPSG dataset may vary.
            .replaceAll("\n", System.lineSeparator());

works.

Regards,

Christoph

Re: EPSG database encoding (was: Error in maven build)

Posted by Martin Desruisseaux <ma...@geomatys.com>.
Le 04/06/2019 à 17:00, csteinforth@gmail.com a écrit :

> in addition in the methods testURN() and testHTTP and the failures are
> gone! There is now only (…snip…)
>
Can you try a "git pull", then "mvn install" again? Now all test
failures should hopefully be gone.

    Thanks,

        Martin



Re: EPSG database encoding (was: Error in maven build)

Posted by cs...@gmail.com, cs...@gmail.com.
Martin,

I rpelaced this 

> Can you try the following replacement? in CRSCommandTest, method
> testCode(), replace the following line:
> 
>     final String wkt = test.outputBuffer.toString();
> 
> by
> 
>     String wkt = test.outputBuffer.toString();
>     wkt = wkt.replace(System.lineSeparator(), "\n");

in addition in the methods testURN() and testHTTP and the failures are gone! There is now only 

  <testcase name="testVerbose" classname="org.apache.sis.console.AboutCommandTest" time="0.745">
    <failure message="geoapi" type="java.lang.AssertionError">java.lang.AssertionError: geoapi
	at org.apache.sis.console.AboutCommandTest.testVerbose(AboutCommandTest.java:94)
</failure>

left.

I run the build both in Eclipse and from the command line, but it makes no difference. The command line version of maven is 3.6.1, the embedded version in Eclipse seems to be 3.5.3.

Regards,

Christoph

Re: EPSG database encoding (was: Error in maven build)

Posted by Martin Desruisseaux <ma...@geomatys.com>.
Le 04/06/2019 à 14:47, csteinforth@gmail.com a écrit :

> worked! The test runs fine, an the entries in the database are correct
> now. Thanks for your excellent help.
>
Good! Thanks for letting us know.


> There is one error remaining when running the ConsoleTestSuite:
>
> (…snip…)
> [ERROR] testVerbose(org.apache.sis.console.AboutCommandTest)  Time elapsed: 0.64 s  <<< FAILURE!
> java.lang.AssertionError: geoapi
> 	at org.apache.sis.console.AboutCommandTest.testVerbose(AboutCommandTest.java:94)

Are you running Maven from the command-line or from the IDE? Tests
should pass in both cases, but knowing the environment may help to
identify the problem.


> [ERROR] testCode(org.apache.sis.console.CRSCommandTest)  Time elapsed: 0.171 s  <<< FAILURE!

Can you try the following replacement? in CRSCommandTest, method
testCode(), replace the following line:

    final String wkt = test.outputBuffer.toString();

by

    String wkt = test.outputBuffer.toString();
    wkt = wkt.replace(System.lineSeparator(), "\n");

Does it help?

    Martin



Re: EPSG database encoding (was: Error in maven build)

Posted by cs...@gmail.com, cs...@gmail.com.
Hello Martin,

using this one

> 
>   <repositories>
>     <repository>
>       <id>geotoolkit</id>
>       <name>Geotoolkit.org repository</name>
>       <url>http://maven.geotoolkit.org</url>
>     </repository>
>   </repositories>
> 
> Then, use sis-epsg version 1.0-M1 (a milestone). That version use UTF-8

worked! The test runs fine, an the entries in the database are correct now. Thanks for your excellent help. 

There is one error remaining when running the ConsoleTestSuite:

[INFO] Running org.apache.sis.test.suite.ConsoleTestSuite
[ERROR] Tests run: 23, Failures: 2, Errors: 0, Skipped: 4, Time elapsed: 1.03 s <<< FAILURE! - in org.apache.sis.test.suite.ConsoleTestSuite
[ERROR] testVerbose(org.apache.sis.console.AboutCommandTest)  Time elapsed: 0.64 s  <<< FAILURE!
java.lang.AssertionError: geoapi
	at org.apache.sis.console.AboutCommandTest.testVerbose(AboutCommandTest.java:94)

[ERROR] testCode(org.apache.sis.console.CRSCommandTest)  Time elapsed: 0.171 s  <<< FAILURE!
java.lang.AssertionError: 
GeodeticCRS["WGS 84",
  Datum["World Geodetic System 1984",
    Ellipsoid["WGS 84", 6378137.0, 298.257223563]],
  CS[ellipsoidal, 2],
    Axis["Latitude (B)", north],
    Axis["Longitude (L)", east],
    Unit["degree", 0.017453292519943295],
  Scope["Horizontal component of 3D system. Used by the GPS satellite navigation system and for NATO military geodetic surveying."],
  Area["World."],
  BBox[-90.00, -180.00, 90.00, 180.00],
  Id["EPSG", 4326, "9.4", URI["urn:ogc:def:crs:EPSG:9.4:4326"]]]

	at org.apache.sis.console.CRSCommandTest.testCode(CRSCommandTest.java:63)

[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   AboutCommandTest.testVerbose:94 geoapi
[ERROR]   CRSCommandTest.testCode:63 GeodeticCRS["WGS 84",
  Datum["World Geodetic System 1984",
    Ellipsoid["WGS 84", 6378137.0, 298.257223563]],
  CS[ellipsoidal, 2],
    Axis["Latitude (B)", north],
    Axis["Longitude (L)", east],
    Unit["degree", 0.017453292519943295],
  Scope["Horizontal component of 3D system. Used by the GPS satellite navigation system and for NATO military geodetic surveying."],
  Area["World."],
  BBox[-90.00, -180.00, 90.00, 180.00],
  Id["EPSG", 4326, "9.4", URI["urn:ogc:def:crs:EPSG:9.4:4326"]]]

Is there anything missing in my setup?

Thanks in advance,

Christoph


Re: EPSG database encoding (was: Error in maven build)

Posted by Martin Desruisseaux <ma...@geomatys.com>.
Le 04/06/2019 à 13:51, csteinforth@gmail.com a écrit :

> I'm on Eclipse, there one can use the "Data Tools Platform". It seems
> that the encoding of the string is wrong in the database as the
> entries are like "Geocentre > equator/0�E".
>
I suspect a mismatch between the SIS version and "sis-epsg" version. The
EPSG database encoding changed from ISO LATIN-1 to UTF-8 maybe one year
ago. This change was reflected in the SIS code base on master, but the
sis-epsg version 0.8 on Maven central is still using ISO LATIN-1. Can
you try to use the following repository? (temporarily, you will be able
to delete it after SIS 1.0 release).

  <repositories>
    <repository>
      <id>geotoolkit</id>
      <name>Geotoolkit.org repository</name>
      <url>http://maven.geotoolkit.org</url>
    </repository>
  </repositories>

Then, use sis-epsg version 1.0-M1 (a milestone). That version use UTF-8
encoding. You can just delete SIS_DATA/Databases/SpatialMetadata
directory for forcing a new creation.

    Martin



Re: Error in maven build

Posted by cs...@gmail.com, cs...@gmail.com.
Hello Martin,

I'm on Eclipse, there one can use the "Data Tools Platform". It seems that the encoding of the string is wrong in the database as the entries are like "Geocentre > equator/0�E".

Christoph

Re: Error in maven build

Posted by Martin Desruisseaux <ma...@geomatys.com>.
Le 04/06/2019 à 12:46, csteinforth@gmail.com a écrit :
> Another question: on epsg.org there are some different zip to download:
>
> "EPSG MySQL, EPSG ORACLE SQL, EPSG PSQL latest versions of the Dataset in UTF encoding, as well as Well-known Text (WKT) in compliance with ISO 19162, are available from the online registry rather than this page."

I recommend the PSQL (PostgreSQL) one.

About the encoding problem, can you try to open the EPSG database and
check if "Geocentre > equator/0°E" is written with proper encoding in
the database? On Netbeans you can use the "Services" tab, "Databases",
create a "SpatialMetadata" entry pointing to the
"SIS_DATA/Databases/SpatialMetadata" directory using
"org.apache.derby.jdbc.EmbeddedDriver" driver. Then browse into
"EPSG/Tables/Coordinate Axis". Right click on "View data" and scroll
down to COORD_AXIS_CODE number 250. On other IDE I do not know…

Martin



Re: Error in maven build

Posted by cs...@gmail.com, cs...@gmail.com.
Hello Martin,

the database was created by sis-epsg. I'm on Windows 7 and the command "[System.Text.Encoding]::Default" on powershell shows Windows-1252.

Another question: on epsg.org there are some different zip to download:

"EPSG MySQL, EPSG ORACLE SQL, EPSG PSQL latest versions of the Dataset in UTF encoding, as well as Well-known Text (WKT) in compliance with ISO 19162, are available from the online registry rather than this page.

Through Archives you may obtain SQL and MS Access for earlier releases of the EPSG Dataset."

Which one is the correct in order to run with sis?

Thanks in advance,

Christoph

Re: Error in maven build

Posted by Martin Desruisseaux <ma...@geomatys.com>.
Le 04/06/2019 à 11:41, csteinforth@gmail.com a écrit :
> (…snip…)
> The test fails due to "Geocentre > equator/0?E". I guess this must be "Geocentre > equator/0°E". Ist this an encoding issue?

Indeed it looks like an encoding issue. How was created the EPSG
database? From sis-epsg or from SQL scripts downloaded from
www.epsg.org? And what is the native encoding of your system?

    Martin



Re: Error in maven build

Posted by cs...@gmail.com, cs...@gmail.com.
Hello Martin,

thanks for your hint concerning sis-epsg. The database was created on SIS_DATA, so the message concerning missing Tables.sql is no longer there. But, unfortunately, I encounter another problem:

[INFO] Running org.apache.sis.test.suite.ReferencingTestSuite
WARNUNG       [CommonCRS.geocentric] Can not instantiate geodetic object for “EPSG:4978”.
?             Caused by FactoryDataException: Axis direction “Geocentre > equator/0?E” is unknown.

The test fails due to "Geocentre > equator/0?E". I guess this must be "Geocentre > equator/0°E". Ist this an encoding issue?

Thanks in advance,

Christoph

Re: Error in maven build

Posted by Martin Desruisseaux <ma...@geomatys.com>.
Hello Christophe

Thanks for letting us know that it worked.

Le 04/06/2019 à 09:55, csteinforth@gmail.com a écrit :

> (…snip…)
> INFORMATION   [EPSGFactory.install] Creating EPSG schema in the “jdbc:derby:L:/Christoph/SIS_DATA/Databases/SpatialMetadata” database.
> WARNUNG       [CommonCRS.geographic] Can not instantiate geodetic object for “EPSG:4326”.
> ?             Caused by UnavailableFactoryException: Can not create the EPSG schema in database.
> ?             Caused by FileNotFoundException: File “Tables.sql” has not been found.
> (…snip…)
>
> I guess I have to add sis-epsg somewhere?

Yes. sis-epsg can not be on the Apache SIS classpath by default for
legal reasons, in order to make sure that users are aware that EPSG
licensing terms are different than Apache license. You can ignore the
warnings for now and create your own application. If sis-epsg is on the
classpath of your application and the SIS_DATA environment variable is
defined, than SIS will automatically creates the database in that
directory. The next time that you run the tests, SIS will detect that
the database exists and will use it even if the sis-epsg module is not
on the classpath.

Alternatively you can also download the SQL scripts manually from
http://www.epsg.org/ and unzip them in the
SIS_DATA/Databases/ExternalSources/ directory. SIS will use them
automatically for creating the database. Note: the version currently
available on www.epsg.org is more recent than the one currently bundled
in sis-epsg and I did not yet had an opportunity to test it with SIS.
However the compatibility between different versions of EPSG dataset is
generally good.

      Martin



Re: Error in maven build

Posted by cs...@gmail.com, cs...@gmail.com.
Hello Martin

this one

>     mvn install --fail-at-end

fixed my issue. Thanks for your quick help. I noticed that there are some messages like

[INFO] Running org.apache.sis.test.suite.ReferencingTestSuite
INFORMATION   [EPSGFactory.install] Creating EPSG schema in the “jdbc:derby:L:/Christoph/SIS_DATA/Databases/SpatialMetadata” database.
WARNUNG       [CommonCRS.geographic] Can not instantiate geodetic object for “EPSG:4326”.
?             Caused by UnavailableFactoryException: Can not create the EPSG schema in database.
?             Caused by FileNotFoundException: File “Tables.sql” has not been found.
INFORMATION   [EPSGFactory.install] Creating EPSG schema in the “jdbc:derby:L:/Christoph/SIS_DATA/Databases/SpatialMetadata” database.
WARNUNG       [TestFactorySource.createFactory] org.apache.sis.referencing.factory.UnavailableFactoryException: Can not create the EPSG schema in database.
?             Caused by FileNotFoundException: File “Tables.sql” has not been found.

I guess I have to add sis-epsg somewhere?

Thanks again in advance,

Christoph

Re: Error in maven build

Posted by Martin Desruisseaux <ma...@geomatys.com>.
Hello Christoph

Le 03/06/2019 à 09:48, csteinforth@gmail.com a écrit :

> when trying to run a maven build by issuing "maven clean verify" the build fails with the message 
>
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sis-javafx: Compilation failure
> [ERROR] module not found: javafx.graphics

Apache SIS is not yet fully compatible with Java 11 or 12; the current
build requires Java 10. We are aware that this is a serious limitation
and we will fix it before release [1]. A partial patch is already
available [2] and I hope to apply it this week. In the meantime, the
easiest approach may be to skip the module that requires it. You can try
the following command:

    mvn install --fail-at-end

The build will still fail, but it should succeed in building modules
that do not depend on JavaFX.

In the near future we may temporarily disable the JavaFX module anyway.
It is not yet ready, and the removal of JavaFX from Java standard
edition bring a legal issue for which we do not yet have a clear answer [3].

    Regards,

        Martin

[1] https://issues.apache.org/jira/browse/SIS-438
[2] https://github.com/apache/sis/pull/16
[3] https://issues.apache.org/jira/browse/LEGAL-336