geonetwork / geonetwork/core-geonetwork
NPE when converting ISO-19139 record with URN-like `fileIdentifier` to DCAT
- Dominant language
- Java
- Stars
- 521
- Forks
- 514
- Avg merge
- 6d 13h
- Merged PRs (30d)
- 19
Description
**Describe the bug**
The following ISO-19139 record causes a "Connection refused" when converted to DCAT.
- Record: https://data.lillemetropole.fr/geonetwork/srv/api/records/urn:isogeo:metadata:uuid:0e52938b-5200-4127-8e32-a39b34501f57
- XML view (OK): https://data.lillemetropole.fr/geonetwork/srv/api/records/urn:isogeo:metadata:uuid:0e52938b-5200-4127-8e32-a39b34501f57/formatters/xml
- DCAT conversion (KO): https://data.lillemetropole.fr/geonetwork/srv/api/records/urn:isogeo:metadata:uuid:0e52938b-5200-4127-8e32-a39b34501f57/formatters/dcat
**Log file**
From 4.4.9 docker image:
```
2026-05-05 18:04:40.675:INFO:oejs.Server:main: Started @21723ms
Error at xsl:apply-templates on line 171 of dcat-core.xsl:
Exception in extension function java.lang.RuntimeException: java.lang.NullPointerException
2026-05-05T18:05:44,394 ERROR [geonetwork] - Exception in extension function java.lang.RuntimeException: java.lang.NullPointerException
net.sf.saxon.trans.XPathException: Exception in extension function java.lang.RuntimeException: java.lang.NullPointerException
at net.sf.saxon.functions.ExtensionFunctionCall.call(ExtensionFunctionCall.java:368) ~[saxon-9.1.0.8b-patch.jar:?]
...
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at org.fao.geonet.api.records.MetadataUtils.getAssociatedAsXml(MetadataUtils.java:183) ~[gn-services-4.4.9-0.jar:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
at net.sf.saxon.functions.ExtensionFunctionCall.invokeMethod(ExtensionFunctionCall.java:690) ~[saxon-9.1.0.8b-patch.jar:?]
at net.sf.saxon.functions.ExtensionFunctionCall.call(ExtensionFunctionCall.java:343) ~[saxon-9.1.0.8b-patch.jar:?]
... 161 more
Caused by: java.lang.NullPointerException
at org.fao.geonet.api.records.MetadataUtils.getAssociated(MetadataUtils.java:205) ~[gn-services-4.4.9-0.jar:?]
at org.fao.geonet.api.records.MetadataUtils.getAssociatedAsXml(MetadataUtils.java:158) ~[gn-services-4.4.9-0.jar:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
at net.sf.saxon.functions.ExtensionFunctionCall.invokeMethod(ExtensionFunctionCall.java:690) ~[saxon-9.1.0.8b-patch.jar:?]
at net.sf.saxon.functions.ExtensionFunctionCall.call(ExtensionFunctionCall.java:343) ~[saxon-9.1.0.8b-patch.jar:?]
... 161 more
```
**Additional comments**
I suspect the URN-like `fileIdentifier` "urn:isogeo:metadata:uuid:0e52938b-5200-4127-8e32-a39b34501f57" to cause this issue. Possibly related to https://github.com/geonetwork/core-geonetwork/issues/9170.
Contributor guide
Assessment
This issue has not been assessed yet.