On Mon, Jul 05, 2021 at 02:24:41AM -0700, Aboubakr Aly Badr wrote:
> I am getting this error when trying to apply the Research Entities model to
> my test instance. Using this command:
> dspace dsrun org.dspace.app.util.InitializeEntities -f
> relationship-types.xml
>
> Exception: null
> java.lang.NullPointerException
> at
> org.dspace.app.util.InitializeEntities.parseXMLToRelations(InitializeEntities.java:131)
That line assumes the existence of at least one 'leftwardType' element
as a child of each 'type' element and tries to extract the text
content of the first one found.
https://github.com/DSpace/DSpace/blob/87bb9e44f07d11126eaa5dc194cdd885fa2f0058/dspace-api/src/main/java/org/dspace/app/util/InitializeEntities.java#L131
Your 'relationship-types.xml' contains 'type' elements having no
'leftwardType' elements. The code does not guard against missing
elements, so it throws a NullPointerException.
I'm not yet familiar enough with the entities configuration to say
whether your file or the code is incorrect. The code *is* fragile and
*does* throw an uninformative exception.
> The relationship-types.xml is attached.
> Any help?
> Thanks a lot
> Aboubakr Aly Badr
>
> --
> All messages to this mailing list should adhere to the Code of Conduct:
https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
> ---
> You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
dspace-tech...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/dspace-tech/5296b0d2-bd3e-49ec-bcc3-f1e605706987n%40googlegroups.com.
> <?xml version="1.0" encoding="UTF-8"?>
> <relationships>
> <type>
> <leftType>Publication</leftType>
> <rightType>Person</rightType>
> <leftLabel>isAuthorOfPublication</leftLabel>
> <rightLabel>isPublicationOfAuthor</rightLabel>
> <leftCardinality>
> <min>0</min>
> <!--<max></max> not specified, unlimited-->
> </leftCardinality>
> <rightCardinality>
> <min>0</min>
> <!--<max></max> not specified, unlimited-->
> </rightCardinality>
> </type>
> <type>
> <leftType>Publication</leftType>
> <rightType>Project</rightType>
> <leftLabel>isProjectOfPublication</leftLabel>
> <rightLabel>isPublicationOfProject</rightLabel>
> <leftCardinality>
> <min>0</min>
> </leftCardinality>
> <rightCardinality>
> <min>0</min>
> </rightCardinality>
> </type>
> <type>
> <leftType>Publication</leftType>
> <rightType>OrgUnit</rightType>
> <leftLabel>isOrgUnitOfPublication</leftLabel>
> <rightLabel>isPublicationOfOrgUnit</rightLabel>
> <leftCardinality>
> <min>0</min>
> </leftCardinality>
> <rightCardinality>
> <min>0</min>
> </rightCardinality>
> </type>
> <type>
> <leftType>Person</leftType>
> <rightType>Project</rightType>
> <leftLabel>isProjectOfPerson</leftLabel>
> <rightLabel>isPersonOfProject</rightLabel>
> <leftCardinality>
> <min>0</min>
> </leftCardinality>
> <rightCardinality>
> <min>0</min>
> </rightCardinality>
> </type>
> <type>
> <leftType>Person</leftType>
> <rightType>OrgUnit</rightType>
> <leftLabel>isOrgUnitOfPerson</leftLabel>
> <rightLabel>isPersonOfOrgUnit</rightLabel>
> <leftCardinality>
> <min>0</min>
> </leftCardinality>
> <rightCardinality>
> <min>0</min>
> </rightCardinality>
> </type>
> <type>
> <leftType>Project</leftType>
> <rightType>OrgUnit</rightType>
> <leftLabel>isOrgUnitOfProject</leftLabel>
> <rightLabel>isProjectOfOrgUnit</rightLabel>
> <leftCardinality>
> <min>0</min>
> </leftCardinality>
> <rightCardinality>
> <min>0</min>
> </rightCardinality>
> </type>
> </relationships>
--
Mark H. Wood
Lead Technology Analyst
University Library
Indiana University - Purdue University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
www.ulib.iupui.edu