-
-
Notifications
You must be signed in to change notification settings - Fork 493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to GeoTools 23.0 #4488
Migrate to GeoTools 23.0 #4488
Conversation
Don't forget to test WFS feature indexing which was not working (XY order issue) in our last try of updating GT (see #3886) |
Don't understand how I can test it ... :/ |
https://geonetwork-opensource.org/manuals/trunk/en/user-guide/analyzing/data.html?highlight=wfs
|
Trying to install ES with your tuto, but where is supposed to be the es/es-config directory ? |
Fixed errors in the doc and updated version number. |
I installed ES, started it, loaded the indices, updated the URL in WEB-INF/config.properties and restarted it. But when I add a layer to the map and go to filter tab, it says something like "Error accessing index" and I have not button to index the data. |
What does |
I doesn't test it on localhost, I deploy the war on a VM with tomcat9. http://localhost:8080/geonetwork/warninghealthcheck = > Error creating bean with name 'EsSearchManager': Unsatisfied dependency expressed through field 'client': No qualifying bean of type [org.fao.geonet.es.EsClient] found for dependency [org.fao.geonet.es.EsClient] |
So you need to build the app with |
With |
Ok it seems to progress : http://localhost:8080/geonetwork/warninghealthcheck :
Now in filter tab it says something like "Entities not indexed", but I still not have any button to index them. |
With a metadata produced from OGC harvester using https://demo.geo-solutions.it/geoserver ? Once harvested add USA pop on the map and you should be able to have |
Yes. I tried to harvest both WMS and WMTS, it creates a metadata for WMS/WFS service. Here is a part the log for WFS :
I checked create metadata for each layer and it look like layers can't load, but the error message is not very explicit... I also have a new tab "Data Harvester" which lists jobs for WFS indexations, but it's empty. |
I use exactly the same, but still have no layers loaded with this warn in logs :
|
Bizarre. Works also fine on https://vanilla.geocat.net/geonetwork/srv/fre/admin.console#/harvest Can you choose a User in the config ? Error is not super explicit - sounds similar to when the group was mandatory (but it is supposed to be solved in master branch) |
Selecting a user solve the problem, I managed to load all layers, and when add one and go to filter tab, I can index entities. After index entities, I have new filters on the layer based on fields. |
I think problem you mentioned is not solved, because indexed entities are located in South Pole :( |
Weird (I'll try to have a look to the user issue) and good you made harvesting work.
We tried a couple of options suggested by @jodygarnett #3886 (comment) with no luck in last Bolsena sprint. Would be good to manage to find a solution to move forward on this. |
I tried use of WFSDataStoreFactory.AXIS_ORDER in WFSHarvesterExchangeState like suggested by @jodygarnett and it seems to work well with topp:states layer. When clear and reindexing features, they are at the right place on the map, and I have no more ES error log related to Y value overflow. |
But not work with layers over Italy like geosolutions:regioni... |
5d99d81
to
908df9b
Compare
After many tests, I manage to force axis order for WGS84 :
And it handle corectly topp:states from https://demo.geo-solutions.it/geoserver But when trying with geosolutions:regioni which have an EPSG:3044 CRS, it doesn't work. Logs of features retieved with getFeatures show coords like this :
The CRS is updated, but the coordinates still in EPSG:3044, no reprojection done. Same problem with others SRS like EPSG:26713 of sf:roads layer. |
WIth this commit, it works with both topp:states and geosolutions:regioni from https://demo.geo-solutions.it/geoserver What I understand searching infos around the web :
The problem was that the feature reprojection defined in setCoordinateSystemReproject function didn't work, so features sent to ElasticSearch were not in WGS84 but in native CRS. Moreover, ElasticSearch expects WGS84 with longitude/latitude axis order (x/y), so the best way to get it is to :
For the GeoServer anarchy, I think as the official WGS84 axis order is latitude/longitude (y/x), we should handle only this axis order... This currently work because we use GML3 and no srsName param. |
As part of this bug hunt I documented what geoserver does here TLDR: Each WFS / WMS specification changes what the EPSG codes mean ... and GeoServer does its best to keep up! WFS servers (MapServer, deegree, GeoServer, ArcGIS) manage to have every variation of axis order incorrect .. so GeoNetwork will need to provide flags to allow harvester to be configured to connect to each service (there will never be a solution to this only configuration). |
@jusabatier see above, configuration options are required. The previous geotools client did its best to "guess" workarounds; in practice this meant there were always WFS servers we could not talk to. The new client provides additional connection parameters. |
...harvester/src/main/java/org/fao/geonet/harvester/wfsfeatures/worker/EsWFSFeatureIndexer.java
Show resolved
Hide resolved
I really like this approach, reproject whatever contents is returned to CRS:84 because we cannot trust the different WFS implementations. It also looks like all features are being requested, so we do not need to worry about different implementations getting axis order confused on the request. What is needed for this work to go ahead? |
Putting in a kind word for GeoServer here, the anarchy is the specifications, it is actually a real bother to follow what they are doing and implement them "correctly". If you stay with a specific protocol version (example WFS 2.0 + GML 3.2) the result is consistent. When you mix and match the result is the madness you describe :) |
This is looking good to me, can we rebase this PR and put it up for review? |
@@ -1443,7 +1446,7 @@ | |||
|
|||
<!-- NOTE: When updating GeoTools, check which version | |||
of Postgres is used and update pg.version if needed. --> | |||
<geotools.version>22.3</geotools.version> | |||
<geotools.version>23.0</geotools.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should build once more when GeoTools is officially anounced, we are currently having a build issue due to the new osgeo repo ... performing faster and allowing multi-threaded builds to trip on themselves. The Maven local repository is not thread safe apparently ...
@jusabatier please if you can fix the conflicts, I'll check to test next week and merge it, thanks. |
I fixed the conflicts. Compile fine when skipping tests. But when doing them I have an error :
|
NoSuchMethod seems like we need more information? Looking at withReprojTo3857:
A MockMultipartHttpServletRequest is being setup, and I guess a call is being made to it that was not anticipated... Looking at processLayersZip:102 shows:
This is an example of mock testing being very fragile :P |
I get this test error:
With |
@josegar74 as in this: mockMvc.perform(get("/srv/api/records/" + MAIN_UUID + "/related")
.session(mockHttpSession)
.accept(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andExpect(content().contentType(API_JSON_EXPECTED_ENCODING)); Do you have the surefire results stack trace anywhere? |
@josegar74 running this locally works for me:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue with the test seemed some local issue, in travis is passing fine.
Thank you, happy to see this go ahead |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Merged in branch 4.0.x too. Thanks.
It looks like on some setup this introduced this error (happens on different services validation, related resource) - may not be related to this update - I don't really know. On docker with
and sounds related to org.glassfish.jaxb:jaxb-runtime:jar
The class is also provided by Java rt.jar. Anyone observing this? Any suggestions? |
It is a common problem ... when upgrading to Java 11 (on newer systems you have to enable jaxb and javax.annotations). Can you double check what version of Java you are starting up please @fxprunayre? |
What is weird is that it is same WAR based on master deployed on docker with tomcat:8-jre8. So I don't expect that this kind of errors could happen on some and not on other - We have 4 apps deployed for test/prod and only one is having the issue. |
Generaly, it's due to the fact that JAXB APIs are considered to be Java EE APIs and therefore are no longer contained on the default classpath in Java SE 9. In Java 11, they are completely removed from the JDK. So if you run it on JAVA 8, it should work, but not in JAVA 9 or above. Here are some solutions : https://stackoverflow.com/questions/43574426/how-to-resolve-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception-in-j |
is/will this be backported to 3.10? |
No plans to backport this work to 3.10 |
* Migrate to GeoTools 22.3 * Correct feature reprojection in WFS indexation * Upgrade to GeoTools 23.0 * Remove unusefull query and add final statement to close iterator
Modifications for migrate to GeoTools 23.0
Compile OK with mvn clean install
Start without error in JAVA11 / Tomcat9
Still have to test :
Related to #3882