Widoco icon indicating copy to clipboard operation
Widoco copied to clipboard

NullPointerException thrown by Consants.java

Open ldesousa opened this issue 10 months ago • 3 comments

Describe the bug Document generation ends with NullPointerException

To Reproduce Steps to reproduce the behavior:

Apply Widoco 1.4.25 to one of the GloSIS modules, e.g. glosis_unit.ttl:

$ java -jar /opt/widoco/widoco-1.4.25-jar-with-dependencies_JDK-11.jar -ontFile glosis_unit.ttl -outFolder glosis_unit -confFile glosis_unit.config -uniteSections -webVowl -rewriteAll
[main] INFO widoco.gui.GuiController -

--WIzard for DOCumenting Ontologies (WIDOCO).
 https://w3id.org/widoco/

[main] INFO widoco.WidocoUtils - Copying resource folder from lode to tmp1739963052650
[main] WARN widoco.Configuration - Error while reading configuration properties from [/opt/widoco/config/config.properties]: /opt/widoco/config/config.properties (No such file or directory)
[main] WARN widoco.Configuration - Error while loading the default property file: /opt/widoco/config/config.properties (No such file or directory)
[main] INFO widoco.gui.GuiController - Processed configuration, loading ontology now. isFromFile=true
[main] INFO widoco.WidocoUtils - Load ontology ../glosis_unit.ttl
[main] INFO widoco.CatalogIRIMapper - Creating JenaCatalogIRIMapper
[main] WARN org.semanticweb.owlapi.util.SAXParsers - http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit not supported by parser type org.apache.xerces.jaxp.SAXParserImpl, error message: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.
[main] WARN org.semanticweb.owlapi.util.SAXParsers - entityExpansionLimit not supported by parser type org.apache.xerces.jaxp.SAXParserImpl, error message: Property 'entityExpansionLimit' is not recognized.
[main] WARN org.semanticweb.owlapi.util.SAXParsers - http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit not supported by parser type org.apache.xerces.jaxp.SAXParserImpl, error message: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.
[main] WARN org.semanticweb.owlapi.util.SAXParsers - entityExpansionLimit not supported by parser type org.apache.xerces.jaxp.SAXParserImpl, error message: Property 'entityExpansionLimit' is not recognized.
[main] INFO widoco.gui.GuiController - Generating documentation for ../glosis_unit.ttl in lang en
[main] INFO widoco.CreateResources - Generate documentation in glosis_unit
[main] INFO widoco.CreateResources - - ontology IRI: http://w3id.org/glosis/model/unit
[main] INFO widoco.LODEParser - Parsing Complete!
[main] INFO widoco.WidocoUtils - Copying resource folder from webvowl_1.1.7_patched to glosis_unit/webvowl
[main] ERROR widoco.gui.GuiController - Error while generating the documentation: null
java.lang.NullPointerException
	at java.base/java.util.Objects.requireNonNull(Objects.java:233)
	at java.base/java.util.TreeMap.put(TreeMap.java:844)
	at java.base/java.util.TreeMap.put(TreeMap.java:569)
	at java.base/java.util.AbstractMap.putAll(AbstractMap.java:285)
	at java.base/java.util.TreeMap.putAll(TreeMap.java:361)
	at java.base/java.util.TreeMap.<init>(TreeMap.java:198)
	at widoco.Constants.getNameSpaceDeclaration(Constants.java:636)
	at widoco.CreateResources.createIntroductionSection(CreateResources.java:243)
	at widoco.CreateResources.generateDocumentation(CreateResources.java:92)
	at widoco.gui.GuiController.<init>(GuiController.java:329)
	at widoco.gui.GuiController.main(GuiController.java:555)

Expected behavior Document generation without exceptions.

Desktop (please complete the following information):

  • OS: Ubuntu 24.04
  • Browser: Brave
  • Version 1.4.25

Additional context This bug has been present since version 1.4.21.

ldesousa avatar Feb 19 '25 11:02 ldesousa

Hmm, this is odd. I can't reproduce this issue. Can you please share the configuration file? I ran:

java -jar widoco-1.4.25-jar-with-dependencies_JDK-11.jar -ontFile testOntos/glosis_unit.ttl -outFolder glosis_unit  -uniteSections -webVowl -rewriteAll

In java 11. And the output I got:

[main] INFO widoco.gui.GuiController - 

--WIzard for DOCumenting Ontologies (WIDOCO).
 https://w3id.org/widoco/

[main] INFO widoco.WidocoUtils - Copying resource folder from lode to tmp1739964835034
[main] WARN widoco.Configuration - Error while reading configuration properties from [/home/dgarijo/Dropbox/NetBeansProjects/Widoco/JAR/config/config.properties]: /home/dgarijo/Dropbox/NetBeansProjects/Widoco/JAR/config/config.properties (No such file or directory)
[main] WARN widoco.Configuration - Error while loading the default property file: /home/dgarijo/Dropbox/NetBeansProjects/Widoco/JAR/config/config.properties (No such file or directory)
[main] WARN widoco.Configuration - Error while reading configuration properties from []:  (No such file or directory)
[main] WARN widoco.Configuration - Error while reading configuration properties from []:  (No such file or directory)
[main] INFO widoco.gui.GuiController - Processed configuration, loading ontology now. isFromFile=true
[main] INFO widoco.WidocoUtils - Load ontology testOntos/glosis_unit.ttl
[main] INFO widoco.CatalogIRIMapper - Creating JenaCatalogIRIMapper
[main] WARN org.semanticweb.owlapi.util.SAXParsers - http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit not supported by parser type org.apache.xerces.jaxp.SAXParserImpl, error message: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.
[main] WARN org.semanticweb.owlapi.util.SAXParsers - entityExpansionLimit not supported by parser type org.apache.xerces.jaxp.SAXParserImpl, error message: Property 'entityExpansionLimit' is not recognized.
[main] WARN org.semanticweb.owlapi.util.SAXParsers - http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit not supported by parser type org.apache.xerces.jaxp.SAXParserImpl, error message: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.
[main] WARN org.semanticweb.owlapi.util.SAXParsers - entityExpansionLimit not supported by parser type org.apache.xerces.jaxp.SAXParserImpl, error message: Property 'entityExpansionLimit' is not recognized.
[main] INFO widoco.gui.GuiController - Generating documentation for testOntos/glosis_unit.ttl in lang en
[main] INFO widoco.gui.GuiController - Load properties from the ontology in lang en
[main] INFO widoco.CreateResources - Generate documentation in glosis_unit
[main] INFO widoco.CreateResources - - ontology IRI: http://w3id.org/glosis/model/unit
[main] INFO widoco.LODEParser - Parsing Complete!
[main] INFO widoco.WidocoUtils - Copying resource folder from webvowl_1.1.7_patched to glosis_unit/webvowl
[main] INFO widoco.CreateResources - No previous version provided. No changelog produced!
ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...
[main] INFO widoco.Configuration - Doc successfully generated for lang en
Documentation generated successfully

The documentation is generated correctly (see attached zip with the results). The list is interpreted a bit weirdly, I am not sure why it is used for the creators.

glosis_unit.zip

dgarijo avatar Feb 19 '25 11:02 dgarijo

This is the config file:

abstract=This ontology is one of the modules comprising Global Soil Information System (GloSIS) ontology. \n\n The GloSIS ontology was developed part of the SIEUSOIL project, which aims at implementing and testing a shared China-EU Web Observatory platform that will provide Linked (Open) Data to monitor status and threats of soil and land resources. \n\n The GloSIS ontology enables the representation of soil related data in semantic format. The ontology has been derived from the UML GLOSIS data model v1.0, and it has been created in line with best practices and methodologies, reusing existing standard models and ontologies, including sosa/ssn for the representation of measurements, or SKOS for the representation of codelists.\n\n<br>This module that introduces additional units of measurement that are absent from the qudt ontology.
ontologyTitle=GLOSIS units of measurement
ontologyName=GloSIS Ontology: Main module
thisVersionURI=http://w3id.org/glosis/model/unit/1.5.0
ontologyRevisionNumber=1.5.0
ontologyNamespaceURI=http://w3id.org/glosis/model/unit
status=GloSIS Ontology Specification Draft
licenseURI=https://creativecommons.org/licenses/by-nc-sa/3.0/igo/
licenseName=CC-BY-NC-SA-3.0-IGO
licenseIconURL=https://upload.wikimedia.org/wikipedia/commons/thumb/1/12/Cc-by-nc-sa_icon.svg/120px-Cc-by-nc-sa_icon.svg.png
authors=Raul Palma;Bogusz Janiak;Luís Moreira de Sousa;
authorsURI=http://orcid.org/0000-0003-4289-4922;;http://orcid.org/0000-0002-5851-2071;
authorsInstitution=PSNC;PSNC;Técnico ULisboa;
authorsInstitutionURI=;;;
contributors=
contributorsURI=
contributorsInstitution=
contributorsInstitutionURI=
importedOntologyNames=
importedOntologyURIs=

ldesousa avatar Feb 19 '25 16:02 ldesousa

will have to have a look

dgarijo avatar Feb 19 '25 18:02 dgarijo