[GeoNetwork-users] GN.3.2 Cannot convert ger to 2 char iso lang code

Hi.

Whenever is try to edit a metadata record i get a whole bunch of exceptions
starting with

Cannot convert ger to 2 char iso lang code
at org.fao.geonet.util.XslUtil.twoCharLangCode(XslUtil.java:403)
.....

The metadata in question are imports from GN-2.10.4 (via XML) and they are
in german.
..
<gmd:language><gmd:LanguageCode
codeList="http://www.loc.gov/standards/iso639-2/&quot; codeListValue="ger"/>
..

Geonetwork itself is called in German
http://cnvbrwgdit2.net.vlr.gv.at:8900/geonetwork/srv/ger/catalog.edit#/board

Are there some special configuration steps necessary in order to support
german metadata documents?

Thanks
Andy

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/GN-3-2-Cannot-convert-ger-to-2-char-iso-lang-code-tp5289622.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

Hi,

I can't help with a solution, but I see the same error in my log files for
English-language Geonetwork 3.2.x even when I'm not uploading metadata:

2016-10-06 15:07:51,699 ERROR [geonetwork] - Cannot convert English to 2
char iso lang code
java.lang.Error
at org.fao.geonet.util.XslUtil.twoCharLangCode(XslUtil.java:403)
at org.fao.geonet.util.XslUtil.twoCharLangCode(XslUtil.java:364)
at sun.reflect.GeneratedMethodAccessor480.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
net.sf.saxon.functions.ExtensionFunctionCall.invokeMethod(ExtensionFunctionCall.java:690)
at
net.sf.saxon.functions.ExtensionFunctionCall.call(ExtensionFunctionCall.java:343)
at
net.sf.saxon.functions.ExtensionFunctionCall.iterate(ExtensionFunctionCall.java:224)
at net.sf.saxon.expr.Expression.evaluateItem(Expression.java:352)
at net.sf.saxon.functions.ForceCase.evaluateItem(ForceCase.java:23)
at net.sf.saxon.functions.Concat.evaluateItem(Concat.java:38)
at net.sf.saxon.expr.ExpressionTool.evaluate(ExpressionTool.java:296)
at net.sf.saxon.expr.LetExpression.eval(LetExpression.java:339)
at
net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:548)
at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:556)
at net.sf.saxon.instruct.Template.expand(Template.java:220)
at net.sf.saxon.instruct.CallTemplate.process(CallTemplate.java:257)
at net.sf.saxon.instruct.DocumentInstr.evaluateItem(DocumentInstr.java:278)
at net.sf.saxon.expr.ExpressionTool.evaluate(ExpressionTool.java:296)
at net.sf.saxon.expr.LetExpression.eval(LetExpression.java:339)
at
net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:548)
at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:556)
at net.sf.saxon.instruct.Instruction.process(Instruction.java:93)
at
net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:296)
at net.sf.saxon.instruct.Template.applyLeavingTail(Template.java:203)
at
net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:345)
at net.sf.saxon.Controller.transformDocument(Controller.java:1807)
at net.sf.saxon.Controller.transform(Controller.java:1621)
at org.fao.geonet.utils.Xml.transform(Xml.java:486)
at org.fao.geonet.utils.Xml.transform(Xml.java:375)
at
org.fao.geonet.kernel.search.SearchManager.getIndexFields(SearchManager.java:1082)
at
org.fao.geonet.kernel.search.SearchManager.buildIndexDocument(SearchManager.java:751)
at org.fao.geonet.kernel.search.SearchManager.index(SearchManager.java:693)
at org.fao.geonet.kernel.DataManager.indexMetadata(DataManager.java:765)
at org.fao.geonet.kernel.IndexMetadataTask.run(IndexMetadataTask.java:114)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

So I don't think it's specific to German or to uploading metadata...

Jo

On Thu, Oct 6, 2016 at 2:02 PM, sulu <andreas.siegel@anonymised.com> wrote:

Hi.

Whenever is try to edit a metadata record i get a whole bunch of exceptions
starting with

Cannot convert ger to 2 char iso lang code
at org.fao.geonet.util.XslUtil.twoCharLangCode(XslUtil.java:403)
.....

The metadata in question are imports from GN-2.10.4 (via XML) and they are
in german.
..
<gmd:language><gmd:LanguageCode
codeList="http://www.loc.gov/standards/iso639-2/&quot; codeListValue="ger"/>
..

Geonetwork itself is called in German
http://cnvbrwgdit2.net.vlr.gv.at:8900/geonetwork/srv/ger/
catalog.edit#/board

Are there some special configuration steps necessary in order to support
german metadata documents?

Thanks
Andy

--
View this message in context: http://osgeo-org.1560.x6.
nabble.com/GN-3-2-Cannot-convert-ger-to-2-char-iso-
lang-code-tp5289622.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.

------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/
projects/geonetwork

--
*Jo Cook*
t:+44 7930 524 155/twitter:@archaeogeek

--
--
Astun Technology Ltd, The Coach House, 17 West Street, Epsom, Surrey, KT18
7RL, UK
t:+44 1372 744 009 w: astuntechnology.com twitter:@astuntech
<https://twitter.com/astuntech&gt;

iShare - enterprise geographic intelligence platform
<https://astuntechnology.com/ishare/&gt;
GeoServer, PostGIS and QGIS training
<https://astuntechnology.com/services/#training&gt;
Helpdesk and customer portal
<http://support.astuntechnology.com/support/login&gt;

Company registration no. 5410695. Registered in England and Wales.
Registered office: 120 Manor Green Road, Epsom, Surrey, KT19 8LN VAT no.
864201149.

Hi

Can you check what contains the element /gmd:MD_Metadata/gmd:language
element? I could reproduce the issue with a value that contains locale
information, not only the language:

  <gmd:language>
    <gco:CharacterString>eng; CAN</gco:CharacterString>
  </gmd:language>

If I change to this, works for me:

  <gmd:language>
    <gco:CharacterString>eng</gco:CharacterString>
  </gmd:language>

Regards,

Jose García

On Thu, Oct 6, 2016 at 5:11 PM, Jo Cook <jocook@anonymised.com> wrote:

Hi,

I can't help with a solution, but I see the same error in my log files for
English-language Geonetwork 3.2.x even when I'm not uploading metadata:

2016-10-06 15:07:51,699 ERROR [geonetwork] - Cannot convert English to 2
char iso lang code
java.lang.Error
at org.fao.geonet.util.XslUtil.twoCharLangCode(XslUtil.java:403)
at org.fao.geonet.util.XslUtil.twoCharLangCode(XslUtil.java:364)
at sun.reflect.GeneratedMethodAccessor480.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
net.sf.saxon.functions.ExtensionFunctionCall.invokeMethod(
ExtensionFunctionCall.java:690)
at
net.sf.saxon.functions.ExtensionFunctionCall.call(
ExtensionFunctionCall.java:343)
at
net.sf.saxon.functions.ExtensionFunctionCall.iterate(
ExtensionFunctionCall.java:224)
at net.sf.saxon.expr.Expression.evaluateItem(Expression.java:352)
at net.sf.saxon.functions.ForceCase.evaluateItem(ForceCase.java:23)
at net.sf.saxon.functions.Concat.evaluateItem(Concat.java:38)
at net.sf.saxon.expr.ExpressionTool.evaluate(ExpressionTool.java:296)
at net.sf.saxon.expr.LetExpression.eval(LetExpression.java:339)
at
net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:548)
at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:556)
at net.sf.saxon.instruct.Template.expand(Template.java:220)
at net.sf.saxon.instruct.CallTemplate.process(CallTemplate.java:257)
at net.sf.saxon.instruct.DocumentInstr.evaluateItem(
DocumentInstr.java:278)
at net.sf.saxon.expr.ExpressionTool.evaluate(ExpressionTool.java:296)
at net.sf.saxon.expr.LetExpression.eval(LetExpression.java:339)
at
net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:548)
at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:556)
at net.sf.saxon.instruct.Instruction.process(Instruction.java:93)
at
net.sf.saxon.instruct.ElementCreator.processLeavingTail(
ElementCreator.java:296)
at net.sf.saxon.instruct.Template.applyLeavingTail(Template.java:203)
at
net.sf.saxon.instruct.ApplyTemplates.applyTemplates(
ApplyTemplates.java:345)
at net.sf.saxon.Controller.transformDocument(Controller.java:1807)
at net.sf.saxon.Controller.transform(Controller.java:1621)
at org.fao.geonet.utils.Xml.transform(Xml.java:486)
at org.fao.geonet.utils.Xml.transform(Xml.java:375)
at
org.fao.geonet.kernel.search.SearchManager.getIndexFields(
SearchManager.java:1082)
at
org.fao.geonet.kernel.search.SearchManager.buildIndexDocument(
SearchManager.java:751)
at org.fao.geonet.kernel.search.SearchManager.index(
SearchManager.java:693)
at org.fao.geonet.kernel.DataManager.indexMetadata(DataManager.java:765)
at org.fao.geonet.kernel.IndexMetadataTask.run(IndexMetadataTask.java:114)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(
ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(
ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

So I don't think it's specific to German or to uploading metadata...

Jo

On Thu, Oct 6, 2016 at 2:02 PM, sulu <andreas.siegel@anonymised.com> wrote:

> Hi.
>
> Whenever is try to edit a metadata record i get a whole bunch of
exceptions
> starting with
>
> Cannot convert ger to 2 char iso lang code
> at org.fao.geonet.util.XslUtil.twoCharLangCode(XslUtil.java:403)
> .....
>
> The metadata in question are imports from GN-2.10.4 (via XML) and they
are
> in german.
> ..
> <gmd:language><gmd:LanguageCode
> codeList="http://www.loc.gov/standards/iso639-2/&quot; codeListValue="ger"/>
> ..
>
> Geonetwork itself is called in German
> http://cnvbrwgdit2.net.vlr.gv.at:8900/geonetwork/srv/ger/
> catalog.edit#/board
>
> Are there some special configuration steps necessary in order to support
> german metadata documents?
>
> Thanks
> Andy
>
>
>
>
>
> --
> View this message in context: http://osgeo-org.1560.x6.
> nabble.com/GN-3-2-Cannot-convert-ger-to-2-char-iso-
> lang-code-tp5289622.html
> Sent from the GeoNetwork users mailing list archive at Nabble.com.
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> GeoNetwork-users mailing list
> GeoNetwork-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geonetwork-users
> GeoNetwork OpenSource is maintained at http://sourceforge.net/
> projects/geonetwork
>

--
*Jo Cook*
t:+44 7930 524 155/twitter:@archaeogeek

--
--
Astun Technology Ltd, The Coach House, 17 West Street, Epsom, Surrey, KT18
7RL, UK
t:+44 1372 744 009 w: astuntechnology.com twitter:@astuntech
<https://twitter.com/astuntech&gt;

iShare - enterprise geographic intelligence platform
<https://astuntechnology.com/ishare/&gt;
GeoServer, PostGIS and QGIS training
<https://astuntechnology.com/services/#training&gt;
Helpdesk and customer portal
<http://support.astuntechnology.com/support/login&gt;

Company registration no. 5410695. Registered in England and Wales.
Registered office: 120 Manor Green Road, Epsom, Surrey, KT19 8LN VAT no.
864201149.
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/
projects/geonetwork

--

*Vriendelijke groeten / Kind regards,Jose García
<http://www.geocat.net/&gt;Veenderweg 136721 WD BennekomThe NetherlandsT: +31
(0)318 416664 <+31318416664> <https://www.facebook.com/geocatbv&gt;
<https://twitter.com/geocat_bv&gt;
<https://plus.google.com/u/1/+GeocatNetbv/posts&gt;Please consider the
environment before printing this email.*

Hi,

2016-10-06 17:29 GMT+02:00 Jose Garcia <jose.garcia@anonymised.com>:

Hi

Can you check what contains the element /gmd:MD_Metadata/gmd:language
element? I could reproduce the issue with a value that contains locale
information, not only the language:

  <gmd:language>
    <gco:CharacterString>eng; CAN</gco:CharacterString>
  </gmd:language>

If I change to this, works for me:

  <gmd:language>
    <gco:CharacterString>eng</gco:CharacterString>
  </gmd:language>

Not sure if related, but it is better to encode language using the
following (see templates provided by default):
<language>
  <LanguageCode codeList="" codeListValue="eng"/>
</language>

This is required for INSPIRE at least, and even if GeoNetwork should
support both forms, the codeList mode is safer I think.

Francois

Regards,

Jose García

On Thu, Oct 6, 2016 at 5:11 PM, Jo Cook <jocook@anonymised.com>
wrote:

> Hi,
>
> I can't help with a solution, but I see the same error in my log files
for
> English-language Geonetwork 3.2.x even when I'm not uploading metadata:
>
> 2016-10-06 15:07:51,699 ERROR [geonetwork] - Cannot convert English to 2
> char iso lang code
> java.lang.Error
> at org.fao.geonet.util.XslUtil.twoCharLangCode(XslUtil.java:403)
> at org.fao.geonet.util.XslUtil.twoCharLangCode(XslUtil.java:364)
> at sun.reflect.GeneratedMethodAccessor480.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at
> net.sf.saxon.functions.ExtensionFunctionCall.invokeMethod(
> ExtensionFunctionCall.java:690)
> at
> net.sf.saxon.functions.ExtensionFunctionCall.call(
> ExtensionFunctionCall.java:343)
> at
> net.sf.saxon.functions.ExtensionFunctionCall.iterate(
> ExtensionFunctionCall.java:224)
> at net.sf.saxon.expr.Expression.evaluateItem(Expression.java:352)
> at net.sf.saxon.functions.ForceCase.evaluateItem(ForceCase.java:23)
> at net.sf.saxon.functions.Concat.evaluateItem(Concat.java:38)
> at net.sf.saxon.expr.ExpressionTool.evaluate(ExpressionTool.java:296)
> at net.sf.saxon.expr.LetExpression.eval(LetExpression.java:339)
> at
> net.sf.saxon.expr.LetExpression.processLeavingTail(
LetExpression.java:548)
> at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:556)
> at net.sf.saxon.instruct.Template.expand(Template.java:220)
> at net.sf.saxon.instruct.CallTemplate.process(CallTemplate.java:257)
> at net.sf.saxon.instruct.DocumentInstr.evaluateItem(
> DocumentInstr.java:278)
> at net.sf.saxon.expr.ExpressionTool.evaluate(ExpressionTool.java:296)
> at net.sf.saxon.expr.LetExpression.eval(LetExpression.java:339)
> at
> net.sf.saxon.expr.LetExpression.processLeavingTail(
LetExpression.java:548)
> at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:556)
> at net.sf.saxon.instruct.Instruction.process(Instruction.java:93)
> at
> net.sf.saxon.instruct.ElementCreator.processLeavingTail(
> ElementCreator.java:296)
> at net.sf.saxon.instruct.Template.applyLeavingTail(Template.java:203)
> at
> net.sf.saxon.instruct.ApplyTemplates.applyTemplates(
> ApplyTemplates.java:345)
> at net.sf.saxon.Controller.transformDocument(Controller.java:1807)
> at net.sf.saxon.Controller.transform(Controller.java:1621)
> at org.fao.geonet.utils.Xml.transform(Xml.java:486)
> at org.fao.geonet.utils.Xml.transform(Xml.java:375)
> at
> org.fao.geonet.kernel.search.SearchManager.getIndexFields(
> SearchManager.java:1082)
> at
> org.fao.geonet.kernel.search.SearchManager.buildIndexDocument(
> SearchManager.java:751)
> at org.fao.geonet.kernel.search.SearchManager.index(
> SearchManager.java:693)
> at org.fao.geonet.kernel.DataManager.indexMetadata(DataManager.java:765)
> at org.fao.geonet.kernel.IndexMetadataTask.run(
IndexMetadataTask.java:114)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(
> ThreadPoolExecutor.java:1142)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(
> ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
>
>
> So I don't think it's specific to German or to uploading metadata...
>
> Jo
>
> On Thu, Oct 6, 2016 at 2:02 PM, sulu <andreas.siegel@anonymised.com>
wrote:
>
> > Hi.
> >
> > Whenever is try to edit a metadata record i get a whole bunch of
> exceptions
> > starting with
> >
> > Cannot convert ger to 2 char iso lang code
> > at org.fao.geonet.util.XslUtil.twoCharLangCode(XslUtil.java:403)
> > .....
> >
> > The metadata in question are imports from GN-2.10.4 (via XML) and they
> are
> > in german.
> > ..
> > <gmd:language><gmd:LanguageCode
> > codeList="http://www.loc.gov/standards/iso639-2/&quot;
codeListValue="ger"/>
> > ..
> >
> > Geonetwork itself is called in German
> > http://cnvbrwgdit2.net.vlr.gv.at:8900/geonetwork/srv/ger/
> > catalog.edit#/board
> >
> > Are there some special configuration steps necessary in order to
support
> > german metadata documents?
> >
> > Thanks
> > Andy
> >
> >
> >
> >
> >
> > --
> > View this message in context: http://osgeo-org.1560.x6.
> > nabble.com/GN-3-2-Cannot-convert-ger-to-2-char-iso-
> > lang-code-tp5289622.html
> > Sent from the GeoNetwork users mailing list archive at Nabble.com.
> >
> > ------------------------------------------------------------
> > ------------------
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> > _______________________________________________
> > GeoNetwork-users mailing list
> > GeoNetwork-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/geonetwork-users
> > GeoNetwork OpenSource is maintained at http://sourceforge.net/
> > projects/geonetwork
> >
>
>
>
> --
> *Jo Cook*
> t:+44 7930 524 155/twitter:@archaeogeek
>
> --
> --
> Astun Technology Ltd, The Coach House, 17 West Street, Epsom, Surrey,
KT18
> 7RL, UK
> t:+44 1372 744 009 w: astuntechnology.com twitter:@astuntech
> <https://twitter.com/astuntech&gt;
>
> iShare - enterprise geographic intelligence platform
> <https://astuntechnology.com/ishare/&gt;
> GeoServer, PostGIS and QGIS training
> <https://astuntechnology.com/services/#training&gt;
> Helpdesk and customer portal
> <http://support.astuntechnology.com/support/login&gt;
>
> Company registration no. 5410695. Registered in England and Wales.
> Registered office: 120 Manor Green Road, Epsom, Surrey, KT19 8LN VAT no.
> 864201149.
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> GeoNetwork-users mailing list
> GeoNetwork-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geonetwork-users
> GeoNetwork OpenSource is maintained at http://sourceforge.net/
> projects/geonetwork
>

--

*Vriendelijke groeten / Kind regards,Jose García
<http://www.geocat.net/&gt;Veenderweg 136721 WD BennekomThe NetherlandsT: +31
(0)318 416664 <+31318416664> <https://www.facebook.com/geocatbv&gt;
<https://twitter.com/geocat_bv&gt;
<https://plus.google.com/u/1/+GeocatNetbv/posts&gt;Please consider the
environment before printing this email.*
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
GeoNetwork-users mailing list
GeoNetwork-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/
projects/geonetwork