Opened 11 years ago

Last modified 11 years ago

#1237 new defect

2.8.0 version introduced harvesting incompatibility

Reported by: cmartinez Owned by: geonetwork-devel@…
Priority: major Milestone: v2.8.1
Component: General Version: v2.8.0
Keywords: Cc: cmartinez

Description

The changes introduced on gn2.8 regarding language codes (e.g. 'eng' insted of 'en') have broken harvesting compatibility with pre-2.8.0 geonetwork versions.

Geonetwork 2.6 tries to connect to /geonetwork/srv/en/xml.search, which has changed to /geonetwork/srv/eng/xml.search in gn2.8.

The 2.8 server sends a HTTP/1.1 301 Moved Permanently response, but this is not handled at all by gn harvester, which tries to directly parse this response as an xml.search response and thus fails.

Attachments (1)

XmlRequest.java.patch (1.6 KB ) - added by cmartinez 11 years ago.
Patch for 2.6.x /jeeves/src/main/java/jeeves/utils/XmlRequest.java

Download all attachments as: .zip

Change History (6)

comment:1 by cmartinez, 11 years ago

Cc: cmartinez added

comment:2 by josegar74, 11 years ago

A fix to don't break 2.6, I think should be update WEB-INF/urlrewrite.xml language rules to use a redirect instead of permanent-redirect, like this:

  <rule>
        <from>^(.*)/en/(.*)$</from>
        <to type="redirect" last="true">%{context-path}$1/eng/$2</to>
   </rule>

After this change, GeoNetwork requires to be restarted.

I'll check if works ok and commit changes so are available for 2.8.1

comment:3 by cmartinez, 11 years ago

I am afraid it will not work without changes on 2.6, as the harvester is using POST method, and httpclient doesn't automatically handle redirects for POST (they have to be handled explicitly, getting the redirection address from the response and executing the request again for the new address).

by cmartinez, 11 years ago

Attachment: XmlRequest.java.patch added

Patch for 2.6.x /jeeves/src/main/java/jeeves/utils/XmlRequest.java

comment:4 by cmartinez, 11 years ago

I attach a patch for 2.6 version which solves the problem Warning: it is not a generic patch nor has not been tested thoroughly. Use it at your own risk!

comment:5 by ianwallen, 11 years ago

Milestone: v2.8.1
Note: See TracTickets for help on using tickets.