Skip to content
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

mapfishapp - querying GN3 thesauri fails #1333

Closed
fvanderbiest opened this issue Mar 25, 2016 · 11 comments
Closed

mapfishapp - querying GN3 thesauri fails #1333

fvanderbiest opened this issue Mar 25, 2016 · 11 comments

Comments

@fvanderbiest
Copy link
Member

fvanderbiest commented Mar 25, 2016

capture du 2016-03-25 16 53 54

When selecting a thesaurus from the list in mapfishapp, a request is made:

/geonetwork/srv/fre/xml.search.keywords?pNewSearch=true&pKeyword=*&pTypeSearch=1&pMode=consult&pThesauri=external.theme.geobretagne

... which fails on GN3 with

org.jdom.IllegalAddException: Class java.lang.String is of unrecognized type and cannot be added
    org.jdom.ContentList.add(ContentList.java:142)
    org.jdom.ContentList.addAll(ContentList.java:292)
    org.jdom.ContentList.addAll(ContentList.java:262)
    org.jdom.Element.addContent(Element.java:825)
    org.fao.geonet.services.thesaurus.GetKeywords.exec(GetKeywords.java:153)
    org.fao.geonet.services.thesaurus.GetKeywords.deprecatedAPI(GetKeywords.java:89)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    java.lang.reflect.Method.invoke(Method.java:606)
@fvanderbiest
Copy link
Member Author

@fgravin any idea ?

@fgravin
Copy link
Member

fgravin commented Apr 6, 2016

Manifestement un problème avec la lib jdom ou bien un objet corrompu de notre côté.
Le paramètre pThesauri est converti par spring en ArrayList<String>, puis est ajouté en tant que Collection au noeud XML response.

Le code de l'ajout qui plante:

        if (obj instanceof String) {  // String is OK to add as special case
            obj = new Text(obj.toString());  // wrap it as a Content
        } else {
            throw new IllegalAddException("Class " +
                         obj.getClass().getName() +
                         " is of unrecognized type and cannot be added");
        }

En gros instanceof ne détecte pas que c'est une String, mais obj.getClass().getName() oui.

  • Essaie d'utiliser le service /keywords au lieu de xml.search.keywords
  • Tente avec le paramètre &_content_type=json

Je ne reproduis pas, est-ce pareil avec un autre thésaurus (external.place.regions) ?
Je ne pense pas que cela soit lié au thésaurus, mais sait-on jamais.

Pour la correction, on peut wrapper la String dans un TextElement si tu n'obtiens aucun service qui fonctionne.

@fvanderbiest fvanderbiest modified the milestones: 16.12, 16.06 Jun 28, 2016
@MaelREBOUX
Copy link
Member

Je croyais avoir vu passer un message quelque part incitant à modifier / tester une autre url de service des thesaurus.
J'ai rêvé ou pas ?

@fvanderbiest
Copy link
Member Author

J'ai rêvé ou pas ?

I guess so.

@fvanderbiest
Copy link
Member Author

fvanderbiest commented Dec 14, 2016

As reported in thread https://groups.google.com/forum/#!topic/georchestra/e_2NL8_Z8xc the error shows up when using this thesaurus: GeoBolivia.rdf.zip with GN3

@MaelREBOUX
Copy link
Member

@fvanderbiest
Copy link
Member Author

Indeed witnessed on https://portail.sig.rennesmetropole.fr/mapfishapp/

@fvanderbiest fvanderbiest assigned pmauduit and fgravin and unassigned fvanderbiest Jan 22, 2017
@Vampouille
Copy link
Contributor

Without Mode=consult parameter, it works, but I don't known if mapfishapp need thesaurus identifier and mode in response.

@Vampouille
Copy link
Contributor

Fixed by #1654

@fvanderbiest
Copy link
Member Author

Thanks Julien !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants